2014-02-14 18:50:08 -05:00
|
|
|
/**
|
|
|
|
Handles routes related to viewing email logs.
|
|
|
|
|
|
|
|
@class AdminEmailSentRoute
|
|
|
|
@extends Discourse.Route
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
|
|
|
Discourse.AdminEmailLogsRoute = Discourse.Route.extend({
|
|
|
|
|
|
|
|
model: function() {
|
|
|
|
return Discourse.EmailLog.findAll({ status: this.get("status") });
|
|
|
|
},
|
|
|
|
|
2014-02-17 15:58:28 -05:00
|
|
|
setupController: function(controller, model) {
|
|
|
|
this._super(controller, model);
|
2014-02-14 18:50:08 -05:00
|
|
|
// resets the filters
|
|
|
|
controller.set("filter", { status: this.get("status") });
|
|
|
|
},
|
|
|
|
|
|
|
|
renderTemplate: function() {
|
|
|
|
this.render("admin/templates/email_" + this.get("status"), { into: "adminEmail" });
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2014-02-14 19:17:13 -05:00
|
|
|
Discourse.AdminEmailAllRoute = Discourse.AdminEmailLogsRoute.extend({ status: "all" });
|
2014-02-14 18:50:08 -05:00
|
|
|
Discourse.AdminEmailSentRoute = Discourse.AdminEmailLogsRoute.extend({ status: "sent" });
|
|
|
|
Discourse.AdminEmailSkippedRoute = Discourse.AdminEmailLogsRoute.extend({ status: "skipped" });
|