2018-06-15 23:03:24 +08:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
2017-10-31 02:13:49 +08:00
|
|
|
|
2015-08-12 00:27:07 +08:00
|
|
|
export default Ember.Controller.extend({
|
2017-10-31 02:13:49 +08:00
|
|
|
application: Ember.inject.controller(),
|
|
|
|
|
|
|
|
@computed
|
|
|
|
showBadges() {
|
2018-06-15 23:03:24 +08:00
|
|
|
return this.currentUser.get("admin") && this.siteSettings.enable_badges;
|
2017-10-31 02:13:49 +08:00
|
|
|
},
|
|
|
|
|
2018-06-15 23:03:24 +08:00
|
|
|
@computed("application.currentPath")
|
2017-10-31 02:13:49 +08:00
|
|
|
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(" ");
|
2017-10-31 02:13:49 +08:00
|
|
|
}
|
2014-03-19 12:18:04 +08:00
|
|
|
});
|