diff --git a/app/views/contact_us/contacts/new.html.erb b/app/views/contact_us/contacts/new.html.erb index 57596a5..5204126 100644 --- a/app/views/contact_us/contacts/new.html.erb +++ b/app/views/contact_us/contacts/new.html.erb @@ -4,119 +4,106 @@ };

- <%= t("contact_page.title") %> + <%= _("Contact Us") %>

- <%= raw t("contact_page.intro_text_html", - organisation_name: Rails.configuration.branding[:organisation][:name], - organisation_email: Rails.configuration.branding[:organisation][:email], - organisation_url: Rails.configuration.branding[:organisation][:url], - application_name: Rails.configuration.branding[:application][:name], - application_url: Rails.configuration.branding[:application][:url], - application_issue_list_url: Rails.configuration.branding[:application][:issue_list_url]) %> - <%= raw t("contact_page.github_text_html") %> + <%= raw _('%{application_name} is provided by the %{organisation_name}. You can find out more about us on our website. If you would like to contact us about %{application_name}, please fill out the form below.') % {organisation_name: Rails.configuration.branding[:organisation][:name], + organisation_url: Rails.configuration.branding[:organisation][:url], + application_name: Rails.configuration.branding[:application][:name]} %>

- -
-
- <%= form_for @contact, :url => contacts_path do |f| %> -
- - <% if ContactUs.require_name %> - - - - - <% end %> - - - - - <% if ContactUs.require_subject %> - - - - - <% end %> - - - - - <% if !user_signed_in? then %> - - - - - <% end %> -
- <%= f.label :name, (t('.name') + content_tag(:abbr, "*", :class => "required")).html_safe %> - - <% if user_signed_in? then %> - <%= f.text_field :name, :value => current_user.name(false) %> - <% else %> - <%= f.text_field :name %> - <% end %> - <% if f.object.errors[:name].present? %> -

<%= f.object.errors[:name].join(" and ") %>

- <% end %> -
- <%= f.label :email, (t('.email') + content_tag(:abbr, "*", :class => "required")).html_safe %> - - <% if user_signed_in? then %> - <%= f.email_field :email, :value => current_user.email %> - <% else %> - <%= f.email_field :email %> - <% end %> - <% if f.object.errors[:email].present? %> -

<%= f.object.errors[:email].join(" and ") %>

- <% end %> -
- <%= f.label :subject, (t('.subject') + content_tag(:abbr, "*", :class => "required")).html_safe %> - - <%= f.text_field :subject %> - <% if f.object.errors[:subject].present? %> -

<%= f.object.errors[:subject].join(" and ") %>

- <% end %> -
- <%= f.label :message, (t('.message') + content_tag(:abbr, "*", :class => "required")).html_safe %> - - <%= f.text_area :message, :rows => 10 %> - <% if f.object.errors[:message].present? %> -

<%= f.object.errors[:message].join(" and ") %>

- <% end %> -
- <%= t('helpers.security_check') %> - - <%= recaptcha_tags %> -
-
-
- <%= f.submit :submit, :class => "btn btn-primary", :label => t('.submit') %> -
- <% end %> -
-
- - -
-
- <%= raw t("contact_page.address_text_html", - organisation_name: Rails.configuration.branding[:organisation][:name], - organisation_email: Rails.configuration.branding[:organisation][:email], - application_name: Rails.configuration.branding[:application][:name], - organisation_telephone: Rails.configuration.branding[:organisation][:telephone], - organisation_address_line1: Rails.configuration.branding[:organisation][:address_line1], - organisation_address_line2: Rails.configuration.branding[:organisation][:address_line2], - organisation_address_line3: Rails.configuration.branding[:organisation][:address_line3], - organisation_address_line4: Rails.configuration.branding[:organisation][:address_line4], - organisation_address_country: Rails.configuration.branding[:organisation][:address_country]) %> - -
- + +
+
+ <%= form_for @contact, :url => contacts_path do |f| %> +
+
+ <% if ContactUs.require_name %> +
+ <%= f.label :name, (_('Name') + content_tag(:abbr, "*", class: "required")).html_safe %> + <% if user_signed_in? then %> + <%= f.text_field :name, value: current_user.name(false) %> + <% else %> + <%= f.text_field :name %> + <% end %> + <% if f.object.errors[:name].present? %> +

<%= f.object.errors[:name].join(_(" and ")) %>

+ <% end %> +
+ <% end %> + +
+ <%= f.label :email, (_('Email') + content_tag(:abbr, "*", class: "required")).html_safe %> + <% if user_signed_in? then %> + <%= f.email_field :email, value: current_user.email %> + <% else %> + <%= f.email_field :email %> + <% end %> + <% if f.object.errors[:email].present? %> +

<%= f.object.errors[:email].join(_(" and ")) %>

+ <% end %> +
+ + <% if ContactUs.require_subject %> +
+ <%= f.label :subject, (_('Subject') + content_tag(:abbr, "*", class: "required")).html_safe %> + <%= f.text_field :subject %> + <% if f.object.errors[:subject].present? %> +

<%= f.object.errors[:subject].join(_(" and ")) %>

+ <% end %> +
+ <% end %> + +
+ <%= f.label :message, (_('Message') + content_tag(:abbr, "*", class: "required")).html_safe %> + <%= f.text_area :message, rows: 10, class: "input-large" %> + <% if f.object.errors[:message].present? %> +

<%= f.object.errors[:message].join(_(" and ")) %>

+ <% end %> +
+ + <% if !user_signed_in? then %> +
+ <%= t('helpers.security_check') %> + <%= recaptcha_tags %> +
+ <% end %> +
+
+ +
+ + <% end %> +
+
+ + +
+
+ <%= raw _("
  • %{organisation_name}
  • +
  • %{organisation_address_line1}
  • +
  • %{organisation_address_line2}
  • +
  • %{organisation_address_line3}
  • +
  • %{organisation_address_line4}
  • +
  • %{organisation_address_country}
  • +
+

Helpline: %{organisation_telephone}

+

Email %{organisation_email}

") % + { organisation_name: Rails.configuration.branding[:organisation][:name], + organisation_address_line1: Rails.configuration.branding[:organisation][:address_line1], + organisation_address_line2: Rails.configuration.branding[:organisation][:address_line2], + organisation_address_line3: Rails.configuration.branding[:organisation][:address_line3], + organisation_address_line4: Rails.configuration.branding[:organisation][:address_line4], + organisation_address_country: Rails.configuration.branding[:organisation][:address_country], + organisation_telephone: Rails.configuration.branding[:organisation][:telephone], + organisation_email: Rails.configuration.branding[:organisation][:email], + application_name: Rails.configuration.branding[:application][:name]} %> + +
+ -
-
-
- +
+
+
+
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 435b117..3b38eaf 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -5,104 +5,129 @@ <%= _("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| %> -
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, class: "side-by-side"}) do |f| %> +
-
-

<%= _('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" %> - <%= f.label :email, _('Email') + " *" %> - <%= f.email_field :email, as: :email, class: "left-indent input-medium" %> -
<%= _('Please enter your current password below when changing your email address.') %>
+
+ <%= f.label :email, _('Email') + " *" %> + <%= f.email_field :email, as: :email, class: "left-indent input-medium has-tooltip", + "data-toggle": "tooltip", "data-trigger": "focus", + "title": _('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: "left-indent input-medium has-tooltip", + "data-toggle" => "tooltip", + "data-trigger" => "focus" , + "title" => _('Please enter your first name.') %> +
+
+ <%= f.label :surname, _('Last name') + " *" %> + <%= f.text_field :surname, as: :string, id: "first_time_login_surname", + class: "left-indent input-medium 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', + classes: 'input-large indent-left'} %> +
-
- - <%= f.label :firstname, _('First name')+ " *" %> - <%= f.text_field :firstname, as: :string, - id: "first_time_login_firstname", - autofocus: true, - class: "left-indent input-medium has-tooltip", - "data-toggle" => "tooltip", - "data-trigger" => "focus" , - "title" => _('Please enter your first name.') %> - - <%= f.label :surname, _('Last name') + " *" %> - <%= f.text_field :surname, as: :string, id: "first_time_login_surname", - class: "left-indent input-medium 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', - classes: 'input-large'} %> - <% if MANY_LANGUAGES %> - <% lang = current_user.language.nil? ? FastGettext.default_locale : current_user.language.abbreviation %> - <%= f.label :language, _('Language') %> - +
+ <% 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)} %> +
+ +
+ <%= render partial: 'external_identifier', + locals: {scheme: scheme, + id: current_user.identifier_for(scheme)} %> +
<% 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 %> +
+ + <% 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 %>
+
+ <%= f.label :api_token, _('API token') %> +
<%= @user.api_token %>
- -
<%= link_to( _('How to use the API'), controller: "token_permission_types", action: "index")%>
+ +
<%= 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.') %>

+ <%= _('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: 'left-indent input-medium' %> +
+ <%= f.label :current_password, _('Current password') %> + <%= f.password_field :current_password, as: :password, class: 'left-indent input-medium' %> +
- <%= f.label :password, _('New password') %> - <%= f.password_field :password, as: :password, autocomplete: "off", class: 'left-indent input-medium' %> +
+ <%= f.label :password, _('New password') %> + <%= f.password_field :password, as: :password, autocomplete: "off", class: 'left-indent input-medium' %> +
- <%= f.label :password_confirmation, _('Password confirmation') %> - <%= f.password_field :password_confirmation, as: :password, autocomplete: "off", - class: 'left-indent input-medium' %> +
+ <%= f.label :password_confirmation, _('Password confirmation') %> + <%= f.password_field :password_confirmation, as: :password, autocomplete: "off", + class: 'left-indent input-medium' %> +
+
+
+ +
+ + + +
- - + <% end %>
diff --git a/app/views/phases/_add_note.html.erb b/app/views/phases/_add_note.html.erb index bcfcab7..c8063f8 100644 --- a/app/views/phases/_add_note.html.erb +++ b/app/views/phases/_add_note.html.erb @@ -16,13 +16,16 @@ <%= f.hidden_field :answer_id, value: answer.id %> <%= f.hidden_field :plan_id, value: plan_id %> - <%= text_area_tag "#{questionid}new_note_text", nil, class: "tinymce" %> - <%= tinymce :content_css => asset_path("application.css"), :setup => "function(editor){editor.on('change', function(e){$.fn.check_textarea(editor)});}" %> +
+ <%= label_tag "#{questionid}new_note_text", _('Share note with collaborators') %> + <%= text_area_tag "#{questionid}new_note_text", nil, class: "tinymce" %> + <%= tinymce :content_css => asset_path("application.css"), :setup => "function(editor){editor.on('change', function(e){$.fn.check_textarea(editor)});}" %> +
+
-
- <%= f.submit _('Save'), class: "btn btn-primary new_comment_submit_button" %> + <%= f.submit _('Save'), class: "form-submit inline new_comment_submit_button" %>

<% end %> diff --git a/app/views/phases/_answer_form.html.erb b/app/views/phases/_answer_form.html.erb index e14ec26..c0bc699 100644 --- a/app/views/phases/_answer_form.html.erb +++ b/app/views/phases/_answer_form.html.erb @@ -19,12 +19,12 @@ %>
- <%= semantic_form_for answer, :url => {:controller => :answers, :action => :update }, method: "put", :remote => true do |f| %> - <%= f.inputs do %> - <%= f.input :id, :as => :hidden, :input_html => { :value => answer.id } %> - <%= f.input :plan_id, :as => :hidden, :input_html => { :value => @plan.id } %> - <%= f.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> - <%= f.input :question_id, :as => :hidden, :input_html => { :value => question_id, :class => "question_id" } %> + <%= semantic_form_for answer, :url => {controller: :answers, action: :update }, method: "put", remote: true do |f| %> +
+ <%= f.input :id, as: :hidden, input_html: { value: answer.id } %> + <%= f.input :plan_id, as: :hidden, input_html: { value: @plan.id } %> + <%= f.input :user_id, as: :hidden, input_html: { value: current_user.id } %> + <%= f.input :question_id, as: :hidden, input_html: { value: question_id, class: "question_id" } %> <%= f.hidden_field :lock_version, id: "answer_lock_version-#{question_id}" %> @@ -62,23 +62,23 @@ <% if q_format.checkbox? %> - <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, :input_html => { :id => "options-#{question.id}" } %> + <%= f.input :options, as: :check_boxes, collection: options, label: false, input_html: { id: "options-#{question.id}" } %> <% elsif q_format.multiselectbox? %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true , :id => "options-#{question.id}" } %> + <%= f.input :options, as: :select, collection: options, label: false, input_html: { multiple: true , id: "options-#{question.id}" } %> <% elsif q_format.radiobuttons? %>
    <% options.each do |op| %>
  1. <% if answer.question_option_ids[0] == op.id then%> - <%= f.radio_button :option_ids, op.id, :checked => true, id: "answer_option_ids_#{op.id}"%> + <%= f.radio_button :option_ids, op.id, checked: true, id: "answer_option_ids_#{op.id}"%> <%else%> - <%= f.radio_button :option_ids, op.id, :checked => false, id: "answer_option_ids_#{op.id}"%> + <%= f.radio_button :option_ids, op.id, checked: false, id: "answer_option_ids_#{op.id}"%> <% end %> <%= raw op.text %>
  2. <% end %>
<% elsif q_format.dropdown? %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => false, :id => "options-#{question.id}" } %> + <%= f.input :options, as: :select, collection: options, label: false, input_html: { multiple: false, id: "options-#{question.id}" } %> <% end %> @@ -95,13 +95,12 @@ <%= text_area_tag("answer-text-#{question_id}".to_sym, answer.text, class: "tinymce") %> <% end %> - <% end %> +
- - <%= f.actions do %> - <%= f.action :submit, :label => _('Save'), :button_html => { :class => "btn btn-primary"} %> - - <% end %> +
+ + + <% end %>
@@ -119,14 +118,14 @@
<% comments = answer.notes.all %> - <%= hidden_field_tag :question_id, question_id, :class => "question_id" %> + <%= hidden_field_tag :question_id, question_id, class: "question_id" %>
diff --git a/app/views/phases/_edit_note.html.erb b/app/views/phases/_edit_note.html.erb index b0a7bdf..5a45c88 100644 --- a/app/views/phases/_edit_note.html.erb +++ b/app/views/phases/_edit_note.html.erb @@ -14,7 +14,7 @@
- <%= f.submit _('Save'), :class => "btn btn-primary edit_note_submit_button" %> + <%= f.submit _('Save'), :class => "form-submit inline edit_note_submit_button" %>

<%end%> diff --git a/app/views/phases/_note.html.erb b/app/views/phases/_note.html.erb index 95d38ec..5cc8df3 100644 --- a/app/views/phases/_note.html.erb +++ b/app/views/phases/_note.html.erb @@ -28,6 +28,5 @@ <%= render :partial => "/phases/add_note", locals: {answer: answer, question: question, plan_id: plan.id }%> <% else%> - <%= _('Share note with collaborators')%> <%= render :partial => "/phases/add_note", locals: {answer: answer, question: question, plan_id: plan.id }%> <% end%> diff --git a/app/views/plans/_answer_form.html.erb b/app/views/plans/_answer_form.html.erb deleted file mode 100644 index 1d17c20..0000000 --- a/app/views/plans/_answer_form.html.erb +++ /dev/null @@ -1,260 +0,0 @@ - -<% answer = @plan.answer(question.id) %> - -
- - <% q_format = question.question_format%> - - <% if readonly != "always" then %> -
> - <%= semantic_form_for answer, :url => {:controller => :answers, :action => :create }, :html=>{:method=>:post}, :remote => true do |f| %> - <%= f.inputs do %> - <%= f.input :plan_id, :as => :hidden %> - <%= f.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> - <%= f.input :question_id, :as => :hidden, :input_html => { :class => "question_id" } %> - - - - <%= raw question.text %> - - - <% suggested_answer = question.suggested_answers.find_by_organisation_id(@plan.project.organisation_id) %> - <% if !suggested_answer.nil? && suggested_answer.text != "" then %> -
- - <% if suggested_answer.is_example? then %> - <%= _('Example of answer')%> - <%else%> - <%= _('Suggested answer')%> - <%end%> - -
-

- <%= raw suggested_answer.text %> -

-
-
- <% end %> - - - <% if q_format.title == "Check box" || - q_format.title == "Multi select box" || - q_format.title == "Radio buttons" || - q_format.title == "Dropdown" then%> - <% options = question.options.order("number") %> - - <% if q_format.title == "Check box" then %> - <% if readonly then %> - <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, input_html => { :disabled => true, :id => "options-#{question.id}" } %> - <% else %> - <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, :input_html => { :id => "options-#{question.id}" } %> - <% end %> - - <% elsif q_format.title == "Multi select box" then %> - <% if readonly then %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true, :disabled => true , :id => "options-#{question.id}" } %> - <% else %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true , :id => "options-#{question.id}" } %> - <% end %> - - <% elsif q_format.title == "Radio buttons" then%> -
    - <% options.each do |op| %> -
  1. - <% if answer.option_ids[0] == op.id then%> - <% if readonly then %> - <%= f.radio_button :option_ids, op.id, :checked => true, disabled: true, id: "answer_option_ids_#{op.id}"%> - <% else %> - <%= f.radio_button :option_ids, op.id, :checked => true, id: "answer_option_ids_#{op.id}"%> - <% end %> - <%else%> - <% if readonly then %> - <%= f.radio_button :option_ids, op.id, :checked => false, disabled: true, id: "answer_option_ids_#{op.id}"%> - <% else %> - <%= f.radio_button :option_ids, op.id, :checked => false, id: "answer_option_ids_#{op.id}"%> - <% end %> - <% end %> - <%= op.text %>
  2. - <% end %> -
- - <% elsif q_format.title == "Dropdown" then%> - <% if readonly then %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => false, :disabled => true, :id => "options-#{question.id}" } %> - <% else %> - <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => false, :id => "options-#{question.id}" } %> - <% end %> - <% end %> - - <% if question.option_comment_display == true then%> - <%= label_tag("answer-text-#{question.id}".to_sym, _('Comment')) %> - <%= text_area_tag("answer-text-#{question.id}".to_sym, answer.text, class: "tinymce") %> - <%end%> - - - <% elsif q_format.title == "Text field" then %> - <%= text_field_tag("answer-text-#{question.id}".to_sym, strip_tags(answer.text), class: "question_text_field") %> - - <% elsif q_format.title == "Text area" then%> - <%= text_area_tag("answer-text-#{question.id}".to_sym, answer.text, class: "tinymce") %> - <% end %> - - <% end %> - - - <%= f.actions do %> - <% if readonly then %> - <%= f.action :submit, :label => _('Save'), :button_html => { :class => "btn btn-primary"}, :input_html => { :disabled => true } %> - <% else %> - - - <% end %> - - <% end %> - <% end %> -
- <% end %> - -
> -

<%= question.text %>

-
- <% if q_format.title == "Check box" || - q_format.title == "Multi select box" || - q_format.title == "Radio buttons" || - q_format.title == "Dropdown" %> -
    - <% if answer.options.is_a? Option then %> -
  • <%= answer.options.text %>
  • - <% else %> - <% answer.options.each do |o| %> -
  • <%= o.text %>
  • - <% end %> - <% end %> -
- <% end %> -
- <%= raw answer.text %> -
-
-
- <% if answer.created_at.nil? then %> - <%= _('Not answered yet') %> - <% else %> - <%= _('Answered')%><%= answer.created_at %><%= _(' by')%><%= answer.user.name %> - <% end %> - -
- - - -
-
- <% @comments = Comment.where("question_id = ? AND plan_id = ?", question.id, answer.plan_id ) %> - <%= hidden_field_tag :question_id, question.id, :class => "question_id" %> - <% @question_guidances = @plan.guidance_for_question(question) %> - -
- - - -
-
- - <% if !question.guidance.nil? && question.guidance != "" then %> - - <% end %> - - <% @question_guidances.each_pair do |group,themes| %> - <% themes.each_pair do |theme,guidances| %> - <% guidances.each do |guidance| %> - - <% end %> - <% end %> - <% end %> -
-
- - -
- <%= render :partial => "comments", locals: {questionId: question.id, plan_id: answer.plan_id }%> -
- - - -
- -<% if last_question_id == question.id then %> -
-<% else %> -
-<% end %> diff --git a/app/views/plans/_answer_form_ro.html.erb b/app/views/plans/_answer_form_ro.html.erb deleted file mode 100644 index c2837a9..0000000 --- a/app/views/plans/_answer_form_ro.html.erb +++ /dev/null @@ -1,51 +0,0 @@ - -<% answer = @plan.answer(question.id) %> - -
- - <% q_format = question.question_format%> - -
-

<%= question.text %>

- -
- <% if q_format.title == "Check box" || q_format.title == "Multi select box" || - q_format.title == "Radio buttons" || q_format.title == "Dropdown" %> -
    - <% if answer.question_options.is_a? Array then %> -
  • <%= answer.question_options.text %>
  • - <% else %> - <% answer.question_options.each do |o| %> -
  • <%= o.text %>
  • - <% end %> - <% end %> -
- <% end %> - -
- <%= raw answer.text %> -
-
-
- - <% if answer.created_at.nil? then %> - <%= _('Not answered yet') %> - <% else %> - <%= _('Answered')%><%= answer.created_at %><%= _(' by')%><%= answer.user.name %> - <% end %> - - - -
- - -<% if last_question_id == question.id then %> -
-<% else %> -
-<% end %> diff --git a/app/views/plans/_dropdowns_new_plan.html.erb b/app/views/plans/_dropdowns_new_plan.html.erb deleted file mode 100644 index c7e9d7e..0000000 --- a/app/views/plans/_dropdowns_new_plan.html.erb +++ /dev/null @@ -1,41 +0,0 @@ - - -<%= semantic_form_for @plan, url: plans_path(@plan) do |f| %> - <%= f.inputs do %> - <%= hidden_field_tag :default_tag, "false" ,:id => "default_tag" %> -
- -

<%= _('Create a new plan') %>

-
-

<%= raw _("

Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.

")%>

-
- - - - <% end %> - - - <%= f.actions do %> - <%= f.action :submit, - :as => :button, - :input_html => { :id => "create-plan-button", :class => "btn btn-primary"}, - :label => _('Create plan') %> - <% end %> - -<% end %> diff --git a/app/views/plans/_plan_details.html.erb b/app/views/plans/_plan_details.html.erb index c1220b4..81d2f2d 100644 --- a/app/views/plans/_plan_details.html.erb +++ b/app/views/plans/_plan_details.html.erb @@ -10,58 +10,61 @@
"> <%= form_for @plan, url: {controller: :plans, action: :update }, - html: {method: :put, class: "side-by-side"} do |f| %> + html: {method: :put, class: "side-by-side"} do |f| %>
-
-

<%= _('Please fill in the basic project details below') %>

- -
- <%= f.label :title, _('Plan name') %> - <%= f.text_field :title, class: "left-indent input-large has-tooltip", 'data-toggle': "tooltip", - 'title': _('If applying for funding, state the name exactly as in the grant proposal.') %> -
-
- <%= f.label :identifier, _('ID') %> - <%= f.text_field :identifier, class: 'left-indent input-medium has-tooltip', 'data-toggle': "tooltip", - 'title': _('A pertinent ID as determined by the funder and/or institution.') %> -
-
- <%= f.label :grant_number, _('Grant number') %> - <%= f.text_field :grant_number, class: 'tleft-indent input-medium has-tooltip', - 'data-toggle': "tooltip", - 'title': _('Grant reference number if applicable [POST-AWARD DMPs ONLY]') %> -
-
- <%= f.label :principal_investigator, _('Principal Investigator/Researcher') %> - <%= f.text_field :principal_investigator, class: 'left-indent input-medium has-tooltip', - 'data-toggle': "tooltip", - 'title': _('Name of Principal Investigator(s) or main researcher(s) on the project.') %> -
-
- <%= f.label :principal_investigator_identifier, _('Principal Investigator/Researcher ID') %> - <%= f.text_field :principal_investigator_identifier, class: 'left-indent input-medium has-tooltip', - 'data-toggle': "tooltip", 'title': _('E.g ORCID http://orcid.org/.') %> -
-
- <%= f.label :data_contact, _('Plan data contact') %> - <%= f.text_field :data_contact, class: 'left-indent input-medium has-tooltip', - 'data-toggle': "tooltip", - 'title': _('Name (if different to above), telephone and email contact details') %> -
-
- <%= f.label :description, _('Description') %> - <%= f.text_area :description, { rows: 7, class: 'left-indent input-large has-tooltip', - 'data-toggle': "tooltip", 'data-html': "true", - 'title': _("

Questions to consider:

  • - What is the nature of your research project?
  • - What research questions are you addressing?
  • - For what purpose are the data being collected or created?

Guidance:

Briefly summarise the type of study (or studies) to help others understand the purposes for which the data are being collected or created.

")} %> -
-
+
+ <%= _('Please fill in the basic project details below') %> + +
+ <%= f.label :title, _('Plan name') %> + <%= f.text_field :title, class: "left-indent input-large has-tooltip", 'data-toggle': "tooltip", + 'title': _('If applying for funding, state the name exactly as in the grant proposal.') %> +
+
+ <%= f.label :identifier, _('ID') %> + <%= f.text_field :identifier, class: 'left-indent input-medium has-tooltip', 'data-toggle': "tooltip", + 'title': _('A pertinent ID as determined by the funder and/or institution.') %> +
+
+ <%= f.label :grant_number, _('Grant number') %> + <%= f.text_field :grant_number, class: 'left-indent input-medium has-tooltip', + 'data-toggle': "tooltip", + 'title': _('Grant reference number if applicable [POST-AWARD DMPs ONLY]') %> +
+
+ <%= f.label :principal_investigator, _('Principal Investigator/Researcher') %> + <%= f.text_field :principal_investigator, class: 'left-indent input-medium has-tooltip', + 'data-toggle': "tooltip", + 'title': _('Name of Principal Investigator(s) or main researcher(s) on the project.') %> +
+
+ <%= f.label :principal_investigator_identifier, _('Principal Investigator/Researcher ID') %> + <%= f.text_field :principal_investigator_identifier, class: 'left-indent input-medium has-tooltip', + 'data-toggle': "tooltip", 'title': _('E.g ORCID http://orcid.org/.') %> +
+
+ <%= f.label :data_contact, _('Plan data contact') %> + <%= f.text_field :data_contact, class: 'left-indent input-medium has-tooltip', + 'data-toggle': "tooltip", + 'title': _('Name (if different to above), telephone and email contact details') %> +
+
+ <%= f.label :description, _('Description') %> + <%= f.text_area :description, { rows: 7, class: 'left-indent input-large has-tooltip', + 'data-toggle': "tooltip", 'data-html': "true", + 'title': _("

Questions to consider:

  • - What is the nature of your research project?
  • - What research questions are you addressing?
  • - For what purpose are the data being collected or created?

Guidance:

Briefly summarise the type of study (or studies) to help others understand the purposes for which the data are being collected or created.

")} %> +
+ +
+
+ + +
+
- -
- - + <%end%>
diff --git a/app/views/plans/share.html.erb b/app/views/plans/share.html.erb index bf8837b..3dd23ad 100644 --- a/app/views/plans/share.html.erb +++ b/app/views/plans/share.html.erb @@ -8,67 +8,82 @@
- - <%= raw _('

You can give other people access to your plan here. There are three permission levels.

Add each collaborator in turn by entering their email address below, choosing a permission level and clicking "Add collaborator".

Those you invite will receive an email notification that they have access to this plan, inviting them to register with %{application_name} if they don\'t already have an account. A notification is also issued when a user\'s permission level is changed.

') % { application_name: Rails.configuration.branding[:application][:name] } %> + + <%= raw _('

You can give other people access to your plan here. There are three permission levels.

Add each collaborator in turn by entering their email address below, choosing a permission level and clicking "Add collaborator".

Those you invite will receive an email notification that they have access to this plan, inviting them to register with %{application_name} if they don\'t already have an account. A notification is also issued when a user\'s permission level is changed.

') % { application_name: Rails.configuration.branding[:application][:name] } %> -
-

<%= _('Collaborators')%>

-
- <% if @plan.roles.any? then %> +
+

<%= _('Collaborators')%>

+
+ <% if @plan.roles.any? then %> - - - - - - - - - - <% plan_roles = @plan.roles.all %> - <% plan_roles.each do |role| %> - - - - + <% end %> -

<%= _('Permissions')%>:

- <%= f.select :access_level, [[_('Co-owner'), 3], [ _('Editor') , 2], [ _('Read only'), 1]], {}, {:class => 'has-tooltip', 'data-toggle' => "tooltip", 'title' => _('Editors can contribute to plans. Co-owners have additional rights to edit plan details and control access.') } %> - <% end %> - <%= f.actions do %> - <%= f.action :submit, :label => _('Add collaborator'), :button_html => { :class => "btn btn-primary" } %> - <% end %> - <% end %> - - + +
<%= _('Email address')%><%= _('Permissions')%>
<%= role.user.name %> - <% if role.creator? then %> - <%= _('Owner')%> - <% else %> - <%= form_for role, :url => {:controller => :roles, :action => :update, :id => role.id }, :html=>{:method=>:put} do |f| %> - <%= f.select :access_level, {_('Co-owner') => 3, _('Editor') => 2, _('Read only') => 1}, {}, {:id => "#{role.id}-can-edit", :class => "toggle-existing-user-access has-tooltip", 'data-toggle' => "tooltip", 'title' => _('Editors can contribute to plans. Co-owners have additional rights to edit plan details and control access.') } %> - <% end %> - <% end %> - + + + + + + + + + + <% plan_roles = @plan.roles.all %> + <% plan_roles.each do |role| %> + + + + - - <% end %> - -
<%= _('Email address')%><%= _('Permissions')%>
<%= role.user.name %> + <% if role.creator? then %> + <%= _('Owner')%> + <% else %> + <%= form_for role, url: {controller: :roles, action: :update, id: role.id }, html: {method: :put} do |f| %> +
+ <%= f.select :access_level, {"#{_('Co-owner')}": 3, "#{_('Editor')}": 2, "#{_('Read only')}": 1}, {}, {id: "#{role.id}-can-edit", class: "toggle-existing-user-access has-tooltip", 'data-toggle': "tooltip", 'title': _('Editors can contribute to plans. Co-owners have additional rights to edit plan details and control access.') } %> +
+ <% end %> + <% end %> +
<% unless role.creator? || role.user == current_user then %> - <%= link_to _('Remove user access'), role, method: :delete, data: { confirm: _('Are you sure?') }, :class => "a-orange" %> - <% end %> -
- <% end %> - - -
-

<%= _('Add collaborator')%>

- -
- <% new_role = Role.new %> - <% new_role.plan = @plan %> - <%= semantic_form_for new_role, :url => {:controller => :roles, :action => :create }, :html=>{:method=>:post} do |f| %> - <%= f.inputs do %> - <%= f.input :plan_id, :as => :hidden %> - <%= f.semantic_fields_for :user do |user| %> - <%= user.email_field :email, :for => :user, :name => "user", :label => false, placeholder: _('Email') %> + <%= link_to _('Remove user access'), role, method: :delete, data: { confirm: _('Are you sure?') }, :class => "a-orange" %> + <% end %> +
+ <% end %> +
+ +
+ +
+ <% new_role = Role.new %> + <% new_role.plan = @plan %> + <%= form_for new_role, url: {controller: :roles, action: :create }, + html: {method: :post, class: 'side-by-side'} do |f| %> +
+
+ <%= _('Add collaborator') %> + + <%= f.hidden_field :plan_id %> + +
+ <%= f.fields_for :user do |user| %> + <%= user.label :email, _('Email') %> + <%= user.email_field :email, for: :user, name: "user", class: "left-indent" %> + <% end %> +
+
+ <%= f.label :access_level, _('Permissions') %> + <%= f.select :access_level, [[_('Co-owner'), 3], [ _('Editor') , 2], [ _('Read only'), 1]], {}, {class: 'has-tooltip left-indent', 'data-toggle': "tooltip", 'title': _('Editors can contribute to plans. Co-owners have additional rights to edit plan details and control access.') } %> +
+ +
+
+ +
+
+
+ + <% end %> +
+
diff --git a/app/views/shared/_export_links.html.erb b/app/views/shared/_export_links.html.erb index 6ce39cd..6908e62 100644 --- a/app/views/shared/_export_links.html.erb +++ b/app/views/shared/_export_links.html.erb @@ -1,12 +1,13 @@ <% javascript("export_configure") %>
- - <%= label_tag(:format, _('format')) %> + <%= label_tag(:format, _('Format')) %> <%= select_tag(:format, options_for_select(ExportedPlan::VALID_FORMATS, :pdf), class: 'export-format-selection') %> - + + +
-

Export Settings <%= plan_settings_indicator(plan) -%>

- <%= render(partial: "settings/phases/export_formatting_form", locals: { plan: plan, phase: phase }) %> +

Export Settings <%= plan_settings_indicator(plan) -%>

+ <%= render(partial: "settings/phases/export_formatting_form", locals: { plan: plan, phase: phase }) %>
diff --git a/lib/assets/javascripts/plans.js b/lib/assets/javascripts/plans.js index db33faa..1a690e4 100644 --- a/lib/assets/javascripts/plans.js +++ b/lib/assets/javascripts/plans.js @@ -119,7 +119,7 @@ $("form.answer").submit(function(){ var submit_button = $(this).find('input[type="submit"]'); var saving_message = $(this).find('.saving-message'); - submit_button.parent().hide(); + submit_button.hide(); q_id = $(this).find(".question_id").val(); saving_message.show(); s_status = $(this).closest(".accordion-group").find(".section-status:first"); diff --git a/lib/assets/stylesheets/dmproadmap.scss b/lib/assets/stylesheets/dmproadmap.scss index cba11dd..c533f67 100644 --- a/lib/assets/stylesheets/dmproadmap.scss +++ b/lib/assets/stylesheets/dmproadmap.scss @@ -27,6 +27,10 @@ width: 110px; } +.left-indent { + margin-left: 15px; +} + .arrow-left { display: inline-block; width: 0; @@ -40,6 +44,18 @@ margin-bottom: 20px; } +.content-box { + background-color: $white; + + padding: 20px 15px 35px 15px; + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +} + +/* Accessible Form Buttons */ +/* ------------------------------------------------------ */ input.form-submit { background-color: $primary-color; color: $reverse-text; @@ -50,11 +66,18 @@ -moz-border-radius: 10px; border-radius: 10px; } -input.form-submit:disabled { +input.form-submit[clickable='false'] { background-color: $disabled-button-color; } +input.form-submit:focus + [role="tooltip"] { + display: inline-block; +} +input.inline[type="submit"] { + font-size: 10pt; + padding: 5px 15px; +} button.form-cancel { - background-color: $cancel-button-color; + background-color: $cancel-button-color; color: $reverse-text; padding: 10px 30px; font-size: 12pt; @@ -63,7 +86,41 @@ -moz-border-radius: 10px; border-radius: 10px; } +.submit-tooltip { + display: none; + margin-left: 5px; + .arrow-left { + vertical-align: middle; + margin-right: -5px; + } + .submit-tooltip-msg { + color: $white; + background-color: $dark-grey; + padding: 5px 5px 8px 5px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + } +} + +/* Generic Fieldset Settings */ +/* ------------------------------------------------------ */ +fieldset legend { + font-family: $header-font; + color: $primary-color; + font-size: 26px; + font-weight: normal; + text-decoration: none; + + float: left; /* positions the legend within the fieldset box */ + padding-top: 20px; + border-bottom: none; +} + +/* Standard Form - Labels above Fields */ +/* ------------------------------------------------------ */ .main { form { .white-fieldset { @@ -75,18 +132,6 @@ -moz-border-radius: 10px; border-radius: 10px; - legend { - font-family: $header-font; - color: $primary-color; - font-size: 26px; - font-weight: normal; - text-decoration: none; - - float: left; /* positions the legend within the fieldset box */ - padding-top: 20px; - border-bottom: none; - } - label, input[type="checkbox"], .combobox-container, @@ -107,86 +152,62 @@ margin-left: 5px; } } - - input.form-submit { - background-color: $primary-color; - color: $reverse-text; - padding: 10px 30px; - font-size: 12pt; - - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; - } - input.form-submit[clickable='false'] { - background-color: $disabled-button-color; - } - - input.form-submit:focus + [role="tooltip"] { - display: inline-block; - } - - .submit-tooltip { - display: none; - margin-left: 5px; - - .arrow-left { - vertical-align: middle; - margin-right: -5px; - } - .submit-tooltip-msg { - color: $white; - background-color: $dark-grey; - padding: 5px 5px 8px 5px; - - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - } - } } } +/* Embedded Form - Labels to the left of fields */ +/* ------------------------------------------------------ */ form.side-by-side { - div { - fieldset { - div { - margin-left: 15px; - - label, - input[type="checkbox"], - .combobox-container, - .left-indent { - display: inline-block; - } + div { + fieldset { + div { + margin-left: 15px; + + label, + input[type="checkbox"], + .combobox-container, + .identifier-scheme { + display: inline-block; + } - label { - width: 20%; - } - - input.form-submit, - button.form-cancel { - font-size: 9pt; + .identifier-scheme-indent { + margin-left: -5px; } - } - } - } + + label { + width: 20%; + text-align: right; + margin-right: 10px; + vertical-align: middle; + } + + input.form-submit, + button.form-cancel { + font-size: 10pt; + } + } + } + } - .button-spacer { - display: inline-block; - width: 21%; - } + .button-spacer { + display: inline-block; + width: 21%; + } + + .button-spacer-large { + display: inline-block; + width: 21%; + } - input.form-submit, - button.form-cancel { - font-size: 11pt; - padding: 10px 10px 10px 10px; - width: 80px; - } + input.form-submit, + button.form-cancel { + font-size: 11pt; + padding: 10px 10px 10px 10px; + } } /* Accessible JQuery combobox */ -/* ----------------------------------------- */ +/* ------------------------------------------------------ */ .invisible { border: 0; clip: rect(0 0 0 0);