FIX: reason for not being able to delete a staff user's posts was wrong in admin

This commit is contained in:
Neil Lalonde 2015-03-06 14:11:48 -05:00
parent 85797ccef9
commit ddbe1c017b
2 changed files with 5 additions and 1 deletions

View File

@ -57,6 +57,9 @@ Discourse.AdminUser = Discourse.User.extend({
deleteAllPostsExplanation: function() {
if (!this.get('can_delete_all_posts')) {
if (this.get('deleteForbidden') && this.get('staff')) {
return I18n.t('admin.user.delete_posts_forbidden_because_staff');
}
if (this.get('post_count') > Discourse.SiteSettings.delete_all_posts_max) {
return I18n.t('admin.user.cant_delete_all_too_many_posts', {count: Discourse.SiteSettings.delete_all_posts_max});
} else {
@ -65,7 +68,7 @@ Discourse.AdminUser = Discourse.User.extend({
} else {
return null;
}
}.property('can_delete_all_posts'),
}.property('can_delete_all_posts', 'deleteForbidden'),
deleteAllPosts: function() {
var user = this;

View File

@ -2052,6 +2052,7 @@ en:
time_read: "Read Time"
delete: "Delete User"
delete_forbidden_because_staff: "Admins and moderators can't be deleted."
delete_posts_forbidden_because_staff: "Can't delete all posts of admins and moderators."
delete_forbidden:
one: "Users can't be deleted if they have posts. Delete all posts before trying to delete a user. (Posts older than %{count} day old can't be deleted.)"
other: "Users can't be deleted if they have posts. Delete all posts before trying to delete a user. (Posts older than %{count} days old can't be deleted.)"