mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 14:39:52 +03:00
Merge pull request #3588 from felixrieseberg/iss3529
Working delete user modal & button
This commit is contained in:
commit
aea25693e5
33
core/client/controllers/modals/delete-user.js
Normal file
33
core/client/controllers/modals/delete-user.js
Normal file
@ -0,0 +1,33 @@
|
||||
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;
|
7
core/client/templates/modals/delete-user.hbs
Normal file
7
core/client/templates/modals/delete-user.hbs
Normal file
@ -0,0 +1,7 @@
|
||||
{{#gh-modal-dialog action="closeModal" showClose=true type="action" style="wide,centered" animation="fade"
|
||||
title="Are you sure you want to delete this user?" confirm=confirm}}
|
||||
|
||||
<p>All posts and associated data will also be deleted. There is no way to recover this data.
|
||||
</p>
|
||||
|
||||
{{/gh-modal-dialog}}
|
@ -2,5 +2,5 @@
|
||||
<a href="javascript:void(0);" {{action "openModal" "transfer-owner" this}}>Make Owner</a>
|
||||
{{/if}}
|
||||
{{#if view.parentView.deleteUserActionIsVisible}}
|
||||
<a href="javascript:void(0);" class="delete">Delete User</a>
|
||||
<a href="javascript:void(0);" {{action "openModal" "delete-user" this}} class="delete">Delete User</a>
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user