mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
Discourse.AdminFlagsIndexRoute = Discourse.Route.extend({
|
|
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'));
|
|
},
|
|
|
|
actions: {
|
|
/**
|
|
Deletes a user and all posts and topics created by that user.
|
|
|
|
@method deleteSpammer
|
|
**/
|
|
deleteSpammer: function (user) {
|
|
user.deleteAsSpammer(function() { window.location.reload(); });
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
Discourse.AdminFlagsActiveRoute = Discourse.AdminFlagsRouteType.extend({
|
|
filter: 'active',
|
|
|
|
actions: {
|
|
|
|
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'
|
|
});
|
|
|
|
|
|
|