mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:23:13 +08:00
27 lines
635 B
JavaScript
27 lines
635 B
JavaScript
import computed from "ember-addons/ember-computed-decorators";
|
|
|
|
export default Ember.Controller.extend({
|
|
application: Ember.inject.controller(),
|
|
|
|
@computed
|
|
showBadges() {
|
|
return this.currentUser.get("admin") && this.siteSettings.enable_badges;
|
|
},
|
|
|
|
@computed("application.currentPath")
|
|
adminContentsClassName(currentPath) {
|
|
return currentPath
|
|
.split(".")
|
|
.filter(segment => {
|
|
return (
|
|
segment !== "index" &&
|
|
segment !== "loading" &&
|
|
segment !== "show" &&
|
|
segment !== "admin"
|
|
);
|
|
})
|
|
.map(Ember.String.dasherize)
|
|
.join(" ");
|
|
}
|
|
});
|