Fix #4525: Show mod report notices next to reported content.

This commit is contained in:
evazion
2021-01-15 19:54:21 -06:00
parent 37792bd5dd
commit b4530183f4
20 changed files with 153 additions and 57 deletions

View File

@@ -1,8 +1,6 @@
<article class="forum-post message" id="forum_post_<%= forum_post.id %>"
data-forum-post-id="<%= forum_post.id %>"
<% if policy(moderation_reports).show? %>
data-is-reported="<%= moderation_reports.pluck(:model_id).include?(forum_post.id) %>"
<% end %>
data-is-reported="<%= has_moderation_reports? %>"
data-creator="<%= forum_post.creator.name %>">
<div class="author">
@@ -42,6 +40,9 @@
<% if policy(forum_post).reportable? %>
<li><%= link_to "Report", new_moderation_report_path(moderation_report: { model_type: "ForumPost", model_id: forum_post.id }), remote: true, title: "Report this forum post to the moderators" %></li>
<% end %>
<% if has_moderation_reports? %>
<li class="moderation-report-notice">This post has been reported! (<%= link_to pluralize(forum_post.moderation_reports.length, "report"), moderation_reports_path(search: { model_type: "ForumPost", model_id: forum_post.id }) %>)</li>
<% end %>
<% if forum_post.bulk_update_request.present? %>
<ul class="votes" id="forum-post-votes-for-<%= forum_post.id %>">
<%= render "forum_post_votes/list", votes: forum_post.votes, forum_post: forum_post %>

View File

@@ -1,6 +1,6 @@
article.forum-post {
&[data-is-reported="true"] {
border: var(--moderation-report-border);
background-color: var(--moderation-report-background-color);
}
a.voted {
@@ -30,4 +30,9 @@ article.forum-post {
}
}
}
.moderation-report-notice {
font-weight: bold;
color: var(--moderation-report-text-color);
}
}