discourse/app/assets/javascripts/discourse/routes/groups-new.js.es6

25 lines
520 B
JavaScript

import DiscourseRoute from "discourse/routes/discourse";
import Group from "discourse/models/group";
export default DiscourseRoute.extend({
showFooter: true,
titleToken() {
return I18n.t("admin.groups.new.title");
},
model() {
return Group.create({ automatic: false, visibility_level: 0 });
},
setupController(controller, model) {
controller.set("model", model);
},
afterModel() {
if (!(this.currentUser && this.currentUser.admin)) {
this.transitionTo("groups");
}
}
});