Skip to content

Commit

Permalink
Merge pull request #3257 from manyfold3d/show-reporter-address-when-anon
Browse files Browse the repository at this point in the history
Add ability to resolve or ignore reports in moderation UI
  • Loading branch information
Floppy authored Nov 29, 2024
2 parents 2bed868 + 17bce1e commit 23b2f3d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
14 changes: 9 additions & 5 deletions app/controllers/settings/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ def show
end

def update
# if @domain_block.valid?
# redirect_to settings_domain_blocks_path, notice: t(".success")
# else
# render "new", layout: "settings", status: :unprocessable_entity
# end
if params[:resolve]
@report.resolve!
redirect_to settings_reports_path, notice: t(".resolved")
elsif params[:ignore]
@report.ignore!
redirect_to settings_reports_path, notice: t(".ignored")
else
redirect_to settings_report_path(@report)
end
end

private
Expand Down
30 changes: 22 additions & 8 deletions app/views/settings/reports/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
<h3><%= t(".title") %></h3>
<h3><%= Federails::Moderation::Report.model_name.human %> #<%= @report.id %></h3>

<p>
<%= Federails::Moderation::Report.human_attribute_name(:federails_actor) %>:
<%= @report.reporter_address %>
</p>
<ul>
<li>
<%= Federails::Moderation::Report.human_attribute_name(:created_at) %>:
<%= @report.created_at %>
</li>
<li>
<%= Federails::Moderation::Report.human_attribute_name(:federails_actor) %>:
<%= @report.reporter_address %>
</li>
</ul>

<blockquote>
<%= @report.content %>
</blockquote>
<% if @report.content.present? %>
<h4><%= Federails::Moderation::Report.human_attribute_name(:content) %>:</h4>
<div class="alert alert-warning">
<%= @report.content %>
</div>
<% end %>

<div class="mt-3">
<%= link_to t(".resolve"), settings_report_path(@report, resolve: true), method: :patch, class: "btn btn-primary" %>
<%= link_to t(".ignore"), settings_report_path(@report, ignore: true), method: :patch, class: "btn btn-danger" %>
</div>
17 changes: 16 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ en:
created_at: Created at
domain: Domain
federails/moderation/report:
created_at: Reported at
content: Comment
created_at: Received at
federails_actor: Reported by
object: Object
library:
Expand Down Expand Up @@ -132,6 +133,20 @@ en:
other: Creators
two: Creators
zero: Creators
federails/moderation/domain_block:
few: Domain Blocks
many: Domain Blocks
one: Domain Block
other: Domain Blocks
two: Domain Blocks
zero: Domain Blocks
federails/moderation/report:
few: Reports
many: Reports
one: Report
other: Reports
two: Reports
zero: Reports
library:
few: Libraries
many: Libraries
Expand Down
6 changes: 5 additions & 1 deletion config/locales/settings/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ en:
description: Content reported by local or Fediverse users shows up here for moderation.
title: Reports
show:
title: View report
ignore: Ignore
resolve: Mark as resolved
update:
ignored: The report has been ignored.
resolved: The report has been marked as resolved.
tag_settings:
auto_tag_new:
label: Automatically tag new models with
Expand Down

0 comments on commit 23b2f3d

Please sign in to comment.