mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
8366fcd78f
during filtering)
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
export default Ember.ObjectController.extend({
|
|
categoryNameKey: null,
|
|
needs: ['adminSiteSettings'],
|
|
|
|
filteredContent: function() {
|
|
if (!this.get('categoryNameKey')) { return []; }
|
|
|
|
var category = this.get('controllers.adminSiteSettings.content').findProperty('nameKey', this.get('categoryNameKey'));
|
|
if (category) {
|
|
return category.siteSettings;
|
|
} else {
|
|
return [];
|
|
}
|
|
}.property('controllers.adminSiteSettings.content', 'categoryNameKey'),
|
|
|
|
actions: {
|
|
|
|
/**
|
|
Reset a setting to its default value
|
|
|
|
@method resetDefault
|
|
@param {Discourse.SiteSetting} setting The setting we want to revert
|
|
**/
|
|
resetDefault: function(setting) {
|
|
setting.set('value', setting.get('default'));
|
|
setting.save();
|
|
},
|
|
|
|
/**
|
|
Save changes to a site setting
|
|
|
|
@method save
|
|
@param {Discourse.SiteSetting} setting The setting we've changed
|
|
**/
|
|
save: function(setting) {
|
|
setting.save();
|
|
},
|
|
|
|
/**
|
|
Cancel changes to a site setting
|
|
|
|
@method cancel
|
|
@param {Discourse.SiteSetting} setting The setting we've changed but want to revert
|
|
**/
|
|
cancel: function(setting) {
|
|
setting.resetValue();
|
|
}
|
|
}
|
|
|
|
});
|