Show why a user can't be deleted on the page instead of as a tooltip

This commit is contained in:
Neil Lalonde
2013-12-20 11:36:43 -05:00
parent 6135d1d214
commit f91cb11666
3 changed files with 14 additions and 7 deletions

View File

@ -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;
}