summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-28 18:18:48 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-29 11:29:07 -0200
commit867dcdf75012a7b7c8b131d46b275b28fa5bfa00 (patch)
tree80085890c1cdba08442db7864dc456f657d62991
parent84638de6a35f2a3391117db5b692e8641d9ee061 (diff)
downloadgitlab-ce-867dcdf75012a7b7c8b131d46b275b28fa5bfa00.tar.gz
Alert user when logged in user email is not the same as the invitation
-rw-r--r--app/views/invites/show.html.haml13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/views/invites/show.html.haml b/app/views/invites/show.html.haml
index 2fd4859c1c6..882fdf1317d 100644
--- a/app/views/invites/show.html.haml
+++ b/app/views/invites/show.html.haml
@@ -6,7 +6,7 @@
- if inviter = @member.created_by
by
= link_to inviter.name, user_url(inviter)
- to join
+ to join
- case @member.source
- when Project
- project = @member.source
@@ -20,11 +20,18 @@
= link_to group.name, group_url(group)
as #{@member.human_access}.
-- if @member.source.users.include?(current_user)
+- is_member = @member.source.users.include?(current_user)
+
+- if is_member
%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.
-- else
+
+- 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
.actions
= link_to "Accept invitation", accept_invite_url(@token), method: :post, class: "btn btn-success"
= link_to "Decline", decline_invite_url(@token), method: :post, class: "btn btn-danger prepend-left-10"