diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-09-26 11:06:59 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-09-26 11:39:44 +0200 |
commit | 3912d142b48f256e512ff39e440f6c2d2a1d761a (patch) | |
tree | 10ea7a1ed00bffe2d7865698208c90a23694f491 | |
parent | 88fa8e710adf103dee289b2a9cc691a410f97c21 (diff) |
Add confirmation dialog when clicking remote URLs in moderation action logfixes/audit-log-external-confirmation
-rw-r--r-- | app/helpers/admin/action_logs_helper.rb | 8 | ||||
-rw-r--r-- | config/locales/en.yml | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/app/helpers/admin/action_logs_helper.rb b/app/helpers/admin/action_logs_helper.rb index 4018ef6b1c5..37ab5d94e29 100644 --- a/app/helpers/admin/action_logs_helper.rb +++ b/app/helpers/admin/action_logs_helper.rb @@ -16,9 +16,13 @@ module Admin::ActionLogsHelper when 'Report' link_to "##{log.human_identifier.presence || log.target_id}", admin_report_path(log.target_id) when 'DomainBlock', 'DomainAllow', 'EmailDomainBlock', 'UnavailableDomain' - link_to log.human_identifier, "https://#{log.human_identifier.presence}" + link_to log.human_identifier, "https://#{log.human_identifier.presence}", data: { confirm: t('admin.action_logs.external_link', url: "https//#{log.human_identifier.presence}") } when 'Status' - link_to log.human_identifier, log.permalink + if log.permalink.blank? || TagManager.instance.local_url?(log.permalink) + link_to log.human_identifier, log.permalink + else + link_to log.human_identifier, log.permalink, data: { confirm: t('admin.action_logs.external_link', url: log.permalink) } + end when 'AccountWarning' link_to log.human_identifier, disputes_strike_path(log.target_id) when 'Announcement' diff --git a/config/locales/en.yml b/config/locales/en.yml index 71b8f27aacb..205ec297205 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -289,6 +289,7 @@ en: update_user_role_html: "%{name} changed %{target} role" deleted_account: deleted account empty: No logs found. + external_link: You are going to visit the external link %{url}. Proceed? filter_by_action: Filter by action filter_by_user: Filter by user title: Audit log |