2014-08-04 22:36:45 +04:00
|
|
|
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',
|
2014-08-06 15:34:08 +04:00
|
|
|
buttonClass: 'btn btn-red'
|
2014-08-04 22:36:45 +04:00
|
|
|
},
|
|
|
|
reject: {
|
|
|
|
text: 'Cancel',
|
2014-08-06 15:34:08 +04:00
|
|
|
buttonClass: 'btn btn-default btn-minor'
|
2014-08-04 22:36:45 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default DeleteUserController;
|