discourse/app/assets/javascripts/admin/routes/admin_flags_route.js

31 lines
705 B
JavaScript
Raw Normal View History

Discourse.AdminFlagsIndexRoute = Discourse.Route.extend({
2013-07-18 23:26:04 -04:00
redirect: function() {
this.transitionTo('adminFlags.active');
}
});
Discourse.AdminFlagsRouteType = Discourse.Route.extend({
model: function() {
return Discourse.FlaggedPost.findAll(this.get('filter'));
},
setupController: function(controller, model) {
var adminFlagsController = this.controllerFor('adminFlags');
adminFlagsController.set('content', model);
adminFlagsController.set('query', this.get('filter'));
}
});
Discourse.AdminFlagsActiveRoute = Discourse.AdminFlagsRouteType.extend({
filter: 'active'
});
Discourse.AdminFlagsOldRoute = Discourse.AdminFlagsRouteType.extend({
filter: 'old'
});