diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/views/notify | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/views/notify')
-rw-r--r-- | app/views/notify/member_invited_email.html.haml | 126 |
1 files changed, 67 insertions, 59 deletions
diff --git a/app/views/notify/member_invited_email.html.haml b/app/views/notify/member_invited_email.html.haml index a4ea63e3d53..843a820bd1b 100644 --- a/app/views/notify/member_invited_email.html.haml +++ b/app/views/notify/member_invited_email.html.haml @@ -1,60 +1,68 @@ -- placeholders = { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe, project_or_group_name: member_source.human_name, project_or_group: member_source.model_name.singular, br_tag: '<br/>'.html_safe, role: member.human_access.downcase } +- placeholders = { strong_start: '<strong>'.html_safe, + strong_end: '</strong>'.html_safe, + project_or_group_name: member_source.human_name, + project_or_group: member_source.model_name.singular, + br_tag: '<br/>'.html_safe, + role: member.human_access.downcase } +- join_text = s_('InviteEmail|Join now') +- join_url = invite_url(@token, invite_type: Emails::Members::INITIAL_INVITE, experiment_name: 'invite_email_preview_text') +- inviter_name = member.created_by.name if member.created_by -- experiment('members/invite_email', actor: member) do |experiment_instance| - - experiment_instance.use do - %tr - %td.text-content - %h2.invite-header - = s_('InviteEmail|You are invited!') - %p - - if member.created_by - = html_escape(s_("InviteEmail|%{inviter} invited you to join the %{strong_start}%{project_or_group_name}%{strong_end}%{br_tag}%{project_or_group} as a %{role}")) % placeholders.merge({ inviter: (link_to member.created_by.name, user_url(member.created_by)).html_safe }) - - else - = html_escape(s_("InviteEmail|You are invited to join the %{strong_start}%{project_or_group_name}%{strong_end}%{br_tag}%{project_or_group} as a %{role}")) % placeholders - %p.invite-actions - = link_to s_('InviteEmail|Join now'), invite_url(@token, invite_type: Members::InviteEmailExperiment::INVITE_TYPE), class: 'invite-btn-join' - - experiment_instance.try(:activity) do - %tr - %td.text-content{ colspan: 2 } - %img.mail-avatar{ height: "60", src: avatar_icon_for_user(member.created_by, 60, only_path: false), width: "60", alt: "" } - %p - = html_escape(s_("InviteEmail|%{inviter} invited you to join the %{strong_start}%{project_or_group_name}%{strong_end}%{br_tag}%{project_or_group} as a %{role}")) % placeholders.merge({ inviter: (link_to member.created_by.name, user_url(member.created_by)).html_safe }) - %p.invite-actions - = link_to s_('InviteEmail|Join now'), invite_url(@token, invite_type: Members::InviteEmailExperiment::INVITE_TYPE), class: 'invite-btn-join' - %tr.border-top - %td.text-content.mailer-align-left.half-width - %h4 - = s_('InviteEmail|%{project_or_group} details') % { project_or_group: member_source.model_name.singular.capitalize } - %ul - %li - %div - %img.mailer-icon{ alt: '', src: image_url("mailers/members/users.png") } - %span - - member_count = member_source.members.size - = n_('%{bold_start}%{count}%{bold_end} member', '%{bold_start}%{count}%{bold_end} members', - member_count).html_safe % { count: number_with_delimiter(member_count), - bold_start: '<b>'.html_safe, - bold_end: '</b>'.html_safe } - %li - %div - %img.mailer-icon{ alt: '', src: image_url("mailers/members/issues.png") } - %span - - issue_count = member_source.open_issues_count(member.created_by) - = n_('%{bold_start}%{count}%{bold_end} issue', '%{bold_start}%{count}%{bold_end} issues', - issue_count).html_safe % { count: number_with_delimiter(issue_count), - bold_start: '<b>'.html_safe, - bold_end: '</b>'.html_safe } - %li - %div - %img.mailer-icon{ alt: '', src: image_url("mailers/members/merge-request-open.png") } - %span - - mr_count = member_source.open_merge_requests_count(member.created_by) - = n_('%{bold_start}%{count}%{bold_end} opened merge request', '%{bold_start}%{count}%{bold_end} opened merge requests', - mr_count).html_safe % { count: number_with_delimiter(mr_count), - bold_start: '<b>'.html_safe, - bold_end: '</b>'.html_safe } - %td.text-content.mailer-align-left.half-width - %h4 - = s_("InviteEmail|What's it about?") - %p - = invited_to_description(member_source) +- experiment(:invite_email_preview_text, actor: member) do |experiment_instance| + - experiment_instance.use {} + - experiment_instance.candidate do + = content_for :preview_text do + %div{ style: "display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;" } + - if member.created_by + = s_('InviteEmail|Join your team on GitLab! %{inviter} invited you to %{project_or_group_name}') % { inviter: inviter_name, project_or_group_name: placeholders[:project_or_group_name] } + - else + = s_('InviteEmail|Join your team on GitLab! You are invited to %{project_or_group_name}') % { project_or_group_name: placeholders[:project_or_group_name] } + = gmail_goto_action(join_text, join_url) + +%tr + %td.text-content{ colspan: 2 } + %img.mail-avatar{ height: "60", src: avatar_icon_for_user(member.created_by, 60, only_path: false), width: "60", alt: "" } + %p + - if member.created_by + = html_escape(s_("InviteEmail|%{inviter} invited you to join the %{strong_start}%{project_or_group_name}%{strong_end}%{br_tag}%{project_or_group} as a %{role}")) % placeholders.merge({ inviter: (link_to inviter_name, user_url(member.created_by)).html_safe }) + - else + = html_escape(s_("InviteEmail|You are invited to join the %{strong_start}%{project_or_group_name}%{strong_end}%{br_tag}%{project_or_group} as a %{role}")) % placeholders + %p.invite-actions + = link_to join_text, join_url, class: 'invite-btn-join' +%tr.border-top + %td.text-content.mailer-align-left.half-width + %h4 + = s_('InviteEmail|%{project_or_group} details') % { project_or_group: member_source.model_name.singular.capitalize } + %ul + %li + %div + %img.mailer-icon{ alt: '', src: image_url("mailers/members/users.png") } + %span + - member_count = member_source.members.size + = n_('%{bold_start}%{count}%{bold_end} member', '%{bold_start}%{count}%{bold_end} members', + member_count).html_safe % { count: number_with_delimiter(member_count), + bold_start: '<b>'.html_safe, + bold_end: '</b>'.html_safe } + %li + %div + %img.mailer-icon{ alt: '', src: image_url("mailers/members/issues.png") } + %span + - issue_count = member_source.open_issues_count(member.created_by) + = n_('%{bold_start}%{count}%{bold_end} issue', '%{bold_start}%{count}%{bold_end} issues', + issue_count).html_safe % { count: number_with_delimiter(issue_count), + bold_start: '<b>'.html_safe, + bold_end: '</b>'.html_safe } + %li + %div + %img.mailer-icon{ alt: '', src: image_url("mailers/members/merge-request-open.png") } + %span + - mr_count = member_source.open_merge_requests_count(member.created_by) + = n_('%{bold_start}%{count}%{bold_end} opened merge request', '%{bold_start}%{count}%{bold_end} opened merge requests', + mr_count).html_safe % { count: number_with_delimiter(mr_count), + bold_start: '<b>'.html_safe, + bold_end: '</b>'.html_safe } + %td.text-content.mailer-align-left.half-width + %h4 + = s_("InviteEmail|What's it about?") + %p + = invited_to_description(member_source) |