Fixes #2694: hide "revert all" when user has over 1000 post changes
This commit is contained in:
@@ -25,4 +25,8 @@ class UserRevert
|
||||
x.undo!
|
||||
end
|
||||
end
|
||||
|
||||
def self.can_revert?(user)
|
||||
user.post_update_count <= THRESHOLD
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<th>Post Changes</th>
|
||||
<td>
|
||||
<%= presenter.post_version_count(self) %>
|
||||
<% if CurrentUser.is_janitor? %>
|
||||
<% if CurrentUser.is_moderator? && UserRevert.can_revert?(user)%>
|
||||
[<%= link_to "revert all", new_user_revert_path(user_id: user.id) %>]
|
||||
<% end %>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user