mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
6645f7c65a
closes #3529 - Created ‘delete user’ modal (similar to the ‘delete post’ modal) and controller - Modal will be opened if ‘Delete User’ is selected in the user setting cog menu
33 lines
922 B
JavaScript
33 lines
922 B
JavaScript
var DeleteUserController = Ember.Controller.extend({
|
|
actions: {
|
|
confirmAccept: function () {
|
|
var self = this,
|
|
user = this.get('model');
|
|
|
|
user.destroyRecord().then(function () {
|
|
self.store.unloadAll('post');
|
|
self.transitionToRoute('settings.users');
|
|
self.notifications.showSuccess('The user has been deleted.', { delayed: true });
|
|
}, function () {
|
|
self.notifications.showError('The user could not be deleted. Please try again.');
|
|
});
|
|
|
|
},
|
|
|
|
confirmReject: function () {
|
|
return false;
|
|
}
|
|
},
|
|
confirm: {
|
|
accept: {
|
|
text: 'Delete User',
|
|
buttonClass: 'button-delete'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'button'
|
|
}
|
|
}
|
|
});
|
|
|
|
export default DeleteUserController;
|