Create the ability to send reports to moderators
- Limited to Builders+ -- Moderator+ can also use as they may be too busy ATM - Only on users, comments, and forum posts - Multiple reports can be generated per instance - Primarily posts to a moderator-only topic for viewability - Secondarily has a table for searchability -- Viewable only by moderators
This commit is contained in:
14
app/views/moderation_reports/_new.html.erb
Normal file
14
app/views/moderation_reports/_new.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
<div class="report-dialog-body">
|
||||
<div class="prose">
|
||||
<%= format_text(WikiPage.titled(Danbooru.config.report_notice_wiki_page).first.try(&:body)) %>
|
||||
</div>
|
||||
|
||||
<%# XXX dtext_field expects there to be a `moderation_report` instance variable. %>
|
||||
<% @moderation_report = moderation_report %>
|
||||
<%= edit_form_for(@moderation_report, format: :js, remote: true) do |f| %>
|
||||
<%= f.hidden_field :model_type %>
|
||||
<%= f.hidden_field :model_id %>
|
||||
<%= dtext_field "moderation_report", "reason", preview_id: "dtext-preview-for-moderation-report", type: "string" %>
|
||||
<%= dtext_preview_button "moderation_report", "reason", preview_id: "dtext-preview-for-moderation-report" %>
|
||||
<% end %>
|
||||
</div>
|
||||
1
app/views/moderation_reports/create.js.erb
Normal file
1
app/views/moderation_reports/create.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
Danbooru.notice("Report submitted.");
|
||||
27
app/views/moderation_reports/index.html.erb
Normal file
27
app/views/moderation_reports/index.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<div id="c-moderation-reports">
|
||||
<div id="a-index">
|
||||
<h1>Moderation reports</h1>
|
||||
<%= table_for @moderation_reports, width: "100%" do |t| %>
|
||||
<% t.column "Reported", width: "10%" do |report| %>
|
||||
<% if report.model_type == "User" %>
|
||||
<%= link_to_user report.model %>
|
||||
<% elsif report.model_type == "Comment" %>
|
||||
<%= link_to "comment ##{report.model_id}", comment_path(report.model_id) %>
|
||||
<% elsif report.model_type == "ForumPost" %>
|
||||
<%= link_to "forum ##{report.model_id}", forum_post_path(report.model_id) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% t.column "Reason" do |report| %>
|
||||
<span class="prose">
|
||||
<%= format_text report.reason, inline: true %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% t.column "Creator", width: "10%" do |report| %>
|
||||
<%= compact_time report.created_at %>
|
||||
<br> by <%= link_to_user report.creator %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= numbered_paginator(@moderation_reports) %>
|
||||
</div>
|
||||
</div>
|
||||
1
app/views/moderation_reports/new.js.erb
Normal file
1
app/views/moderation_reports/new.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
Danbooru.Utility.dialog("Send report", "<%= j render "moderation_reports/new", moderation_report: @moderation_report %>");
|
||||
Reference in New Issue
Block a user