mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
Merge pull request #4619 from jaswilli/issue-4583
Change user deletion warning to be more explicit.
This commit is contained in:
commit
6c09c0b0d1
2 changed files with 29 additions and 4 deletions
|
@ -1,4 +1,24 @@
|
|||
var DeleteUserController = Ember.Controller.extend({
|
||||
var DeleteUserController = Ember.ObjectController.extend({
|
||||
userPostCount: Ember.computed('id', function () {
|
||||
var promise,
|
||||
query = {
|
||||
author: this.get('slug'),
|
||||
status: 'all'
|
||||
};
|
||||
|
||||
promise = this.store.find('post', query).then(function (results) {
|
||||
return results.meta.pagination.total;
|
||||
});
|
||||
|
||||
return Ember.Object.extend(Ember.PromiseProxyMixin, {
|
||||
count: Ember.computed.alias('content'),
|
||||
|
||||
inflection: Ember.computed('count', function () {
|
||||
return this.get('count') > 1 ? 'posts' : 'post';
|
||||
})
|
||||
}).create({promise: promise});
|
||||
}),
|
||||
|
||||
actions: {
|
||||
confirmAccept: function () {
|
||||
var self = this,
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
{{#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>
|
||||
{{#unless userPostCount.isPending}}
|
||||
{{#if userPostCount.count}}
|
||||
<strong>WARNING:</strong> <span class="red">This user is the author of {{userPostCount.count}} {{userPostCount.inflection}}.</span> All posts and user data will be deleted. There is no way to recover this.
|
||||
{{else}}
|
||||
<strong>WARNING:</strong> All user data will be deleted. There is no way to recover this.
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
||||
{{/gh-modal-dialog}}
|
||||
{{/gh-modal-dialog}}
|
||||
|
|
Loading…
Reference in a new issue