diff options
Diffstat (limited to 'app/views/notify')
7 files changed, 53 insertions, 6 deletions
diff --git a/app/views/notify/access_token_expired_email.html.haml b/app/views/notify/access_token_expired_email.html.haml index 1e7c07c2282..9c3ef4cfdff 100644 --- a/app/views/notify/access_token_expired_email.html.haml +++ b/app/views/notify/access_token_expired_email.html.haml @@ -1,7 +1,15 @@ %p = _('Hi %{username}!') % { username: sanitize_name(@user.name) } %p - = _('One or more of your personal access tokens has expired.') + - if @token_names.empty? + = _('One or more of your personal access tokens has expired.') + - else + = _('The following personal access tokens have expired:') + + %p + %ul + - @token_names.each do |token| + %li= token %p - - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url } + - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url } = html_escape(_('You can create a new one or check them in your %{pat_link_start}personal access tokens%{pat_link_end} settings.')) % { pat_link_start: pat_link_start, pat_link_end: '</a>'.html_safe } diff --git a/app/views/notify/access_token_expired_email.text.erb b/app/views/notify/access_token_expired_email.text.erb index 4dc67e85dc2..6f6a9d38192 100644 --- a/app/views/notify/access_token_expired_email.text.erb +++ b/app/views/notify/access_token_expired_email.text.erb @@ -1,5 +1,13 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> -<%= _('One or more of your personal access tokens has expired.') %> +<%- if @token_names.empty? -%> +<%= _('One or more of your personal access tokens have expired.') %> +<%- else -%> +<%= _('The following personal access tokens have expired:') %> + +<%- @token_names.each do |token| -%> + - <%= token %> +<%- end -%> +<%- end -%> <%= _('You can create a new one or check them in your personal access tokens settings %{pat_link}.') % { pat_link: @target_url } %> diff --git a/app/views/notify/access_token_revoked_email.html.haml b/app/views/notify/access_token_revoked_email.html.haml index ecd2b3e84b2..780d633f184 100644 --- a/app/views/notify/access_token_revoked_email.html.haml +++ b/app/views/notify/access_token_revoked_email.html.haml @@ -2,7 +2,7 @@ = _('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 } -- if @source == 'secret_detection' +- if @source == :secret_detection = _('We found your token in a public project and have automatically revoked it to protect your account.') %p - pat_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: @target_url } diff --git a/app/views/notify/access_token_revoked_email.text.erb b/app/views/notify/access_token_revoked_email.text.erb index a0623f96488..8ddab63ae27 100644 --- a/app/views/notify/access_token_revoked_email.text.erb +++ b/app/views/notify/access_token_revoked_email.text.erb @@ -1,7 +1,7 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> <%= _('A personal access token, named %{token_name}, has been revoked.') % { token_name: @token_name } %> -<% if @source == 'secret_detection' %> +<% if @source == :secret_detection %> <%= _('We found your token in a public project and have automatically revoked it to protect your account.') %> <% end %> diff --git a/app/views/notify/github_gists_import_errors_email.html.haml b/app/views/notify/github_gists_import_errors_email.html.haml new file mode 100644 index 00000000000..07b4cfca77e --- /dev/null +++ b/app/views/notify/github_gists_import_errors_email.html.haml @@ -0,0 +1,19 @@ +- text_style = 'font-size:16px; text-align:center; line-height:30px;' + +%p{ style: text_style } + = s_('GithubImporter|Your import of GitHub gists into GitLab snippets is complete.') + +%p + = s_('GithubImporter|GitHub gists that were not imported:') + + %ol + - @errors.each do |gist_id, error| + %li + = s_("GithubImporter|Gist with id %{gist_id} failed due to error: %{error}.") % { gist_id: gist_id, error: error } + - if error == Gitlab::GithubGistsImport::Importer::GistImporter::FILE_COUNT_LIMIT_MESSAGE + - import_snippets_url = help_page_url('api/import.md', anchor: 'import-github-gists-into-gitlab-snippets') + - import_snippets_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: import_snippets_url } + = html_escape(s_("GithubImporter|Please follow %{import_snippets_link_start}Import GitHub gists into GitLab snippets%{import_snippets_link_end} for more details.")) % { import_snippets_link_start: import_snippets_link_start, import_snippets_link_end: '</a>'.html_safe } + +%p + = s_('GithubImporter|GitHub gists with more than 10 files must be manually migrated.') diff --git a/app/views/notify/github_gists_import_errors_email.text.erb b/app/views/notify/github_gists_import_errors_email.text.erb new file mode 100644 index 00000000000..2743a658269 --- /dev/null +++ b/app/views/notify/github_gists_import_errors_email.text.erb @@ -0,0 +1,12 @@ +<%= s_('GithubImporter|Your import of GitHub gists into GitLab snippets is complete.') %> + +<%= s_('GithubImporter|GitHub gists that were not imported:') %> +<% @errors.each do |gist_id, error| %> + - <%= s_("GithubImporter|Gist with id %{gist_id} failed due to error: %{error}.") % { gist_id: gist_id, error: error } %> + <% if error == Gitlab::GithubGistsImport::Importer::GistImporter::FILE_COUNT_LIMIT_MESSAGE %> + <% import_snippets_url = help_page_url('api/import.md', anchor: 'import-github-gists-into-gitlab-snippets') %> + <%= s_("GithubImporter|Please follow %{import_snippets_url} for more details.") % { import_snippets_url: import_snippets_url } %> + <% end %> +<% end %> + +<%= s_('GithubImporter|GitHub gists with more than 10 files must be manually migrated.') %> diff --git a/app/views/notify/service_desk_new_note_email.html.haml b/app/views/notify/service_desk_new_note_email.html.haml index 02f6b3914c9..969221d00d2 100644 --- a/app/views/notify/service_desk_new_note_email.html.haml +++ b/app/views/notify/service_desk_new_note_email.html.haml @@ -2,4 +2,4 @@ .gl-mb-5 = _("%{author_link} wrote:").html_safe % { author_link: link_to(@note.author_name, user_url(@note.author)) } .md - = markdown(@note.note, pipeline: :email, author: @note.author, issuable_reference_expansion_enabled: true) + = markdown(@note.note, pipeline: :service_desk_email, author: @note.author, issuable_reference_expansion_enabled: true, uploads_as_attachments: @uploads_as_attachments) |