Move save and resetDefault actions to the adminSiteSettingsCategory controller
This commit is contained in:
parent
df213d7b23
commit
ca0a8a5970
|
@ -14,6 +14,40 @@ Discourse.AdminSiteSettingsCategoryController = Ember.ObjectController.extend({
|
|||
} else {
|
||||
return Em.A();
|
||||
}
|
||||
}.property('controllers.adminSiteSettings.content', 'categoryNameKey')
|
||||
}.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();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -55,40 +55,6 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P
|
|||
});
|
||||
|
||||
this.set('model', matchesGroupedByCategory);
|
||||
}.observes('filter', 'onlyOverridden'),
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}.observes('filter', 'onlyOverridden')
|
||||
|
||||
});
|
||||
|
|
|
@ -1426,4 +1426,5 @@ en:
|
|||
trust: 'Trust Levels'
|
||||
spam: 'Spam'
|
||||
rate_limits: 'Rate Limits'
|
||||
developer: 'Developer'
|
||||
uncategorized: 'Uncategorized'
|
||||
|
|
|
@ -259,6 +259,16 @@ rate_limits:
|
|||
max_edits_per_day: 30
|
||||
max_favorites_per_day: 20
|
||||
|
||||
developer:
|
||||
force_hostname: ''
|
||||
port:
|
||||
default:
|
||||
development: 3000
|
||||
default: ''
|
||||
queue_jobs:
|
||||
default:
|
||||
test: false
|
||||
default: true
|
||||
|
||||
uncategorized:
|
||||
tos_url:
|
||||
|
@ -323,16 +333,9 @@ uncategorized:
|
|||
auto_track_topics_after: 240000
|
||||
new_topic_duration_minutes: 2880
|
||||
long_polling_interval: 15000
|
||||
force_hostname: ''
|
||||
port:
|
||||
default:
|
||||
development: 3000
|
||||
default: ''
|
||||
|
||||
use_ssl: false
|
||||
queue_jobs:
|
||||
default:
|
||||
test: false
|
||||
default: true
|
||||
|
||||
|
||||
category_featured_topics:
|
||||
client: true
|
||||
|
|
Loading…
Reference in New Issue