Fix #4669: Track moderation report status.
* Add ability to mark moderation reports as 'handled' or 'rejected'. * Automatically mark reports as handled when the comment or forum post is deleted. * Send a dmail to the reporter when their report is handled. * Don't show the report notice on comments or forum posts when all reports against it have been handled or rejected. * Add a fix script to mark all existing reports for deleted comments, forum posts, or dmails as handled.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<%= f.input :reason_matches, label: "Reason", input_html: { value: params[:search][:reason_matches] } %>
|
||||
<%= f.input :model_id, label: "ID", input_html: { value: params[:search][:model_id] } %>
|
||||
<%= f.input :model_type, label: "Type", collection: ModerationReport.model_types, include_blank: true, selected: params[:search][:model_type] %>
|
||||
<%= f.input :status, label: "Status", collection: ModerationReport.statuses.keys, include_blank: true, selected: params[:search][:status] %>
|
||||
<%= f.submit "Search" %>
|
||||
<% end %>
|
||||
|
||||
@@ -26,6 +27,10 @@
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<% t.column "Status" do |report| %>
|
||||
<%= link_to report.status.capitalize, moderation_reports_path(search: { status: report.status }) %>
|
||||
<% end %>
|
||||
|
||||
<% t.column "Reported user" do |report| %>
|
||||
<%= link_to_user report.reported_user %>
|
||||
<% end %>
|
||||
@@ -35,6 +40,18 @@
|
||||
<%= link_to "»", moderation_reports_path(search: { creator_name: report.creator.name }) %>
|
||||
<div><%= time_ago_in_words_tagged(report.created_at) %></div>
|
||||
<% end %>
|
||||
|
||||
<% t.column column: "control" do |report| %>
|
||||
<%= render PopupMenuComponent.new do |menu| %>
|
||||
<% menu.item do %>
|
||||
<%= link_to "Mark as handled", moderation_report_path(report.id), method: :put, remote: true, "data-params": "moderation_report[status]=handled" %>
|
||||
<% end %>
|
||||
|
||||
<% menu.item do %>
|
||||
<%= link_to "Reject", moderation_report_path(report.id), method: :put, remote: true, "data-params": "moderation_report[status]=rejected" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= numbered_paginator(@moderation_reports) %>
|
||||
|
||||
1
app/views/moderation_reports/update.js
Normal file
1
app/views/moderation_reports/update.js
Normal file
@@ -0,0 +1 @@
|
||||
location.reload();
|
||||
Reference in New Issue
Block a user