%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<%
css_bundle :login_confirm
js_bundle :registration_confirmation
@headers = false
add_body_class "full-width modal body--login-confirmation"
provide :page_title, t("Register Email")
%>
<%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
<%= t 'titles.welcome_aboard', "Welcome Aboard!" %>
<%= mt 'details.wrong_account', "The invitation for %{course} was sent to **%{invited_user}**, but you are currently logged in as **%{current_user}**", :course => @course.name, :invited_user => @user.name, :current_user => @current_user.name %>
<% if @enrollment %>
<%= mt 'details.logged_in_other_user_course', "The invitation for %{course} was sent to **%{email}**, but you are currently logged in as **%{user}**.", :course => @course.name, :email => @communication_channel.path, :user => (@current_pseudonym && @current_pseudonym.user == @current_user ? @current_pseudonym : @current_user.pseudonym).unique_id %>
<% else %>
<%= mt 'details.logged_in_other_user', "**%{email}** is a new account, but you are currently logged in as **%{user}**.", :email => @communication_channel.path, :user => (@current_pseudonym && @current_pseudonym.user == @current_user ? @current_pseudonym : @current_user.pseudonym).unique_id %>
<% end %>
<%= t 'details.add_email', "Would you like to add this email address to your current account?" %>
<% else %>
<% if !@enrollment && @user.registered? %>
<%= mt 'details.merge_multiple', "Select the account you would like to combine with **%{current_user}**.", :current_user => friendly_name(@user, @merge_opportunities) %>
<% else %>
<%= mt 'details.multiple_accounts_course', "There are already %{count} accounts associated with this email address.
Which is you?", :count => @merge_opportunities.length %>
<% end %>
<% @merge_opportunities.each_with_index do |(user, pseudonyms), i| %>
<% if pseudonyms.length == 1 || user == @current_user %>
<% else %>
<%= user.name %>
<% pseudonyms.each_with_index do |pseudonym, j| %>
<%= mt 'details.account_needed', "You've been invited to join **%{course}**. To accept this request you need a Canvas account. Click the link below to create a Canvas account.", :course => @course.name %>
<%= if @enrollment
mt 'details.register_with_course', "In order to finish signing you up for the course **%{course}**, we'll need a little more information.", :course => @course.name
else
t 'details.register', "In order to set up your account, we'll need a little more information."
end %>