discourse/app/assets/javascripts/admin/controllers/admin.js.es6

32 lines
786 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import computed from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
application: Ember.inject.controller(),
@computed("siteSettings.enable_group_directory")
showGroups(enableGroupDirectory) {
return !enableGroupDirectory;
},
@computed("siteSettings.enable_badges")
showBadges(enableBadges) {
return this.currentUser.get("admin") && enableBadges;
},
2018-06-15 23:03:24 +08:00
@computed("application.currentPath")
adminContentsClassName(currentPath) {
2018-06-15 23:03:24 +08:00
return currentPath
.split(".")
.filter(segment => {
return (
segment !== "index" &&
segment !== "loading" &&
segment !== "show" &&
segment !== "admin"
);
})
.map(Ember.String.dasherize)
.join(" ");
}
});