<div class="main">
<h1><%= _('Edit profile') %></h1>
<p>
<%= _("Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.") %>
</p>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, class: "roadmap-form white_background"}) do |f| %>
<!-- Edit Profile -->
<fieldset class="side-by-side">
<legend><%= _('You can edit any of the details below.') %></legend>
<%= hidden_field_tag :unlink_flag, "false", id: "unlink_flag" %>
<div>
<%= f.label :email, _('Email') + " *" %>
<%= f.email_field :email, as: :email, class: "input-medium has-tooltip",
"data-toggle": "tooltip", "data-trigger": "focus",
"title": _('Please enter your current password below when changing your email address.') %>
</div>
<div>
<%= f.label :firstname, _('First name')+ " *" %>
<%= f.text_field :firstname, as: :string,
id: "first_time_login_firstname",
autofocus: true,
class: "input-medium has-tooltip",
"data-toggle" => "tooltip",
"data-trigger" => "focus" ,
"title" => _('Please enter your first name.') %>
</div>
<div>
<%= f.label :surname, _('Last name') + " *" %>
<%= f.text_field :surname, as: :string, id: "first_time_login_surname",
class: "input-medium has-tooltip", "data-toggle" => "tooltip",
"data-trigger" => "focus" ,
"title" => _('Please enter your surname or family name.') %>
</div>
<div>
<%= f.label :org, _('Organisation') + " *" %>
<%= render partial: "shared/accessible_combobox",
locals: {name: "#{resource_name}[org_name]",
id: "#{resource_name}_org_name",
default_selection: @default_org,
models: @orgs,
attribute: 'name',
classes: 'fixed-width-large'} %>
</div>
<% if MANY_LANGUAGES %>
<div>
<% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %>
<%= f.label :language, _('Language') %>
<select id="user_language_id" name="user[language_id]"
class="input-medium">
<%= @languages.each do |l| %>
<option value="<%= l.id %>"<%= lang == l.abbreviation ? ' selected="selected"' : '' %>>
<%= l.name %>
</option>
<% end %>
</select>
</div>
<% end %>
<% @identifier_schemes.each do |scheme| %>
<div>
<label><%= scheme.name %></label>
<div class="identifier-scheme identifier-scheme-indent">
<%= render partial: 'external_identifier',
locals: {scheme: scheme,
id: current_user.identifier_for(scheme)} %>
</div>
</div>
<% end %>
<% unless @user.api_token.blank? %>
<div>
<%= f.label :api_token, _('API token') %>
<div class="input-medium"><%= @user.api_token %></div>
<label><%= _('API Information') %></label>
<div><%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%></div>
</div>
<% end %>
<br />
<legend><%= _('If you would like to change your password please complete the following fields.') %></legend>
<div>
<%= f.label :current_password, _('Current password') %>
<%= f.password_field :current_password, as: :password, class: 'input-medium' %>
</div>
<div>
<%= f.label :password, _('New password') %>
<%= f.password_field :password, as: :password, autocomplete: "off", class: 'input-medium' %>
</div>
<div>
<%= f.label :password_confirmation, _('Password confirmation') %>
<%= f.password_field :password_confirmation, as: :password, autocomplete: "off",
class: 'input-medium' %>
</div>
<div>
<label></label>
<input type="submit" class="form-submit" value="<%= _('Save') %>" />
</div>
</fieldset>
<% end %>
</div>
<!-- alert for the default template-->
<div id="unlink-institutional-credentials-dialog" data-container="body" data-backdrop="static" class="modal hide fade">
<div class="modal-header">
<h3><%= _('Unlink institutional credentials alert') %></h3>
</div>
<div class="modal-body">
<%= raw _('<p>You are about to unlink %{application_name} of your institutional credentials, would you like to continue?</p>') % { :application_name => user_shibboleth_omniauth_authorize_path } %>
</div>
<div class="modal-footer">
<a href="#" id="unlink-shibboleth-cancelled" class="btn"><%= _('Cancel') %></a>
<a href="#" id="unlink-shibboleth-confirmed" class="btn btn-primary"><%= _('Unlink account') %></a>
</div>
</div>