This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/routes/groups-new.js.es6
Mark VanLandingham e5311ab645 DEV: Import DiscourseRoute rather than Discourse.Route (#8225)
* DEV: Discourse.Route -> DiscourseRoute with import

* ran prettier on all routes

* prettiered one more file
2019-10-22 09:46:10 -04:00

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");
}
}
});