discourse/app/assets/javascripts/admin/controllers/admin.js.es6
Bianca Nenciu e68ecf1f1d UX: Add link to Groups in admin dashboard. (#6480)
* UX: Add link to Groups in admin dashboard.

* UX: Site settings have immediate effect.
2018-10-12 10:34:47 +11:00

32 lines
786 B
JavaScript

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;
},
@computed("application.currentPath")
adminContentsClassName(currentPath) {
return currentPath
.split(".")
.filter(segment => {
return (
segment !== "index" &&
segment !== "loading" &&
segment !== "show" &&
segment !== "admin"
);
})
.map(Ember.String.dasherize)
.join(" ");
}
});