diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 239354b..c377ae7 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -3,7 +3,7 @@ def edit @user.create_default_preferences if @user.prefs == {} - @languages = Language.all.order("name") + @languages = Language.sorted_by_abbreviation @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) diff --git a/app/models/language.rb b/app/models/language.rb index 2d02783..1d86727 100644 --- a/app/models/language.rb +++ b/app/models/language.rb @@ -11,4 +11,6 @@ scope :sorted_by_abbreviation, -> { all.order(:abbreviation) } scope :default, -> { where(default_language: true).first } + # Retrieves the id for a given abbreviation of a language + scope :id_for, -> (abbreviation) { where(abbreviation: abbreviation).pluck(:id).first } end \ No newline at end of file diff --git a/app/views/annotations/_add_annotation.html.erb b/app/views/annotations/_add_annotation.html.erb index 8add942..d84fef9 100644 --- a/app/views/annotations/_add_annotation.html.erb +++ b/app/views/annotations/_add_annotation.html.erb @@ -25,8 +25,8 @@
- <%= submit_tag _('Save'), class: "btn btn-primary" %> + <%= submit_tag _('Save'), class: "btn btn-primary", role: 'button' %> <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_add_annotations" %> + <%= link_to _('Cancel'), "#", class: "btn cancel cancel_add_annotations", role: 'button' %>
<%end%> diff --git a/app/views/annotations/_edit_annotation.html.erb b/app/views/annotations/_edit_annotation.html.erb index 3a59362..cae438b 100644 --- a/app/views/annotations/_edit_annotation.html.erb +++ b/app/views/annotations/_edit_annotation.html.erb @@ -27,17 +27,17 @@
- <%= submit_tag _('Save'), class: 'btn btn-primary' %> + <%= submit_tag _('Save'), class: 'btn btn-primary', role: 'button' %> <% if example_answer.present? %> <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: example_answer.id), - confirm: _("You are about to delete an example answer for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary"%> + confirm: _("You are about to delete an example answer for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button' %> <% end %> <% if guidance.present? %> <%= link_to _('Delete Example Answer'), admin_destroy_annotation_path(id: guidance.id), - confirm: _("You are about to delete a guidance for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary"%> + confirm: _("You are about to delete a guidance for '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role: 'button'%> <% end %> <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), '#', class: 'btn cancel cancel_edit_annotations' %> + <%= link_to _('Cancel'), '#', class: 'btn cancel cancel_edit_annotations', role: 'button' %>
<% end %> diff --git a/app/views/annotations/_show_annotation.html.erb b/app/views/annotations/_show_annotation.html.erb index a790d70..9ed4d19 100644 --- a/app/views/annotations/_show_annotation.html.erb +++ b/app/views/annotations/_show_annotation.html.erb @@ -22,5 +22,5 @@
<%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Edit Annotations'), '# ', class: "btn btn-primary edit_form_for_annotations"%> + <%= link_to _('Edit Annotations'), '# ', class: "btn btn-primary edit_form_for_annotations", role: 'button'%>
diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index a82a78f..93dbcfc 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -16,7 +16,7 @@
- <%= f.submit t('helpers.save'), :class => 'btn btn-primary' %> + <%= f.submit t('helpers.save'), :class => 'btn btn-primary', role: 'button'%>
<% end %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 201002d..6be60ae 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -4,7 +4,7 @@

<%= _('The email address you entered is not registered.') %>

<% end %> -

<%= t('helpers.forgot_password') %>

+

<%= _('Forgot your password?') %>

<%= _('Please enter your email below and we will send you instructions on how to reset your password.') %>

@@ -13,9 +13,8 @@
- - + <%= f.label(:email, _('Email'), class: 'required') %> + <%= f.email_field(:email, class: 'left-indent required input-small') %>
@@ -29,5 +28,4 @@
<% end %> - - + \ No newline at end of file diff --git a/app/views/devise/registrations/_password_details.html.erb b/app/views/devise/registrations/_password_details.html.erb index 9a93588..561f8d7 100644 --- a/app/views/devise/registrations/_password_details.html.erb +++ b/app/views/devise/registrations/_password_details.html.erb @@ -5,33 +5,29 @@ <%= hidden_field_tag :skip_personal_details, "true" %>
- - + <%= f.label(:current_password, _('Current Password'), class: 'required') %> + <%= f.password_field(:current_password, class: 'left-indent required input-medium') %>
- - + <%= f.label(:password, _('New Password'), class: 'required') %> + <%= f.password_field(:password, class: 'left-indent required input-medium', id: 'user_new_password') %>
- - + <%= f.label(:password_confirmation, _('Password Confirmation'), class: 'required') %> + <%= f.password_field(:password_confirmation, class: 'left-indent required input-medium') %>
- - + <%= label_tag(:password_show, _('Show passwords')) %> + <%= check_box_tag(:password_show, "1", false, class: 'left-indent') %>

diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 1a509fe..4437580 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -16,47 +16,40 @@ <%= hidden_field_tag :skip_personal_details, "false" %>
- - + <%= f.label(:email, _('Email'), class: 'required') %> + <%= f.email_field(:email, class: 'left-indent required input-medium', + title: _('Please enter your current password below when changing your email address.'), + value: @user.email) %>
- - + <%= f.label(:firstname, _('First Name'), class: 'required') %> + <%= f.text_field(:firstname, class: 'input-small required left-indent', value: @user.firstname) %>
- - + <%= f.label(:surname, _('Last Name'), class: 'required') %> + <%= f.text_field(:surname, class: 'input-small required left-indent', value: @user.surname) %>
- - + <%= f.label(:recovery_email, _('Recovery Email'), class: 'required') %> + <%= f.email_field(:recovery_email, class: 'left-indent required input-medium', + title: _('This email will be used to recover your account if you change institutions'), + value: @user.recovery_email) %>
- - + <%= f.label(:password, _('Password'), class: 'required') %> + <%= f.password_field(:password, class: 'left-indent required input-medium') %>
- + <%= f.label(:org_name, _('Organisation')) %> <%= render partial: "shared/accessible_combobox", locals: {name: "#{resource_name}[org_name]", id: "#{resource_name}_org_name", @@ -68,16 +61,11 @@ <% if MANY_LANGUAGES %>
- <% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %> - - + <% lang_id = current_user.language.nil? ? Language.id_for(FastGettext.default_locale) : current_user.language.id %> + <%= f.label(:language_id, _('Language')) %> + <%= select_tag("user[language_id]", + options_from_collection_for_select(@languages, "id", "name", lang_id), + class: 'input-small left-indent') %>
<% end %> @@ -89,7 +77,7 @@ <% else %> - + <%= label_tag(:scheme_name, scheme.name.capitalize ) %> <% end %>
<%= render partial: "external_identifier_#{scheme.name}", @@ -101,10 +89,9 @@ <% unless @user.api_token.blank? %>
- <%= f.label :api_token, _('API token') %> + <%= f.label(:api_token, _('API token')) %>
<%= @user.api_token %>
- - + <%= label_tag(:api_information, _('API Information')) %>
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
<% end %> @@ -127,6 +114,6 @@ diff --git a/app/views/guidance_groups/admin_edit.html.erb b/app/views/guidance_groups/admin_edit.html.erb index 23ff6e3..cfd27cc 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -45,9 +45,9 @@
 
- <%= f.submit _('Save'), class: 'btn btn-primary' %> + <%= f.submit _('Save'), class: 'btn btn-primary', role:"button" %> <% if @guidance_group.published == false then %> - <%= f.submit _('Publish'), name: "save_publish", class: "btn btn-primary" %> + <%= f.submit _('Publish'), name: "save_publish", class: "btn btn-primary", role:"button" %> <% end %>
diff --git a/app/views/guidance_groups/admin_new.html.erb b/app/views/guidance_groups/admin_new.html.erb index 2303226..a22ae2b 100644 --- a/app/views/guidance_groups/admin_new.html.erb +++ b/app/views/guidance_groups/admin_new.html.erb @@ -30,7 +30,7 @@
 
- <%= f.submit _('Save'), name: "draft", class: "btn btn-primary" %> + <%= f.submit _('Save'), name: "draft", class: "btn btn-primary", role:"button"%>
<% end %> diff --git a/app/views/guidances/admin_edit.html.erb b/app/views/guidances/admin_edit.html.erb index 78f15be..8f617f8 100644 --- a/app/views/guidances/admin_edit.html.erb +++ b/app/views/guidances/admin_edit.html.erb @@ -36,7 +36,7 @@
 
- +
<%end%> diff --git a/app/views/guidances/admin_new.html.erb b/app/views/guidances/admin_new.html.erb index d838f14..a487cb5 100644 --- a/app/views/guidances/admin_new.html.erb +++ b/app/views/guidances/admin_new.html.erb @@ -33,7 +33,7 @@ <%= f.collection_select(:guidance_group_id, @guidance_groups, :id, :name, {prompt: false, include_blank: 'None'}, {multiple: false, title: _('Select which group this guidance relates to.')})%>
- +
 
diff --git a/app/views/notes/_archive.html.erb b/app/views/notes/_archive.html.erb index eae2154..f28234c 100644 --- a/app/views/notes/_archive.html.erb +++ b/app/views/notes/_archive.html.erb @@ -13,8 +13,8 @@
- <%= f.submit _('Remove'), onclick: "archive_note(#{note.id}, #{question_id})", :class => "btn btn-primary archive_comment_submit_button" %> - <%= link_to _('Cancel'), "#", onclick: "cancel_archive_note(#{note.id})", :class => "cancel_archive_comment btn cancel" %> + <%= f.submit _('Remove'), onclick: "archive_note(#{note.id}, #{question_id})", class: "btn btn-primary archive_comment_submit_button", role:"button" %> + <%= link_to _('Cancel'), "#", onclick: "cancel_archive_note(#{note.id})", class: "cancel_archive_comment btn cancel", role:"button" %>

<% end %> diff --git a/app/views/orgs/shibboleth_ds.html.erb b/app/views/orgs/shibboleth_ds.html.erb index 7484fdd..adf3e01 100644 --- a/app/views/orgs/shibboleth_ds.html.erb +++ b/app/views/orgs/shibboleth_ds.html.erb @@ -6,9 +6,7 @@ <%= form_for 'shibboleth_ds', url: shibboleth_ds_path, html: {class: "shibboleth-ds-form roadmap-form"} do |f| %>
- + <%= f.label(:org_name, _('Look up your institution here')) %> <% if @orgs.length <= 10 %> - - <%= raw @templates.collect{|t| "" }.join('') %> - + <%= select_tag(:plan_template_selector, + options_from_collection_for_select(@templates, 'id', 'title'), + class: 'left-indent input-extra-large', + prompt: _('Please select one')) + %>
diff --git a/app/views/plans/_edit_details.html.erb b/app/views/plans/_edit_details.html.erb index 09961ca..6a7afd6 100644 --- a/app/views/plans/_edit_details.html.erb +++ b/app/views/plans/_edit_details.html.erb @@ -67,7 +67,7 @@
- + <%= f.label(:data_contact, raw("#{_('Data Contact Person')}"), class: 'no-colon') %>
/> @@ -88,7 +88,8 @@

- +
 
+ <%= submit_tag(_('Save'), class: 'form-submit') %>
diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb index acd9b91..b336152 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -15,14 +15,11 @@ <%= _('What research project are you planning?') %>
- - - - + <%= f.text_field(:title, class: 'left-indent', + 'data-toggle': 'tooltip', + 'data-content': _('If applying for funding, state the project title exactly as in the proposal.')) %> + <%= check_box_tag(:is_test, "1", false, class: 'left-indent') %> + <%= label_tag(:is_test, _('mock project for testing, practice, or educational purposes'), class: 'inline checkbox-label') %>
@@ -42,12 +39,12 @@

- <%= _('or') %> -

- - + <%= check_box_tag(:plan_no_org) %> + <%= label_tag(:plan_no_org, raw(" + #{_('My research organisation is not on the list')} + #{_(' or ')} + #{_('no research organisation is associated with this plan')} + "), class: 'checkbox-label') %>
@@ -67,10 +64,8 @@

- <%= _('or') %> -

- - + <%= check_box_tag(:plan_no_funder) %> + <%= label_tag(:plan_no_funder, _('No funder associated with this plan'), class: 'checkbox-label') %>
@@ -82,9 +77,8 @@
- - - + <%= f.hidden_field(:template_id) %> + <%= f.hidden_field(:visibility, value: @is_test ? 'is_test' : Rails.application.config.default_plan_visibility) %> <%= render partial: 'shared/accessible_submit_button', locals: {id: 'create_plan_submit', val: 'Create Plan', diff --git a/app/views/questions/_add_question.html.erb b/app/views/questions/_add_question.html.erb index 35a70fe..6903424 100644 --- a/app/views/questions/_add_question.html.erb +++ b/app/views/questions/_add_question.html.erb @@ -171,9 +171,9 @@
<%= hidden_field_tag :section_id, section.id, class: "section_id" %> - <%= f.submit _('Save'), class: "btn btn-primary new_question_save_button" %> + <%= f.submit _('Save'), class: "btn btn-primary new_question_save_button", role:'button' %> <%= hidden_field_tag :section_id, section.id, class: "section_id_new" %> - <%= link_to _('Cancel'), '#', class: "btn cancel cancel_add_new_question" %> + <%= link_to _('Cancel'), '#', class: "btn cancel cancel_add_new_question", role: 'button' %>
diff --git a/app/views/questions/_edit_question.html.erb b/app/views/questions/_edit_question.html.erb index a37a2d5..154a500 100644 --- a/app/views/questions/_edit_question.html.erb +++ b/app/views/questions/_edit_question.html.erb @@ -175,13 +175,13 @@
- <%= f.submit _('Save'), class: "btn btn-primary" %> + <%= f.submit _('Save'), class: "btn btn-primary", role:'button' %> <% if !question.section.phase.template.published? %> <%= link_to _('Delete'), admin_destroy_question_path(question_id: question.id), - confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary"%> + confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role:'button'%> <% end %> <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question" %> + <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question", role:'button' %>
diff --git a/app/views/questions/_preview_question.html.erb b/app/views/questions/_preview_question.html.erb index d4a709c..625cc84 100644 --- a/app/views/questions/_preview_question.html.erb +++ b/app/views/questions/_preview_question.html.erb @@ -3,15 +3,15 @@
- <% q_format = question.question_format%> + <% q_format = question.question_format %>
- <% if q_format.title == _('Check box') || q_format.title == _('Multi select box') || q_format.title == _('Radio buttons') || q_format.title == _('Dropdown') %> + <% if q_format.option_based? %> <% options = question.question_options.order("number") %> - <% if q_format.title == _('Check box') %> + <% if q_format.checkbox? %> <%if !options.nil? %>
@@ -23,7 +23,7 @@
<% end %> - <% elsif q_format.title == _('Multi select box') %> + <% elsif q_format.multiselectbox? %> <% if !options.nil? %> <% end %> - <% elsif q_format.title == _('Radio buttons') %> + <% elsif q_format.radiobuttons? %> <% if !options.nil? %>
@@ -45,7 +45,7 @@
<% end %> - <% elsif q_format.title == _('Dropdown') %> + <% elsif q_format.dropdown? %> <% if !options.nil? %>
- - + <%= f.label(:email, _('Email'), class: 'required') %> + <%= f.email_field(:email, class: 'left-indent required') %>
@@ -34,14 +34,13 @@
- - + <%= f.label(:password, _('Password'), class: 'required') %> + <%= f.password_field(:password, class: 'left-indent required') %>
- - + <%= label_tag(:password_show, _('Show password'), class: 'checkbox-label') %> + <%= check_box_tag(:password_show, "1", false) %>
diff --git a/app/views/shared/_register_form.html.erb b/app/views/shared/_register_form.html.erb index 675d540..081a0a4 100644 --- a/app/views/shared/_register_form.html.erb +++ b/app/views/shared/_register_form.html.erb @@ -4,23 +4,21 @@
- - + <%= f.label(:firstname, _('First Name'), class: 'required') %> + <%= f.text_field(:firstname, class: 'input-small required left-indent') %>
- - + <%= f.label(:surname, _('Last Name'), class: 'required') %> + <%= f.text_field(:surname, class: 'input-small required left-indent') %>
- - + <%= f.label(:email, _('Email'), class: 'required') %> + <%= f.email_field(:email, class: 'left-indent required') %>
@@ -38,31 +36,31 @@
- - + <%= f.label(:recovery_email, _('Recovery Email'), class: 'required') %> + <%= f.email_field(:recovery_email, + class: 'left-indent required', + title: _('We will only use this address to recover your account if you change institutions')) %>
- - + <%= f.label(:password, _('Password'), class: 'required') %> + <%= f.password_field(:password, class: 'left-indent required') %>
- - + <%= label_tag(:password_show, _('Show password'), class: 'checkbox-label') %> + <%= check_box_tag(:password_show, "1", false) %>
- - + <%= f.check_box(:accept_terms, class: 'required right-indent') %> + <%= f.label(:accept_terms, + raw("#{_('I accept the')} #{_('terms and conditions')}"), + class: 'no-colon') %>
diff --git a/app/views/templates/_edit_annotations.html.erb b/app/views/templates/_edit_annotations.html.erb index 03ad822..52a84a5 100644 --- a/app/views/templates/_edit_annotations.html.erb +++ b/app/views/templates/_edit_annotations.html.erb @@ -88,13 +88,13 @@
- <%= f.submit _('Save'), class: "btn btn-primary" %> + <%= f.submit _('Save'), class: "btn btn-primary", role:"button" %> <% if !question.section.phase.template.published? %> <%= link_to _('Delete'), admin_destroy_question_path(question_id: question.id), - confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary"%> + confirm: _("You are about to delete '%{question_text}'. Are you sure?") % { :question_text => question.text }, method: :delete, class: "btn btn-primary", role:"button"%> <% end %> <%= hidden_field_tag :question_id, question.id, class: "question_id" %> - <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question" %> + <%= link_to _('Cancel'), "#", class: "btn cancel cancel_edit_question", role:"button" %>
diff --git a/app/views/templates/_edit_template.html.erb b/app/views/templates/_edit_template.html.erb index 1037259..d3a8366 100644 --- a/app/views/templates/_edit_template.html.erb +++ b/app/views/templates/_edit_template.html.erb @@ -18,7 +18,7 @@
- + <%= label_tag(:status, _('Status')) %>
<% if hash[:live].nil? %> <%= _('Unpublished') %> @@ -32,13 +32,13 @@
- + <%= label_tag(:created, _('Created at')) %>
<%= l template.created_at.to_date, formats: :short %>
- + <%= label_tag(:updated, _('Last updated')) %>
<%= l template.updated_at.to_date, formats: :short %>
diff --git a/app/views/templates/admin_new.html.erb b/app/views/templates/admin_new.html.erb index c7f63df..0f5cacc 100644 --- a/app/views/templates/admin_new.html.erb +++ b/app/views/templates/admin_new.html.erb @@ -39,8 +39,8 @@
- <%= f.submit _('Save'), class: "btn btn-primary" %> - <%= link_to _('Cancel'), admin_index_template_path, class: "btn cancel" %> + <%= f.submit _('Save'), class: "btn btn-primary", role:"button" %> + <%= link_to _('Cancel'), admin_index_template_path, class: "btn cancel", role:"button" %>

<% end %> diff --git a/app/views/users/_notification_preferences.html.erb b/app/views/users/_notification_preferences.html.erb index 81a3c58..819240d 100644 --- a/app/views/users/_notification_preferences.html.erb +++ b/app/views/users/_notification_preferences.html.erb @@ -48,7 +48,7 @@
 
- <%= submit_tag 'Save', class: 'btn btn-primary' %> + <%= submit_tag 'Save', class: 'btn btn-primary', role: 'button' %>
<% end %>
diff --git a/lib/assets/stylesheets/dmproadmap/base.scss b/lib/assets/stylesheets/dmproadmap/base.scss index e47102d..10dd8b2 100644 --- a/lib/assets/stylesheets/dmproadmap/base.scss +++ b/lib/assets/stylesheets/dmproadmap/base.scss @@ -21,7 +21,10 @@ color: $primary-color; } -h1 { font-size: 40px; } +h1 { + width: 65%; + font-size: 40px; +} h2 { font-size: 32px; } h3 { font-size: 26px; } h4 { font-size: 20px; }