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:
@@ -10,12 +10,12 @@
|
||||
<% end %>
|
||||
|
||||
<% @posts.select(&:visible?).each do |post| %>
|
||||
<% if post.comments.any? { |c| c.visible_by?(CurrentUser.user, show_thresholded: true) } %>
|
||||
<% if post.comments.visible(CurrentUser.user).any? || post.comments.hidden(CurrentUser.user).any? %>
|
||||
<%= content_tag(:div, { id: "post_#{post.id}", class: ["post", *PostPresenter.preview_class(post)].join(" ") }.merge(PostPresenter.data_attributes(post))) do %>
|
||||
<div class="preview">
|
||||
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
|
||||
</div>
|
||||
<%= render "comments/partials/index/list", post: post, comments: post.comments.select { |c| c.visible_by?(CurrentUser.user) }.last(6), page: :comments %>
|
||||
<%= render "comments/partials/index/list", post: post, comments: post.comments.visible(CurrentUser.user).last(6), page: :comments %>
|
||||
<div class="clearfix"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user