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(),
|
|
|
|
|
2018-10-12 07:34:47 +08:00
|
|
|
@computed("siteSettings.enable_group_directory")
|
|
|
|
showGroups(enableGroupDirectory) {
|
|
|
|
return !enableGroupDirectory;
|
|
|
|
},
|
|
|
|
|
|
|
|
@computed("siteSettings.enable_badges")
|
|
|
|
showBadges(enableBadges) {
|
|
|
|
return this.currentUser.get("admin") && enableBadges;
|
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
|
|
|
});
|