2019-10-22 21:46:10 +08:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2020-01-17 01:56:53 +08:00
|
|
|
import EmailPreview, { oneWeekAgo } from "admin/models/email-preview";
|
2015-11-21 09:27:06 +08:00
|
|
|
|
2019-10-22 21:46:10 +08:00
|
|
|
export default DiscourseRoute.extend({
|
2015-08-16 17:51:31 +08:00
|
|
|
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({
|
2017-06-29 03:36:34 +08:00
|
|
|
model,
|
2018-06-15 23:03:24 +08:00
|
|
|
username: this.currentUser.get("username"),
|
2017-06-29 03:36:34 +08:00
|
|
|
lastSeen: oneWeekAgo(),
|
2015-08-16 17:51:31 +08:00
|
|
|
showHtml: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|