discourse/app/assets/javascripts/admin/routes/admin-email-preview-digest.js.es6

21 lines
468 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import {
default as EmailPreview,
oneWeekAgo
} from "admin/models/email-preview";
2015-08-16 17:51:31 +08:00
export default Discourse.Route.extend({
model() {
2018-06-15 23:03:24 +08:00
return EmailPreview.findDigest(this.currentUser.get("username"));
2015-08-16 17:51:31 +08:00
},
afterModel(model) {
2018-06-15 23:03:24 +08:00
const controller = this.controllerFor("adminEmailPreviewDigest");
2015-08-16 17:51:31 +08:00
controller.setProperties({
model,
2018-06-15 23:03:24 +08:00
username: this.currentUser.get("username"),
lastSeen: oneWeekAgo(),
2015-08-16 17:51:31 +08:00
showHtml: true
});
}
});