2014-08-13 07:04:36 +08:00
|
|
|
import ObjectController from 'discourse/controllers/object';
|
|
|
|
|
2013-06-04 04:12:24 +08:00
|
|
|
/**
|
|
|
|
This controller previews an email digest
|
|
|
|
|
|
|
|
@class AdminEmailPreviewDigestController
|
2014-08-13 07:04:36 +08:00
|
|
|
@extends ObjectController
|
2013-06-04 04:12:24 +08:00
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2014-08-13 07:04:36 +08:00
|
|
|
export default ObjectController.extend({
|
2013-06-04 04:12:24 +08:00
|
|
|
|
2013-09-17 02:08:55 +08:00
|
|
|
actions: {
|
|
|
|
refresh: function() {
|
|
|
|
var model = this.get('model'),
|
|
|
|
self = this;
|
|
|
|
|
|
|
|
self.set('loading', true);
|
|
|
|
Discourse.EmailPreview.findDigest(this.get('lastSeen')).then(function (email) {
|
|
|
|
model.setProperties(email.getProperties('html_content', 'text_content'));
|
|
|
|
self.set('loading', false);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
toggleShowHtml: function() {
|
|
|
|
this.toggleProperty('showHtml');
|
|
|
|
}
|
2013-06-04 04:12:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|