mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 20:33:43 +08:00
8517674a32
FIX: Disallow renaming of system badges FIX: Disallow renaming/deleting of system badge groupings UX: Use "modern" button style in badge groupings dialog
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
import computed from 'ember-addons/ember-computed-decorators';
|
|
import RestModel from 'discourse/models/rest';
|
|
|
|
export default RestModel.extend({
|
|
|
|
@computed('name')
|
|
i18nNameKey() {
|
|
return this.get('name').toLowerCase().replace(/\s/g, '_');
|
|
},
|
|
|
|
@computed('name')
|
|
displayName() {
|
|
const i18nKey = `badges.badge_grouping.${this.get('i18nNameKey')}.name`;
|
|
return I18n.t(i18nKey, {defaultValue: this.get('name')});
|
|
}
|
|
});
|