mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
Can revert changes to email templates
This commit is contained in:
@ -6,11 +6,23 @@ export default Ember.Controller.extend(bufferedProperty('emailTemplate'), {
|
||||
|
||||
actions: {
|
||||
saveChanges() {
|
||||
const model = this.get('emailTemplate');
|
||||
const buffered = this.get('buffered');
|
||||
model.save(buffered.getProperties('subject', 'body')).then(() => {
|
||||
this.get('emailTemplate').save(buffered.getProperties('subject', 'body')).then(() => {
|
||||
this.set('saved', true);
|
||||
}).catch(popupAjaxError);
|
||||
},
|
||||
|
||||
revertChanges() {
|
||||
this.set('saved', false);
|
||||
bootbox.confirm(I18n.t('admin.customize.email_templates.revert_confirm'), result => {
|
||||
if (result) {
|
||||
this.get('emailTemplate').revert().then(props => {
|
||||
const buffered = this.get('buffered');
|
||||
buffered.setProperties(props);
|
||||
this.commitBuffer();
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user