Fix #3351: Mod+: Treat deleted comments as below score threshold.

Comments have three states: visible, hidden, and invisible. Visible
comments are always shown. Hidden comments are not shown until the user
clicks 'Show all comments'. Invisible comments are never shown to the
user. Deleted comments are treated as hidden for moderators and
invisible for normal users. Thresholded comments are treated as hidden
for all users.
This commit is contained in:
evazion
2019-08-31 16:15:31 -05:00
parent 7e2eb7e5a7
commit be36968b6d
6 changed files with 99 additions and 27 deletions

View File

@@ -4,7 +4,7 @@
<% end %>
<div class="row notices">
<% if post.comments.any? { |c| !c.visible_by?(CurrentUser.user, show_deleted: true) } || (page == :comments && post.comments.size > 6) %>
<% if post.comments.hidden(CurrentUser.user).any? || (page == :comments && post.comments.size > 6) %>
<span class="info" id="threshold-comments-notice-for-<%= post.id %>">
<%= link_to "Show all comments", comments_path(post_id: post.id), id: "show-all-comments-link", remote: true %>
</span>