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!
|
x.undo!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.can_revert?(user)
|
||||||
|
user.post_update_count <= THRESHOLD
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
<th>Post Changes</th>
|
<th>Post Changes</th>
|
||||||
<td>
|
<td>
|
||||||
<%= presenter.post_version_count(self) %>
|
<%= 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) %>]
|
[<%= link_to "revert all", new_user_revert_path(user_id: user.id) %>]
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user