From d87a4adf963960ff017ccb90e793aaed1b3d64d8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 27 Feb 2024 23:44:37 +0100 Subject: [PATCH] Add links to user actions to filter reports by/from users --- app/views/user/_actions.html.haml | 8 +++++++- config/locales/views.en.yml | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/views/user/_actions.html.haml b/app/views/user/_actions.html.haml index a70f1935..c30a482c 100644 --- a/app/views/user/_actions.html.haml +++ b/app/views/user/_actions.html.haml @@ -32,9 +32,15 @@ %i.fa.fa-exclamation-triangle.fa-fw = t("voc.report") - if current_user.mod? + %a.dropdown-item{ href: moderation_reports_path(user: user.screen_name) } + %i.far.fa-flag.fa-fw + = t(".reports_from", user: user.screen_name) + %a.dropdown-item{ href: moderation_reports_path(target_user: user.screen_name) } + %i.fas.fa-flag.fa-fw + = t(".reports_of", user: user.screen_name) %a.dropdown-item{ href: '#', data: { bs_target: '#modal-privileges', bs_toggle: :modal } } %i.fa.fa-wrench.fa-fw - = raw t(".privilege", user: user.screen_name) + = t(".privilege", user: user.screen_name) - unless user.has_cached_role?(:administrator) %a.dropdown-item{ href: '#', data: { bs_target: '#modal-ban', bs_toggle: :modal } } %i.fa.fa-ban.fa-fw diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 94cdab2e..e5580a21 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -703,6 +703,8 @@ en: ban: "Ban Control" title: "Actions" list: "Manage list memberships" + reports_from: "Reports from %{user}" + reports_of: "Reports of %{user}" profile: badge: admin: "Admin"