2013-06-04 04:12:24 +08:00
|
|
|
/**
|
|
|
|
Handles routes for admin reports
|
|
|
|
|
|
|
|
@class AdminReportsRoute
|
|
|
|
@extends Discourse.Route
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2015-11-21 09:27:06 +08:00
|
|
|
export default Discourse.Route.extend({
|
2013-02-28 11:39:42 +08:00
|
|
|
model: function(params) {
|
2015-12-02 07:31:30 +08:00
|
|
|
const Report = require('admin/models/report').default;
|
|
|
|
return Report.find(params.type);
|
2014-11-06 03:46:27 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function(controller, model) {
|
|
|
|
controller.setProperties({
|
|
|
|
model: model,
|
2015-07-04 01:12:40 +08:00
|
|
|
categoryId: 'all',
|
2014-11-06 03:46:27 +08:00
|
|
|
startDate: moment(model.get('start_date')).format('YYYY-MM-DD'),
|
|
|
|
endDate: moment(model.get('end_date')).format('YYYY-MM-DD')
|
|
|
|
});
|
2013-02-28 11:39:42 +08:00
|
|
|
}
|
2014-06-10 23:54:38 +08:00
|
|
|
});
|