mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 05:47:31 +08:00
21 lines
575 B
JavaScript
21 lines
575 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(' ');
|
|
}
|
|
});
|