FIX: dual modal when deleting spammer in the flag modal

This commit is contained in:
Régis Hanol 2014-08-29 13:05:51 +02:00
parent 521cb6bd0d
commit fd6dd88afb
3 changed files with 10 additions and 14 deletions

View File

@ -15,18 +15,6 @@ Discourse.AdminFlagsRouteType = Discourse.Route.extend({
adminFlagsController.set('query', this.get('filter'));
},
actions: {
/**
Deletes a user and all posts and topics created by that user.
@method deleteSpammer
**/
deleteSpammer: function (user) {
this.send('closeModal');
user.deleteAsSpammer(function() { window.location.reload(); });
}
}
});
Discourse.AdminFlagsActiveRoute = Discourse.AdminFlagsRouteType.extend({

View File

@ -136,7 +136,16 @@ var ApplicationRoute = Em.Route.extend({
router.controllerFor('editCategory').set('selectedTab', 'general');
});
}
},
/**
Deletes a user and all posts and topics created by that user.
@method deleteSpammer
**/
deleteSpammer: function (user) {
this.send('closeModal');
user.deleteAsSpammer(function() { window.location.reload(); });
}
},

View File

@ -28,7 +28,6 @@
{{/if}}
{{#if canDeleteSpammer}}
<button class="btn btn-danger" {{action deleteSpammer}} {{bind-attr disabled="submitDisabled"}} title="{{i18n flagging.delete_spammer}}"><i class="fa fa-exclamation-triangle"></i> {{i18n flagging.delete_spammer}}</button>
<button class="btn btn-danger" {{action deleteSpammer userDetails}} {{bind-attr disabled="submitDisabled"}} title="{{i18n flagging.delete_spammer}}"><i class="fa fa-exclamation-triangle"></i> {{i18n flagging.delete_spammer}}</button>
{{/if}}
</div>