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

42 lines
1.1 KiB
JavaScript
Raw Normal View History

Discourse.AdminFlagsIndexRoute = Discourse.Route.extend({
2013-07-19 11:26:04 +08: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'));
2014-08-05 04:48:04 +08:00
},
});
Discourse.AdminFlagsActiveRoute = Discourse.AdminFlagsRouteType.extend({
filter: 'active',
actions: {
2014-08-05 04:48:04 +08:00
showAgreeFlagModal: function (flaggedPost) {
Discourse.Route.showModal(this, 'admin_agree_flag', flaggedPost);
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
},
showDeleteFlagModal: function (flaggedPost) {
Discourse.Route.showModal(this, 'admin_delete_flag', flaggedPost);
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
}
}
});
Discourse.AdminFlagsOldRoute = Discourse.AdminFlagsRouteType.extend({
filter: 'old'
});