2015-09-17 10:20:21 -04:00
|
|
|
import Group from 'discourse/models/group';
|
|
|
|
|
2015-01-21 14:52:48 -05:00
|
|
|
export default Discourse.Route.extend({
|
2014-04-23 13:25:02 -04:00
|
|
|
|
|
|
|
model: function(params) {
|
2015-09-17 10:20:21 -04:00
|
|
|
var groups = this.modelFor('adminGroupsType');
|
|
|
|
if (params.name === 'new') {
|
|
|
|
return Group.create({
|
|
|
|
automatic: false,
|
|
|
|
visible: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
var group = groups.findProperty('name', params.name);
|
2014-04-23 13:25:02 -04:00
|
|
|
|
|
|
|
if (!group) { return this.transitionTo('adminGroups.index'); }
|
2015-01-21 14:52:48 -05:00
|
|
|
|
2014-04-23 13:25:02 -04:00
|
|
|
return group;
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function(controller, model) {
|
2015-01-05 12:51:45 -05:00
|
|
|
controller.set("model", model);
|
2015-08-13 10:01:29 -04:00
|
|
|
controller.set("model.usernames", null);
|
2015-01-05 12:51:45 -05:00
|
|
|
model.findMembers();
|
2014-04-23 13:25:02 -04:00
|
|
|
}
|
2015-01-05 12:51:45 -05:00
|
|
|
|
2014-04-23 13:25:02 -04:00
|
|
|
});
|