summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-09-06 17:25:39 +0200
committerGitHub <noreply@github.com>2023-09-06 17:25:39 +0200
commit475783d567bb469d2da8aeb4b25fc9ebdb67b995 (patch)
tree7054aeab641f58acffe471b7f1505a68bc01bb55
parent9c1ef8302abe52f6b41eeafadc1bc30dfa079e18 (diff)
Add timezone to datetimes in e-mails (#26822)
-rw-r--r--app/views/admin_mailer/new_appeal.text.erb2
-rw-r--r--app/views/notification_mailer/_status.html.haml2
-rw-r--r--app/views/user_mailer/appeal_approved.html.haml2
-rw-r--r--app/views/user_mailer/appeal_approved.text.erb2
-rw-r--r--app/views/user_mailer/appeal_rejected.html.haml2
-rw-r--r--app/views/user_mailer/appeal_rejected.text.erb2
-rw-r--r--app/views/user_mailer/suspicious_sign_in.html.haml2
-rw-r--r--app/views/user_mailer/suspicious_sign_in.text.erb2
-rw-r--r--config/locales/en.yml1
9 files changed, 9 insertions, 8 deletions
diff --git a/app/views/admin_mailer/new_appeal.text.erb b/app/views/admin_mailer/new_appeal.text.erb
index db4529eb7d6..8b85823608d 100644
--- a/app/views/admin_mailer/new_appeal.text.erb
+++ b/app/views/admin_mailer/new_appeal.text.erb
@@ -1,6 +1,6 @@
<%= raw t('application_mailer.salutation', name: display_name(@me)) %>
-<%= raw t('admin_mailer.new_appeal.body', target: @appeal.account.username, action_taken_by: @appeal.strike.account.username, date: l(@appeal.strike.created_at), type: t(@appeal.strike.action, scope: 'admin_mailer.new_appeal.actions')) %>
+<%= raw t('admin_mailer.new_appeal.body', target: @appeal.account.username, action_taken_by: @appeal.strike.account.username, date: l(@appeal.strike.created_at, format: :with_time_zone), type: t(@appeal.strike.action, scope: 'admin_mailer.new_appeal.actions')) %>
> <%= raw word_wrap(@appeal.text, break_sequence: "\n> ") %>
diff --git a/app/views/notification_mailer/_status.html.haml b/app/views/notification_mailer/_status.html.haml
index c85253ac084..7f614e99cb7 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.in_time_zone(time_zone.presence)), web_url("@#{status.account.pretty_acct}/#{status.id}")
+ = link_to l(status.created_at.in_time_zone(time_zone.presence), format: :with_time_zone), web_url("@#{status.account.pretty_acct}/#{status.id}")
diff --git a/app/views/user_mailer/appeal_approved.html.haml b/app/views/user_mailer/appeal_approved.html.haml
index 1bbd8ae75ad..3a2de822f42 100644
--- a/app/views/user_mailer/appeal_approved.html.haml
+++ b/app/views/user_mailer/appeal_approved.html.haml
@@ -36,7 +36,7 @@
%tbody
%tr
%td.column-cell.text-center
- %p= t 'user_mailer.appeal_approved.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence)), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence))
+ %p= t 'user_mailer.appeal_approved.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone)
%table.email-table{ cellspacing: 0, cellpadding: 0 }
%tbody
diff --git a/app/views/user_mailer/appeal_approved.text.erb b/app/views/user_mailer/appeal_approved.text.erb
index 9a4bd81c3dc..48fc4b4f750 100644
--- a/app/views/user_mailer/appeal_approved.text.erb
+++ b/app/views/user_mailer/appeal_approved.text.erb
@@ -2,6 +2,6 @@
===
-<%= t 'user_mailer.appeal_approved.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence)), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence)) %>
+<%= t 'user_mailer.appeal_approved.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone) %>
=> <%= root_url %>
diff --git a/app/views/user_mailer/appeal_rejected.html.haml b/app/views/user_mailer/appeal_rejected.html.haml
index 22e3f62df6b..ccbd1c4bad2 100644
--- a/app/views/user_mailer/appeal_rejected.html.haml
+++ b/app/views/user_mailer/appeal_rejected.html.haml
@@ -36,7 +36,7 @@
%tbody
%tr
%td.column-cell.text-center
- %p= t 'user_mailer.appeal_rejected.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence)), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence))
+ %p= t 'user_mailer.appeal_rejected.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone)
%table.email-table{ cellspacing: 0, cellpadding: 0 }
%tbody
diff --git a/app/views/user_mailer/appeal_rejected.text.erb b/app/views/user_mailer/appeal_rejected.text.erb
index 3b063e19df3..8b8408e91a8 100644
--- a/app/views/user_mailer/appeal_rejected.text.erb
+++ b/app/views/user_mailer/appeal_rejected.text.erb
@@ -2,6 +2,6 @@
===
-<%= t 'user_mailer.appeal_rejected.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence)), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence)) %>
+<%= t 'user_mailer.appeal_rejected.explanation', appeal_date: l(@appeal.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone), strike_date: l(@appeal.strike.created_at.in_time_zone(@resource.time_zone.presence), format: :with_time_zone) %>
=> <%= root_url %>
diff --git a/app/views/user_mailer/suspicious_sign_in.html.haml b/app/views/user_mailer/suspicious_sign_in.html.haml
index 3dbec61ffe9..75bcb2d54b8 100644
--- a/app/views/user_mailer/suspicious_sign_in.html.haml
+++ b/app/views/user_mailer/suspicious_sign_in.html.haml
@@ -47,7 +47,7 @@
%strong= "#{t('sessions.browser')}:"
%span{ title: @user_agent }= t 'sessions.description', browser: t("sessions.browsers.#{@detection.id}", default: @detection.id.to_s), platform: t("sessions.platforms.#{@detection.platform.id}", default: @detection.platform.id.to_s)
%br/
- = l(@timestamp.in_time_zone(@resource.time_zone.presence))
+ = l(@timestamp.in_time_zone(@resource.time_zone.presence), format: :with_time_zone)
%table.email-table{ cellspacing: 0, cellpadding: 0 }
%tbody
diff --git a/app/views/user_mailer/suspicious_sign_in.text.erb b/app/views/user_mailer/suspicious_sign_in.text.erb
index ed01e54fa2d..0aa4d227d10 100644
--- a/app/views/user_mailer/suspicious_sign_in.text.erb
+++ b/app/views/user_mailer/suspicious_sign_in.text.erb
@@ -8,7 +8,7 @@
<%= t('sessions.ip') %>: <%= @remote_ip %>
<%= t('sessions.browser') %>: <%= t('sessions.description', browser: t("sessions.browsers.#{@detection.id}", default: "#{@detection.id}"), platform: t("sessions.platforms.#{@detection.platform.id}", default: "#{@detection.platform.id}")) %>
-<%= l(@timestamp.in_time_zone(@resource.time_zone.presence)) %>
+<%= l(@timestamp.in_time_zone(@resource.time_zone.presence), format: :with_time_zone) %>
<%= t 'user_mailer.suspicious_sign_in.further_actions_html', action: t('user_mailer.suspicious_sign_in.change_password') %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 71e5fb843ec..71b8f27aacb 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1739,6 +1739,7 @@ en:
default: "%b %d, %Y, %H:%M"
month: "%b %Y"
time: "%H:%M"
+ with_time_zone: "%b %d, %Y, %H:%M %Z"
translation:
errors:
quota_exceeded: The server-wide usage quota for the translation service has been exceeded.