2014-07-29 01:39:20 +08:00
|
|
|
export default Discourse.Route.extend({
|
2014-01-31 06:10:36 +08:00
|
|
|
|
2014-02-07 05:14:32 +08:00
|
|
|
model: function(params) {
|
|
|
|
return Discourse.Group.find(params.name);
|
2014-02-07 02:06:19 +08:00
|
|
|
},
|
2014-01-31 06:10:36 +08:00
|
|
|
|
2014-02-19 05:43:02 +08:00
|
|
|
serialize: function(model) {
|
|
|
|
return { name: model.get('name').toLowerCase() };
|
|
|
|
},
|
|
|
|
|
2014-02-13 03:00:45 +08:00
|
|
|
afterModel: function(model) {
|
|
|
|
var self = this;
|
2014-02-19 05:17:04 +08:00
|
|
|
return Discourse.Group.findGroupCounts(model.get('name')).then(function (counts) {
|
|
|
|
self.set('counts', counts);
|
2014-02-13 03:00:45 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function(controller, model) {
|
|
|
|
controller.setProperties({
|
|
|
|
model: model,
|
2014-02-19 05:17:04 +08:00
|
|
|
counts: this.get('counts')
|
2014-02-13 03:00:45 +08:00
|
|
|
});
|
|
|
|
}
|
2014-01-31 06:10:36 +08:00
|
|
|
});
|