diff --git a/app/models/moderation_report.rb b/app/models/moderation_report.rb index ff975f2cc..17083458b 100644 --- a/app/models/moderation_report.rb +++ b/app/models/moderation_report.rb @@ -77,7 +77,7 @@ class ModerationReport < ApplicationRecord end end - def self.visible(user = CurrentUser.user) + def self.visible(user) user.is_moderator? ? all : none end diff --git a/app/views/comments/index_for_post.js.erb b/app/views/comments/index_for_post.js.erb index bc48cb554..3381caf97 100644 --- a/app/views/comments/index_for_post.js.erb +++ b/app/views/comments/index_for_post.js.erb @@ -1,5 +1,5 @@ $("#threshold-comments-notice-for-<%= @post.id %>").hide(); var current_comment_section = $("div.comments-for-post[data-post-id=<%= @post.id %>] div.list-of-comments"); -current_comment_section.html("<%= j(render(partial: 'comments/partials/show/comment', collection: @comments, locals: { context: :index_for_post, dtext_data: DText.preprocess(@comments.map(&:body)), moderation_reports: @post.moderation_reports.visible.recent })) %>"); +current_comment_section.html("<%= j(render(partial: 'comments/partials/show/comment', collection: @comments, locals: { context: :index_for_post, dtext_data: DText.preprocess(@comments.map(&:body)), moderation_reports: @post.moderation_reports.visible(CurrentUser.user).recent })) %>"); $(window).trigger("danbooru:index_for_post", [<%= @post.id %>]); diff --git a/app/views/comments/partials/index/_list.html.erb b/app/views/comments/partials/index/_list.html.erb index a098389a8..4b0d9935c 100644 --- a/app/views/comments/partials/index/_list.html.erb +++ b/app/views/comments/partials/index/_list.html.erb @@ -3,10 +3,10 @@ <%= render "comments/partials/index/header", :post => post %> <% end %> - <% if post.moderation_reports.visible.recent.present? %> + <% if post.moderation_reports.visible(CurrentUser.user).recent.present? %>
<%= link_to "Post reply", new_forum_post_path(topic_id: @forum_topic.id), id: "new-response-link" %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 63fcc8ef3..ce75914bc 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -5,10 +5,10 @@