2017-10-31 02:13:49 +08:00
|
|
|
import computed from 'ember-addons/ember-computed-decorators';
|
|
|
|
|
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() {
|
|
|
|
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(' ');
|
|
|
|
}
|
2014-03-19 12:18:04 +08:00
|
|
|
});
|