diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 1cd51ea..ec91ba8 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -6,6 +6,7 @@ @orgs = Org.where(parent_id: nil).order("name") @other_organisations = Org.where(parent_id: nil, is_other: true).pluck(:id) @identifier_schemes = IdentifierScheme.where(active: true).order(:name) + @default_org = current_user.org end # GET /resource diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index a13492c..5be78f9 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,136 +1,108 @@ -

<%= _('Edit profile') %>

-<%= raw _('

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.

') %> +
+

<%= _('Edit profile') %>

-
+

+ <%= _("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.") %> +

+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}) do |f| %> - <%= hidden_field_tag :unlink_flag, "false", id: "unlink_flag" %> - -
+
-

<%= raw _('You can edit any of the details below.') %>

+ +
+

<%= _('You can edit any of the details below.') %>

+ + <%= hidden_field_tag :unlink_flag, "false", id: "unlink_flag" %> - - - - - - - - - - - - - - - - - - "> - - - - <% if MANY_LANGUAGES %> - - - - - <% end %> + <%= f.label :email, _('Email') + " *" %> + <%= f.email_field :email, as: :email, class: "combobox-like" %> +
<%= _('Please enter your current password below when changing your email address.') %>
+ +
+ + <%= f.label :firstname, _('First name')+ " *" %> + <%= f.text_field :firstname, as: :string, + id: "first_time_login_firstname", + autofocus: true, + class: "combobox-like has-tooltip", + "data-toggle" => "tooltip", + "data-trigger" => "focus" , + "title" => _('Please enter your first name.') %> - <% @identifier_schemes.each do |scheme| %> - - - - - <% end %> - - - <% unless @user.api_token.blank? %> - - - - - - - - - <% end %> -
<%= (_('Email') + " *") %><%= f.email_field :email, as: :email %>
<%= _('First name') %><%= f.text_field :firstname, as: :string, - id: "first_time_login_firstname", - autofocus: true, - class: "text_field has-tooltip", - "data-toggle" => "tooltip", - "data-trigger" => "focus" , - "title" => _('Please enter your first name.') %>
<%= _('Last name') %><%= f.text_field :surname, - as: :string, id: "first_time_login_surname", - class: "text_field has-tooltip", - "data-toggle" => "tooltip", - "data-trigger" => "focus" , - "title" => _('Please enter your surname or family name.') %>
<%= _('Organisation') %><%= collection_select(:user, - :org_id, @orgs, - :id, :name, {include_blank: _('Select Organisation')}, - { class: "typeahead org_sign_up" }) %>
<%= _('Language') %> - - <% locale = current_user.get_locale(); %> - -
<%= scheme.name %> + <%= f.label :surname, _('Last name') + " *" %> + <%= f.text_field :surname, as: :string, id: "first_time_login_surname", + class: "combobox-like has-tooltip", "data-toggle" => "tooltip", + "data-trigger" => "focus" , + "title" => _('Please enter your surname or family name.') %> + + <%= 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'} %> + + <% if MANY_LANGUAGES %> + <% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %> + <%= f.label :language, _('Language') %> + + <% end %> + + <% @identifier_schemes.each do |scheme| %> + +
<%= render partial: 'external_identifier', locals: {scheme: scheme, id: current_user.identifier_for(scheme)} %> -
<%= _('API token') %><%= @user.api_token %>
<%= _('API Information') %><%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
-
-

- <% if Rails.application.config.shibboleth_enabled %> - <% if resource.shibboleth_id.nil? || resource.shibboleth_id.length == 0 then %> - <%= link_to _('Link your %{application_name} account to your institutional credentials (UK users only)') % { :application_name => user_omniauth_shibboleth_path }, class: "a-orange" %> - <% else %> - <%= _('Your account is linked to your institutional credentials.') %> - - <%= _('Unlink your institutional credentials')%> - +

<% end %> - <% end %> -

-
-
+ + <% if Rails.application.config.shibboleth_enabled %> + + <% if resource.shibboleth_id.nil? || resource.shibboleth_id.length == 0 then %> + <%= link_to _('Link your %{application_name} account to your institutional credentials (UK users only)') % { :application_name => user_omniauth_shibboleth_path }, class: "a-orange" %> + <% else %> + <%= _('Your account is linked to your institutional credentials.') %> + + <%= _('Unlink your institutional credentials')%> + + <% end %> + <% end %> + + <% unless @user.api_token.blank? %> + <%= f.label :api_token, _('API token') %> +
<%= @user.api_token %>
+ + +
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
+ <% end %> + +
+ +

<%= _('If you would like to change your password please complete the following fields.') %>

+ + <%= f.label :current_password, _('Current password') %> + <%= f.password_field :current_password, as: :password, class: 'combobox-like' %> + + <%= f.label :password, _('New password') %> + <%= f.password_field :password, as: :password, autocomplete: "off", class: 'combobox-like' %> + + <%= f.label :password_confirmation, _('Password confirmation') %> + <%= f.password_field :password_confirmation, as: :password, autocomplete: "off", class: 'combobox-like' %> + +
-

- <%= _('If you would like to change your password please complete the following fields.') %> -

- - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
<%= t('custom_devise.waiting_for_confirmation') %><%= resource.unconfirmed_email %>
- <% end %> - - - - - - - - - - - - -
<%= _('Current password') %> - <%= f.password_field :current_password, as: :password %> -
<%= _('New password') %><%= f.password_field :password, as: :password, autocomplete: "off" %> -
<%= _('Password confirmation') %><%= f.password_field :password_confirmation, as: :password, autocomplete: "off" %>
-
- <%= f.submit _('Save'), class: "btn btn-primary" %> - <%= link_to _('Cancel'), :back, class: "btn btn-primary" %> -
+ + <% end %> -
diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb index a046efa..f0d51cd 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -20,9 +20,9 @@ <% default_name = (current_user.firstname.blank? ? _('My Plan') : current_user.firstname + "'s" + _(" Plan")) %> -
- <%= _('If applying for funding, state the title exactly as in the proposal.') %> -
+
+ <%= _('If applying for funding, state the title exactly as in the proposal.') %> +
@@ -34,7 +34,7 @@ <%= render partial: "shared/accessible_combobox", - locals: {name: 'plan[org_name]', + locals: {name: 'plan[org_name]', id: 'plan_org_name', default_selection: @default_org, models: @orgs, @@ -43,8 +43,8 @@ <%= _('My research organization is not on the list') %> - <%= _(' or ') %> - <%= _('no research organization is associated with this plan')%> + <%= _(' or ') %> + <%= _('no research organization is associated with this plan')%> @@ -57,7 +57,7 @@ <%= render partial: "shared/accessible_combobox", - locals: {name: 'plan[funder_name]', + locals: {name: 'plan[funder_name]', id: 'plan_funder_name', default_selection: nil, models: @funders, diff --git a/lib/assets/stylesheets/dmproadmap.scss b/lib/assets/stylesheets/dmproadmap.scss index c9b2b36..2901858 100644 --- a/lib/assets/stylesheets/dmproadmap.scss +++ b/lib/assets/stylesheets/dmproadmap.scss @@ -31,6 +31,10 @@ -moz-border-radius: 10px; border-radius: 10px; + .heading-spacer { + height: 35px; + } + label, input[type="checkbox"], .combobox-container,