BigW Consortium Gitlab

show.html.haml 1.22 KB
Newer Older
1
- page_title "Invitation"
Douwe Maan committed
2 3 4 5 6 7 8
%h3.page-title Invitation

%p
  You have been invited
  - if inviter = @member.created_by
    by
    = link_to inviter.name, user_url(inviter)
9
  to join
Douwe Maan committed
10 11 12 13 14 15 16 17 18 19 20 21 22
  - case @member.source
  - when Project
    - project = @member.source
    project
    %strong
      = link_to project.name_with_namespace, namespace_project_url(project.namespace, project)
  - when Group
    - group = @member.source
    group
    %strong
      = link_to group.name, group_url(group)
  as #{@member.human_access}.

23 24 25
- is_member = @member.source.users.include?(current_user)

- if is_member
Douwe Maan committed
26 27 28
  %p
    However, you are already a member of this #{@member.source.is_a?(Group) ? "group" : "project"}.
    Sign in using a different account to accept the invitation.
29 30 31 32 33 34

- if @member.invite_email != current_user.email
  %p
    Note that this invitation was sent to #{mail_to @member.invite_email}, but you are signed in as #{link_to current_user.to_reference, user_url(current_user)} with email #{mail_to current_user.email}.

- unless is_member
Douwe Maan committed
35 36
  .actions
    = link_to "Accept invitation", accept_invite_url(@token), method: :post, class: "btn btn-success"
Douwe Maan committed
37
    = link_to "Decline", decline_invite_url(@token), method: :post, class: "btn btn-danger prepend-left-10"