summaryrefslogtreecommitdiff
path: root/app/views/notify
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/views/notify
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
downloadgitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/views/notify')
-rw-r--r--app/views/notify/access_token_revoked_email.html.haml7
-rw-r--r--app/views/notify/access_token_revoked_email.text.erb5
-rw-r--r--app/views/notify/project_was_exported_email.html.haml10
-rw-r--r--app/views/notify/project_was_moved_email.html.haml20
-rw-r--r--app/views/notify/project_was_not_exported_email.html.haml4
-rw-r--r--app/views/notify/repository_push_email.text.haml2
-rw-r--r--app/views/notify/request_review_merge_request_email.html.haml2
-rw-r--r--app/views/notify/send_unsubscribed_notification.html.haml2
-rw-r--r--app/views/notify/two_factor_otp_attempt_failed_email.html.haml51
-rw-r--r--app/views/notify/two_factor_otp_attempt_failed_email.text.haml7
-rw-r--r--app/views/notify/unknown_sign_in_email.html.haml2
-rw-r--r--app/views/notify/unknown_sign_in_email.text.haml2
12 files changed, 89 insertions, 25 deletions
diff --git a/app/views/notify/access_token_revoked_email.html.haml b/app/views/notify/access_token_revoked_email.html.haml
new file mode 100644
index 00000000000..4d9b9e14d14
--- /dev/null
+++ b/app/views/notify/access_token_revoked_email.html.haml
@@ -0,0 +1,7 @@
+%p
+ = _('Hi %{username}!') % { username: sanitize_name(@user.name) }
+%p
+ = html_escape(_('A personal access token, named %{code_start}%{token_name}%{code_end}, has been revoked.')) % { code_start: '<code>'.html_safe, token_name: @token_name, code_end: '</code>'.html_safe }
+%p
+ - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url }
+ = html_escape(_('You can check your tokens or create a new one in your %{pat_link_start}personal access tokens settings%{pat_link_end}.')) % { pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe }
diff --git a/app/views/notify/access_token_revoked_email.text.erb b/app/views/notify/access_token_revoked_email.text.erb
new file mode 100644
index 00000000000..17dd628d76c
--- /dev/null
+++ b/app/views/notify/access_token_revoked_email.text.erb
@@ -0,0 +1,5 @@
+<%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %>
+
+<%= _('A personal access token, named %{token_name}, has been revoked.') % { token_name: @token_name } %>
+
+<%= _('You can check your tokens or create a new one in your personal access tokens settings %{pat_link}.') % { pat_link: @target_url } %>
diff --git a/app/views/notify/project_was_exported_email.html.haml b/app/views/notify/project_was_exported_email.html.haml
index 71c62f6be4e..11d761414ff 100644
--- a/app/views/notify/project_was_exported_email.html.haml
+++ b/app/views/notify/project_was_exported_email.html.haml
@@ -1,8 +1,8 @@
%p
- Project #{@project.name} was exported successfully.
+ = s_('Notify|Project %{project_name} was exported successfully.') % {project_name: @project.name}
%p
- The project export can be downloaded from:
- = link_to download_export_project_url(@project), rel: 'nofollow', download: '' do
- = @project.full_name + " export"
+ - project_link_url = download_export_project_url(@project)
+ - project_link_start = '<a href="%{url}" target="_blank" rel="nofollow" download="">'.html_safe % { url: project_link_url }
+ = html_escape(s_('Notify|%{project_link_start}Download%{project_link_end} the project export.')) % {project_link_start: project_link_start, project_link_end: '</a>'.html_safe}
%p
- The download link will expire in 24 hours.
+ = s_('Notify|The download link will expire in 24 hours.')
diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml
index 1b6b1a81665..45bec221e08 100644
--- a/app/views/notify/project_was_moved_email.html.haml
+++ b/app/views/notify/project_was_moved_email.html.haml
@@ -1,15 +1,9 @@
+- repo_url_styles = "background: #f5f5f5; padding:10px; border:1px solid #ddd"
+- ssh_url_to_repo = content_tag(:p, "git remote set-url origin #{strip_tags(@project.ssh_url_to_repo)}", style: repo_url_styles)
+- http_url_to_repo = content_tag(:p, "git remote set-url origin #{strip_tags(@project.http_url_to_repo)}", style: repo_url_styles)
%p
- Project #{@old_path_with_namespace} was moved to another location
+ = s_('Notify|Project %{old_path_with_namespace} was moved to another location.') % { old_path_with_namespace: @old_path_with_namespace }
%p
- The project is now located under
- = link_to project_url(@project) do
- = @project.full_name
-%p
- To update the remote url in your local repository run (for ssh):
-%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" }
- git remote set-url origin #{@project.ssh_url_to_repo}
-%p
- or for http(s):
-%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" }
- git remote set-url origin #{@project.http_url_to_repo}
-%br
+ - project_full_name_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: project_url(@project) }
+ = html_escape(s_('Notify|The project is now located under %{project_full_name_link_start}%{project_full_name}%{link_end}.')) % { project_full_name_link_start: project_full_name_link_start, link_end: '</a>'.html_safe, project_full_name: @project.full_name }
+= html_escape(s_('Notify|%{p_start}To update the remote url in your local repository run (for ssh):%{p_end} %{ssh_url_to_repo} %{p_start}or for http(s):%{p_end} %{http_url_to_repo}')) % { p_start: '<p>'.html_safe, p_end: '</p>'.html_safe, ssh_url_to_repo: ssh_url_to_repo, http_url_to_repo: http_url_to_repo }
diff --git a/app/views/notify/project_was_not_exported_email.html.haml b/app/views/notify/project_was_not_exported_email.html.haml
index c888da29c17..dcd212099b5 100644
--- a/app/views/notify/project_was_not_exported_email.html.haml
+++ b/app/views/notify/project_was_not_exported_email.html.haml
@@ -1,7 +1,7 @@
%p
- Project #{@project.name} couldn't be exported.
+ = s_("Notify|Project %{project_name} couldn't be exported.") % {project_name: @project.name}
%p
- The errors we encountered were:
+ = s_('Notify|The errors we encountered were:')
%ul
- @errors.each do |error|
diff --git a/app/views/notify/repository_push_email.text.haml b/app/views/notify/repository_push_email.text.haml
index 895d8807e47..2ba0a2cf4ab 100644
--- a/app/views/notify/repository_push_email.text.haml
+++ b/app/views/notify/repository_push_email.text.haml
@@ -13,7 +13,7 @@
\- - - - -
\
\
- #{pluralize @message.diffs_count, "changed file"}:
+ #{pluralize @message.diffs_count, 'changed file'}:
\
- @message.diffs.each do |diff_file|
- if diff_file.deleted_file?
diff --git a/app/views/notify/request_review_merge_request_email.html.haml b/app/views/notify/request_review_merge_request_email.html.haml
index d1f72f6529a..a8c7df79ff3 100644
--- a/app/views/notify/request_review_merge_request_email.html.haml
+++ b/app/views/notify/request_review_merge_request_email.html.haml
@@ -1,2 +1,2 @@
%p
- #{sanitize_name(@updated_by.name)} requested a new review on #{merge_request_reference_link(@merge_request)}.
+ = html_escape(s_('Notify|%{name} requested a new review on %{mr_link}.')) % {name: sanitize_name(@updated_by.name), mr_link: merge_request_reference_link(@merge_request).html_safe}
diff --git a/app/views/notify/send_unsubscribed_notification.html.haml b/app/views/notify/send_unsubscribed_notification.html.haml
index 9f68feeaa31..ef1577dde97 100644
--- a/app/views/notify/send_unsubscribed_notification.html.haml
+++ b/app/views/notify/send_unsubscribed_notification.html.haml
@@ -1,2 +1,2 @@
%p
- You have been unsubscribed from receiving GitLab administrator notifications.
+ = s_('Notify|You have been unsubscribed from receiving GitLab administrator notifications.')
diff --git a/app/views/notify/two_factor_otp_attempt_failed_email.html.haml b/app/views/notify/two_factor_otp_attempt_failed_email.html.haml
new file mode 100644
index 00000000000..fec7083e524
--- /dev/null
+++ b/app/views/notify/two_factor_otp_attempt_failed_email.html.haml
@@ -0,0 +1,51 @@
+- default_font = "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;"
+- default_style = "#{default_font}font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;"
+- spacer_style = "#{default_font};height:18px;font-size:18px;line-height:18px;"
+
+%tr.alert
+ %td{ style: "#{default_font}padding:10px;border-radius:3px;font-size:14px;line-height:1.3;text-align:center;overflow:hidden;color:#ffffff;background-color:#FC6D26;" }
+ %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;margin:0 auto;" }
+ %tbody
+ %tr
+ %td{ style: "#{default_font}vertical-align:middle;color:#ffffff;text-align:center;" }
+ %span
+ = _("We detected an attempt to sign in to your %{host} account using a wrong two-factor authentication code") % { host: Gitlab.config.gitlab.host }
+%tr.spacer
+ %td{ style: spacer_style }
+ &nbsp;
+%tr.section
+ %td{ style: "#{default_font};padding:0 15px;border:1px solid #ededed;border-radius:3px;overflow:hidden;" }
+ %table.info{ border: "0", cellpadding: "0", cellspacing: "0", style: "width:100%;" }
+ %tbody
+ %tr
+ %td{ style: default_style }
+ = _('Hostname')
+ %td{ style: "#{default_style}color:#333333;font-weight:400;width:75%;padding-left:5px;" }
+ = Gitlab.config.gitlab.host
+ %tr
+ %td{ style: "#{default_style}border-top:1px solid #ededed;" }
+ = _('IP Address')
+ %td{ style: "#{default_style}color:#333333;font-weight:400;width:75%;padding-left:5px;border-top:1px solid #ededed;" }
+ %span.muted{ style: "color:#333333;text-decoration:none;" }
+ = @ip
+ %tr
+ %td{ style: "#{default_style}border-top:1px solid #ededed;" }
+ = _('Time')
+ %td{ style: "#{default_style}color:#333333;font-weight:400;width:75%;padding-left:5px;border-top:1px solid #ededed;" }
+ = @time.strftime('%Y-%m-%d %H:%M:%S %Z')
+%tr.spacer
+ %td{ style: spacer_style }
+ &nbsp;
+%tr.section
+ %td{ style: "#{default_font};line-height:1.4;text-align:center;padding:0 15px;overflow:hidden;" }
+ %table.img{ border: "0", cellpadding: "0", cellspacing: "0", style: "border-collapse:collapse;width:100%;" }
+ %tbody
+ %tr{ style: 'width:100%;' }
+ %td{ style: "#{default_style}text-align:center;" }
+ - password_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: 'https://docs.gitlab.com/ee/user/profile/user_passwords.html#change-your-password' }
+ = _('If you recently tried to sign in, but mistakenly entered a wrong two-factor authentication code, you may ignore this email.')
+
+ - if password_authentication_enabled_for_web?
+ %p
+ = _('If you did not recently try to sign in, you should immediately %{password_link_start}change your password%{password_link_end}.').html_safe % { password_link_start: password_link_start, password_link_end: '</a>'.html_safe }
+ = _('Make sure you choose a strong, unique password.')
diff --git a/app/views/notify/two_factor_otp_attempt_failed_email.text.haml b/app/views/notify/two_factor_otp_attempt_failed_email.text.haml
new file mode 100644
index 00000000000..8f839cd83ee
--- /dev/null
+++ b/app/views/notify/two_factor_otp_attempt_failed_email.text.haml
@@ -0,0 +1,7 @@
+= _('Hi %{username}!') % { username: sanitize_name(@user.name) }
+
+= _('We detected an attempt to sign in to your %{host} account using a wrong two-factor authentication code, from the following IP address: %{ip}, at %{time}') % { host: Gitlab.config.gitlab.host, ip: @ip, time: @time }
+
+= _('If you recently tried to sign in, but mistakenly entered a wrong two-factor authentication code, you may ignore this email.')
+= _('If you did not recently try to sign in, you should immediately change your password: %{password_link}.') % { password_link: 'https://docs.gitlab.com/ee/user/profile/user_passwords.html#change-your-password' }
+= _('Make sure you choose a strong, unique password.')
diff --git a/app/views/notify/unknown_sign_in_email.html.haml b/app/views/notify/unknown_sign_in_email.html.haml
index 47c5656db27..b1c79274e26 100644
--- a/app/views/notify/unknown_sign_in_email.html.haml
+++ b/app/views/notify/unknown_sign_in_email.html.haml
@@ -42,7 +42,7 @@
%tbody
%tr{ style: 'width:100%;' }
%td{ style: "#{default_style}text-align:center;" }
- - password_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: 'https://docs.gitlab.com/ee/user/profile/#changing-your-password' }
+ - password_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: 'https://docs.gitlab.com/ee/user/profile/user_passwords.html#change-your-password' }
= _('If you recently signed in and recognize the IP address, you may disregard this email.')
- if password_authentication_enabled_for_web?
diff --git a/app/views/notify/unknown_sign_in_email.text.haml b/app/views/notify/unknown_sign_in_email.text.haml
index f3efc4c4fcd..54c7a245ab9 100644
--- a/app/views/notify/unknown_sign_in_email.text.haml
+++ b/app/views/notify/unknown_sign_in_email.text.haml
@@ -3,7 +3,7 @@
= _('A sign-in to your account has been made from the following IP address: %{ip}') % { ip: @ip }
= _('If you recently signed in and recognize the IP address, you may disregard this email.')
-= _('If you did not recently sign in, you should immediately change your password: %{password_link}.') % { password_link: 'https://docs.gitlab.com/ee/user/profile/#changing-your-password' }
+= _('If you did not recently sign in, you should immediately change your password: %{password_link}.') % { password_link: 'https://docs.gitlab.com/ee/user/profile/user_passwords.html#change-your-password' }
= _('Passwords should be unique and not used for any other sites or services.')
- unless @user.two_factor_enabled?