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