diff --git a/app/controllers/settings/reports_controller.rb b/app/controllers/settings/reports_controller.rb index 2c40926f5..197978de0 100644 --- a/app/controllers/settings/reports_controller.rb +++ b/app/controllers/settings/reports_controller.rb @@ -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 diff --git a/app/views/settings/reports/show.html.erb b/app/views/settings/reports/show.html.erb index 5cf995a8d..2edcf669b 100644 --- a/app/views/settings/reports/show.html.erb +++ b/app/views/settings/reports/show.html.erb @@ -1,10 +1,24 @@ -

<%= t(".title") %>

+

<%= Federails::Moderation::Report.model_name.human %> #<%= @report.id %>

-

- <%= Federails::Moderation::Report.human_attribute_name(:federails_actor) %>: - <%= @report.reporter_address %> -

+ -
- <%= @report.content %> -
+<% if @report.content.present? %> +

<%= Federails::Moderation::Report.human_attribute_name(:content) %>:

+
+ <%= @report.content %> +
+<% end %> + +
+ <%= 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" %> +
diff --git a/config/locales/en.yml b/config/locales/en.yml index ba0d859ca..69bf63d27 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: @@ -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 diff --git a/config/locales/settings/en.yml b/config/locales/settings/en.yml index dd072492b..7b0baaeea 100644 --- a/config/locales/settings/en.yml +++ b/config/locales/settings/en.yml @@ -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