summaryrefslogtreecommitdiff
path: root/app/views/invites/show.html.haml
blob: c1ee12bb6c8b9d1aee18f69629b51cedaf3ff6e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- page_title _("Invitation")
%h1.page-title.gl-font-size-h-display= _("Invitation")

- if current_user_matches_invite?
  - if member?
    %p
      = _("You are already a member of this %{member_source}.") % { member_source: @invite_details[:title] }
    .actions
      = link_to _("Go to %{source_name}") % { source_name: @invite_details[:title] }, @invite_details[:url], class: "btn gl-button btn-confirm"

  - else
    %p
      - inviter = @member.created_by
      - link_to_inviter = link_to(inviter.name, user_url(inviter))
      - link_to_source = link_to(@invite_details[:name], @invite_details[:url])

      = html_escape(_("You have been invited by %{link_to_inviter} to join %{source_name} %{strong_open}%{link_to_source}%{strong_close} as %{role}")) % { link_to_inviter: link_to_inviter, source_name: @invite_details[:title], strong_open: '<strong>'.html_safe, link_to_source: link_to_source, strong_close: '</strong>'.html_safe, role: @member.human_access }

    .actions
      = link_to _("Accept invitation"), accept_invite_url(@token), method: :post, class: "btn gl-button btn-confirm"
      = link_to _("Decline"), decline_invite_url(@token), method: :post, class: "btn gl-button btn-danger gl-ml-3"

- else
  %p
    - mail_to_invite_email = mail_to(@member.invite_email)
    - mail_to_current_user = mail_to(current_user.email)
    - link_to_current_user = link_to(current_user.to_reference, user_url(current_user))
    = _("This invitation was sent to %{mail_to_invite_email}, but you are signed in as %{link_to_current_user} with email %{mail_to_current_user}.").html_safe % { mail_to_invite_email: mail_to_invite_email, mail_to_current_user: mail_to_current_user, link_to_current_user: link_to_current_user }
  %p
    = _("Sign in as a user with the matching email address, add the email to this account, or sign-up for a new account using the matching email.")