2013-02-22 15:41:12 -05:00
|
|
|
/**
|
|
|
|
Our data model for representing an email log.
|
2013-02-20 13:15:50 -05:00
|
|
|
|
2013-03-05 15:39:21 -05:00
|
|
|
@class EmailLog
|
2013-02-22 15:41:12 -05:00
|
|
|
@extends Discourse.Model
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
2013-03-05 15:39:21 -05:00
|
|
|
**/
|
2013-02-22 15:41:12 -05:00
|
|
|
Discourse.EmailLog = Discourse.Model.extend({});
|
2013-02-21 14:09:28 -05:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
Discourse.EmailLog.reopenClass({
|
|
|
|
create: function(attrs) {
|
|
|
|
if (attrs.user) {
|
|
|
|
attrs.user = Discourse.AdminUser.create(attrs.user);
|
|
|
|
}
|
|
|
|
return this._super(attrs);
|
|
|
|
},
|
2013-02-21 14:09:28 -05:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
findAll: function(filter) {
|
|
|
|
var result;
|
|
|
|
result = Em.A();
|
2013-03-05 15:39:21 -05:00
|
|
|
$.ajax({
|
2013-02-22 15:41:12 -05:00
|
|
|
url: "/admin/email_logs.json",
|
|
|
|
data: { filter: filter },
|
|
|
|
success: function(logs) {
|
|
|
|
logs.each(function(log) {
|
|
|
|
result.pushObject(Discourse.EmailLog.create(log));
|
|
|
|
});
|
2013-02-20 13:15:50 -05:00
|
|
|
}
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
});
|
2013-02-21 14:09:28 -05:00
|
|
|
|
2013-02-20 13:15:50 -05:00
|
|
|
|