From e1227457f197f856764bdb27c61d527180f98862 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 7 Nov 2022 15:42:58 +0100 Subject: [PATCH] Fix links to the Web UI in notifications (#19981) Most of the old routes are broken because of the /web removal. --- app/views/authorize_interactions/_post_follow_actions.html.haml | 2 +- app/views/notification_mailer/_status.html.haml | 2 +- app/views/notification_mailer/_status.text.erb | 2 +- app/views/notification_mailer/favourite.html.haml | 2 +- app/views/notification_mailer/follow.html.haml | 2 +- app/views/notification_mailer/follow.text.erb | 2 +- app/views/notification_mailer/mention.html.haml | 2 +- app/views/notification_mailer/reblog.html.haml | 2 +- app/views/statuses/_detailed_status.html.haml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/authorize_interactions/_post_follow_actions.html.haml b/app/views/authorize_interactions/_post_follow_actions.html.haml index dd71160e2d7..e300979646b 100644 --- a/app/views/authorize_interactions/_post_follow_actions.html.haml +++ b/app/views/authorize_interactions/_post_follow_actions.html.haml @@ -1,4 +1,4 @@ .post-follow-actions - %div= link_to t('authorize_follow.post_follow.web'), web_url("accounts/#{@resource.id}"), class: 'button button--block' + %div= link_to t('authorize_follow.post_follow.web'), web_url("@#{@resource.pretty_acct}"), class: 'button button--block' %div= link_to t('authorize_follow.post_follow.return'), ActivityPub::TagManager.instance.url_for(@resource), class: 'button button--block' %div= t('authorize_follow.post_follow.close') diff --git a/app/views/notification_mailer/_status.html.haml b/app/views/notification_mailer/_status.html.haml index 444b06fe693..e7cd5ba3ebf 100644 --- a/app/views/notification_mailer/_status.html.haml +++ b/app/views/notification_mailer/_status.html.haml @@ -42,4 +42,4 @@ = link_to a.remote_url, a.remote_url %p.status-footer - = link_to l(status.created_at), web_url("statuses/#{status.id}") + = link_to l(status.created_at), web_url("@#{status.account.pretty_acct}/#{status.id}") diff --git a/app/views/notification_mailer/_status.text.erb b/app/views/notification_mailer/_status.text.erb index 1dc8de739c7..e03e8346c16 100644 --- a/app/views/notification_mailer/_status.text.erb +++ b/app/views/notification_mailer/_status.text.erb @@ -5,4 +5,4 @@ <% end %> > <%= raw word_wrap(extract_status_plain_text(status), break_sequence: "\n> ") %> -<%= raw t('application_mailer.view')%> <%= web_url("statuses/#{status.id}") %> +<%= raw t('application_mailer.view')%> <%= web_url("@#{status.account.pretty_acct}/#{status.id}") %> diff --git a/app/views/notification_mailer/favourite.html.haml b/app/views/notification_mailer/favourite.html.haml index ebc5c29c73a..5d9be3f57f2 100644 --- a/app/views/notification_mailer/favourite.html.haml +++ b/app/views/notification_mailer/favourite.html.haml @@ -41,5 +41,5 @@ %tbody %tr %td.button-primary - = link_to web_url("statuses/#{@status.id}") do + = link_to web_url("@#{@status.account.pretty_acct}/#{@status.id}") do %span= t 'application_mailer.view_status' diff --git a/app/views/notification_mailer/follow.html.haml b/app/views/notification_mailer/follow.html.haml index a59ef8835a6..f250cbbd2ae 100644 --- a/app/views/notification_mailer/follow.html.haml +++ b/app/views/notification_mailer/follow.html.haml @@ -39,5 +39,5 @@ %tbody %tr %td.button-primary - = link_to web_url("accounts/#{@account.id}") do + = link_to web_url("@#{@account.pretty_acct}") do %span= t 'application_mailer.view_profile' diff --git a/app/views/notification_mailer/follow.text.erb b/app/views/notification_mailer/follow.text.erb index 016a0a4cfb2..e498df093c9 100644 --- a/app/views/notification_mailer/follow.text.erb +++ b/app/views/notification_mailer/follow.text.erb @@ -2,4 +2,4 @@ <%= raw t('notification_mailer.follow.body', name: @account.pretty_acct) %> -<%= raw t('application_mailer.view')%> <%= web_url("accounts/#{@account.id}") %> +<%= raw t('application_mailer.view')%> <%= web_url("@#{@account.pretty_acct}") %> diff --git a/app/views/notification_mailer/mention.html.haml b/app/views/notification_mailer/mention.html.haml index cfb7465c142..4ae9bb7b0bd 100644 --- a/app/views/notification_mailer/mention.html.haml +++ b/app/views/notification_mailer/mention.html.haml @@ -41,5 +41,5 @@ %tbody %tr %td.button-primary - = link_to web_url("statuses/#{@status.id}") do + = link_to web_url("@#{@status.account.pretty_acct}/#{@status.id}") do %span= t 'notification_mailer.mention.action' diff --git a/app/views/notification_mailer/reblog.html.haml b/app/views/notification_mailer/reblog.html.haml index c528536ec80..f805c79f0d1 100644 --- a/app/views/notification_mailer/reblog.html.haml +++ b/app/views/notification_mailer/reblog.html.haml @@ -41,5 +41,5 @@ %tbody %tr %td.button-primary - = link_to web_url("statuses/#{@status.id}") do + = link_to web_url("@#{@status.account.pretty_acct}/#{@status.id}") do %span= t 'application_mailer.view_status' diff --git a/app/views/statuses/_detailed_status.html.haml b/app/views/statuses/_detailed_status.html.haml index 37001b0221c..619406d8976 100644 --- a/app/views/statuses/_detailed_status.html.haml +++ b/app/views/statuses/_detailed_status.html.haml @@ -77,4 +77,4 @@ - if user_signed_in? ยท - = link_to t('statuses.open_in_web'), web_url("statuses/#{status.id}"), class: 'detailed-status__application', target: '_blank' + = link_to t('statuses.open_in_web'), web_url("@#{status.account.pretty_acct}/#{status.id}"), class: 'detailed-status__application', target: '_blank'