discourse/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6
Leo McArdle fe5264f9e9 filter by username in email digest preview
adds a user prompt on the email digest preview page to generate a preview for a particular user
also fixes some broken styling on the page
2015-10-30 18:11:38 +00:00

19 lines
457 B
JavaScript

export default Ember.Controller.extend({
actions: {
refresh() {
const model = this.get('model');
this.set('loading', true);
Discourse.EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
model.setProperties(email.getProperties('html_content', 'text_content'));
this.set('loading', false);
});
},
toggleShowHtml() {
this.toggleProperty('showHtml');
}
}
});