Move save and resetDefault actions to the adminSiteSettingsCategory controller

This commit is contained in:
Neil Lalonde 2013-11-14 14:46:17 -05:00
parent df213d7b23
commit ca0a8a5970
4 changed files with 49 additions and 45 deletions

View File

@ -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();
}
}
});

View File

@ -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')
});

View File

@ -1426,4 +1426,5 @@ en:
trust: 'Trust Levels'
spam: 'Spam'
rate_limits: 'Rate Limits'
developer: 'Developer'
uncategorized: 'Uncategorized'

View File

@ -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