mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Show why a user can't be deleted on the page instead of as a tooltip
This commit is contained in:
parent
6135d1d214
commit
f91cb11666
3 changed files with 14 additions and 7 deletions
|
@ -238,9 +238,13 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
return (!this.get('can_be_deleted') || this.get('post_count') > 0);
|
||||
}.property('post_count'),
|
||||
|
||||
deleteButtonTitle: function() {
|
||||
deleteExplanation: function() {
|
||||
if (this.get('deleteForbidden')) {
|
||||
return I18n.t('admin.user.delete_forbidden', {count: Discourse.SiteSettings.delete_user_max_age});
|
||||
if (this.get('staff')) {
|
||||
return I18n.t('admin.user.delete_forbidden_because_staff');
|
||||
} else {
|
||||
return I18n.t('admin.user.delete_forbidden', {count: Discourse.SiteSettings.delete_user_max_age});
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -313,9 +313,13 @@
|
|||
|
||||
<section>
|
||||
<hr/>
|
||||
<button class="btn btn-danger pull-right" {{action destroy target="content"}} {{bindAttr disabled="deleteForbidden"}} {{bindAttr title="deleteButtonTitle"}}>
|
||||
<button {{bindAttr class=":btn :btn-danger :pull-right deleteForbidden:hidden"}} {{action destroy target="content"}} {{bindAttr disabled="deleteForbidden"}} {{bindAttr}}>
|
||||
<i class="fa fa-exclamation-triangle"></i>
|
||||
{{i18n admin.user.delete}}
|
||||
</button>
|
||||
{{#if deleteExplanation}}
|
||||
<div class="clearfix"></div>
|
||||
<div class="pull-right"><i class="fa fa-exclamation-triangle"></i> {{deleteExplanation}}</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
<div class="clearfix"></div>
|
||||
|
|
|
@ -1410,12 +1410,11 @@ en:
|
|||
flags_received_count: Flags Received
|
||||
approve: 'Approve'
|
||||
approved_by: "approved by"
|
||||
approve_success: "User approved and email sent with activation
|
||||
instructions."
|
||||
approve_bulk_success: "Success! All selected users have been approved
|
||||
and notified."
|
||||
approve_success: "User approved and email sent with activation instructions."
|
||||
approve_bulk_success: "Success! All selected users have been approved and notified."
|
||||
time_read: "Read Time"
|
||||
delete: "Delete User"
|
||||
delete_forbidden_because_staff: "Admins and moderators can't be deleted."
|
||||
delete_forbidden:
|
||||
one: "Users can't be deleted if they registered more than %{count} day ago, or if they have posts. Delete all posts before trying to delete a user."
|
||||
other: "Users can't be deleted if they registered more than %{count} days ago, or if they have posts. Delete all posts before trying to delete a user."
|
||||
|
|
Loading…
Reference in a new issue