discourse/app/assets/javascripts/discourse/routes/group-manage.js.es6
2018-04-09 15:14:50 +08:00

24 lines
556 B
JavaScript

export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.manage.title');
},
model() {
return this.modelFor('group');
},
afterModel(group) {
if (!this.currentUser ||
!(this.currentUser.admin && group.get('automatic')) &&
!this.currentUser.canManageGroup(group)) {
this.transitionTo("group.members", group);
}
},
setupController(controller, model) {
this.controllerFor('group-manage').setProperties({ model });
this.controllerFor("group").set("showing", 'manage');
},
});