Can't revert due to incompatibility of new site setting types.

Revert "Revert "FEATURE: Site settings defaults per locale""

This reverts commit 439fe8ba2453cff835cda33a5593bb9fa769120c.
This commit is contained in:
Guo Xiang Tan
2017-08-07 10:43:09 +09:00
parent 439fe8ba24
commit 3f24ed2b3e
28 changed files with 1373 additions and 364 deletions

View File

@ -64,16 +64,16 @@ export default Ember.Component.extend(BufferedContent, {
}.on("willDestroyElement"),
_save() {
const self = this,
setting = this.get('buffered');
SiteSetting.update(setting.get('setting'), setting.get('value')).then(function() {
self.set('validationMessage', null);
self.commitBuffer();
}).catch(function(e) {
const setting = this.get('buffered'),
action = SiteSetting.update(setting.get('setting'), setting.get('value'));
action.then(() => {
this.set('validationMessage', null);
this.commitBuffer();
}).catch((e) => {
if (e.jqXHR.responseJSON && e.jqXHR.responseJSON.errors) {
self.set('validationMessage', e.jqXHR.responseJSON.errors[0]);
this.set('validationMessage', e.jqXHR.responseJSON.errors[0]);
} else {
self.set('validationMessage', I18n.t('generic_error'));
this.set('validationMessage', I18n.t('generic_error'));
}
});
},