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