diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index f5fadfb..27db57a 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,12 +1,20 @@ -

<%= t('custom_devise.resend_confirmation') %>

+
+
+

<%= t('custom_devise.resend_confirmation') %>

+
+
-<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> +
+
+ <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> -
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
-
<%= f.submit t('custom_devise.resend_confirmation') %>
-<% end %> +
<%= f.submit t('custom_devise.resend_confirmation') %>
+ <% end %> -<%= render "devise/shared/links" %> + <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/devise/invitations/edit.html.erb b/app/views/devise/invitations/edit.html.erb index 4a4b73e..7720b7f 100644 --- a/app/views/devise/invitations/edit.html.erb +++ b/app/views/devise/invitations/edit.html.erb @@ -1,15 +1,23 @@ -

<%= t "devise.invitations.edit.header" %>

-
- <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put } do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :invitation_token %> - -

<%= f.label :password %>
- <%= f.password_field :password %>

- -

<%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation %>

- -

<%= f.submit t("devise.invitations.edit.submit_button") %>

- <% end %> -
+
+
+

<%= t "devise.invitations.edit.header" %>

+
+
+ +
+
+ <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put } do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :invitation_token %> + +

<%= f.label :password %>
+ <%= f.password_field :password %>

+ +

<%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation %>

+ +

<%= f.submit t("devise.invitations.edit.submit_button") %>

+ <% end %> +
+
+ diff --git a/app/views/devise/invitations/new.html.erb b/app/views/devise/invitations/new.html.erb index 3567356..5aee6f2 100644 --- a/app/views/devise/invitations/new.html.erb +++ b/app/views/devise/invitations/new.html.erb @@ -1,14 +1,20 @@ -

<%= t "devise.invitations.new.header" %>

-
- <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post} do |f| %> - <%= devise_error_messages! %> - - <% resource.class.invite_key_fields.each do |field| -%> -

<%= f.label field %>
- <%= f.text_field field %>

- <% end -%> - -

<%= f.submit t("devise.invitations.new.submit_button") %>

- <% end %> +
+
+

<%= t "devise.invitations.new.header" %>

+
+
+
+
+ <%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post} do |f| %> + <%= devise_error_messages! %> + + <% resource.class.invite_key_fields.each do |field| -%> +

<%= f.label field %>
+ <%= f.text_field field %>

+ <% end -%> + +

<%= f.submit t("devise.invitations.new.submit_button") %>

+ <% end %> +
\ No newline at end of file diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 93dbcfc..27cc107 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,26 +1,31 @@ -

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

-
+
+
+

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

+
+
- <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> -
- - - - - - - - - -
<%= t('helpers.new_password') %><%= f.password_field :password, :autofocus => true %>
<%= t('helpers.password') %><%= f.password_field :password_confirmation %>
-
- <%= f.submit t('helpers.save'), :class => 'btn btn-primary', role: 'button'%> -
-
- <% end %> +
+
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> +
+ + + + + + + + + +
<%= t('helpers.new_password') %><%= f.password_field :password, :autofocus => true %>
<%= t('helpers.password') %><%= f.password_field :password_confirmation %>
+
+ <%= f.submit t('helpers.save'), :class => 'btn btn-primary', role: 'button'%> +
+
+ <% end %> - <%= render "devise/shared/links" %> - -
+ <%= render "devise/shared/links" %> +
+
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 0927721..b6718cc 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,31 +1,37 @@ <% javascript "views/devise/passwords/new.js" %> -<% unless @user.errors[:email].empty? %> -

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

-<% end %> +
+
+ <% unless @user.errors[:email].empty? %> +

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

+ <% end %> + +

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

-

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

+

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

+
+
-

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

+
+
+ <%= form_for resource, as: 'user', url: user_password_path, html: {class: "password-reset roadmap-form", method: :post} do |f| %> -
- <%= form_for resource, as: 'user', url: user_password_path, html: {class: "password-reset roadmap-form", method: :post} do |f| %> +
+
+ <%= f.label(:email, _('Email'), class: 'required') %> + <%= f.email_field(:email, class: 'left-indent required input-small') %> + +
-
-
- <%= f.label(:email, _('Email'), class: 'required') %> - <%= f.email_field(:email, class: 'left-indent required input-small') %> - -
- -
- <%= render partial: 'shared/accessible_submit_button', - locals: {id: 'password-reset-button', - val: _('Send'), - disabled_initially: true, - classes: 'left-indent', - tooltip: _('Enter a valid email.')} %> -
-
- <% end %> +
+ <%= render partial: 'shared/accessible_submit_button', + locals: {id: 'password-reset-button', + val: _('Send'), + disabled_initially: true, + classes: 'left-indent', + tooltip: _('Enter a valid email.')} %> +
+
+ <% end %> +
\ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 15c6fe9..8d301df 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,5 +1,9 @@ <% javascript "views/devise/registrations/edit.js" %> -

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

+
+
+

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

+
+
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 5976167..cbf6238 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,13 +1,18 @@ -

<%= _('Create account') %>

-<% unless session["devise.shibboleth_data"].nil? %> -

- <%= (_("%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.
* If you do not have an account with %{application_name}, please complete the form below.
* If you have an account with %{application_name}, please so we can link your account to your institutional credentials.
Once you have created and/or linked your account, you'll be able to sign in with your institutional credentials directly.") % { :application_name => Rails.configuration.branding[:application][:name] }).html_safe %> -

- <% cookies[:show_shib_link] = { value: 'show_shib_link', expires: 3.hours.from_now } %> -<% end %> - -
-
- - <%= render :partial => 'shared/register_form', locals: {extended: true} %> -
+
+
+

<%= _('Create account') %>

+ + <% unless session["devise.shibboleth_data"].nil? %> +

+ <%= (_("%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.
* If you do not have an account with %{application_name}, please complete the form below.
* If you have an account with %{application_name}, please so we can link your account to your institutional credentials.
Once you have created and/or linked your account, you'll be able to sign in with your institutional credentials directly.") % { :application_name => Rails.configuration.branding[:application][:name] }).html_safe %> +

+ <% cookies[:show_shib_link] = { value: 'show_shib_link', expires: 3.hours.from_now } %> + <% end %> +
+
+
+
+ + <%= render :partial => 'shared/register_form', locals: {extended: true} %> +
+
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 90556a7..34c952a 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,33 +1,39 @@ -

<%= _('Sign in') %>

-
+
+
+

<%= _('Sign in') %>

+
+
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
- - - - - - - - - - - - - -
<%= _('Email') %><%= f.email_field :email, :autofocus => true %>
<%= _('Password') %><%= f.password_field :password %>
<% if devise_mapping.rememberable? -%> -
- <%= f.check_box :remember_me %> - <%= f.label :remember_me %> -
- <% end -%> -
-
- <%= f.submit _('Sign in'), :class => "btn btn-primary" %> -
-
- <% end %> - - <%= render "devise/shared/links" %> +
+
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> +
+ + + + + + + + + + + + + +
<%= _('Email') %><%= f.email_field :email, :autofocus => true %>
<%= _('Password') %><%= f.password_field :password %>
<% if devise_mapping.rememberable? -%> +
+ <%= f.check_box :remember_me %> + <%= f.label :remember_me %> +
+ <% end -%> +
+
+ <%= f.submit _('Sign in'), :class => "btn btn-primary" %> +
+
+ <% end %> + + <%= render "devise/shared/links" %> +
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 40792b2..08db6da 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,12 +1,20 @@ -

<%= t('custom_devise.resend_unlock') %>

+
+
+

<%= t('custom_devise.resend_unlock') %>

+
+
-<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> - <%= devise_error_messages! %> +
+
+ <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %> + <%= devise_error_messages! %> -
<%= f.label :email %>
- <%= f.email_field :email, :autofocus => true %>
+
<%= f.label :email %>
+ <%= f.email_field :email, :autofocus => true %>
-
<%= f.submit "Resend unlock instructions" %>
-<% end %> +
<%= f.submit "Resend unlock instructions" %>
+ <% end %> -<%= render "devise/shared/links" %> + <%= render "devise/shared/links" %> +
+
\ No newline at end of file diff --git a/app/views/guidance_groups/admin_edit.html.erb b/app/views/guidance_groups/admin_edit.html.erb index f89dc20..bd1d437 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -1,6 +1,10 @@ <% javascript 'admin.js' %> -

<%= _('Guidance group') %>

+
+
+

<%= _('Guidance group') %>

+
+
diff --git a/app/views/guidance_groups/admin_new.html.erb b/app/views/guidance_groups/admin_new.html.erb index a34bf17..721ed63 100644 --- a/app/views/guidance_groups/admin_new.html.erb +++ b/app/views/guidance_groups/admin_new.html.erb @@ -1,6 +1,10 @@ <% javascript 'admin.js' %> -

<%= _('Guidance group') %>

+
+
+

<%= _('Guidance group') %>

+
+
diff --git a/app/views/guidances/admin_edit.html.erb b/app/views/guidances/admin_edit.html.erb index b5e351c..952f800 100644 --- a/app/views/guidances/admin_edit.html.erb +++ b/app/views/guidances/admin_edit.html.erb @@ -1,5 +1,8 @@ -

<%= _('Guidance') %>

- +
+
+

<%= _('Guidance') %>

+
+
<%= form_for(@guidance, url: admin_update_guidance_path(@guidance), html: { method: :put , id: 'edit_guidance_form', class: 'roadmap-form bordered'}) do |f| %> diff --git a/app/views/guidances/admin_index.html.erb b/app/views/guidances/admin_index.html.erb index 27b2b8a..32fb87b 100644 --- a/app/views/guidances/admin_index.html.erb +++ b/app/views/guidances/admin_index.html.erb @@ -1,10 +1,14 @@ <% javascript "admin.js" %> -

<%= _('Guidance') %>

+
+
+

<%= _('Guidance') %>

-

- <%= _("First create a guidance group. This could be institution wide or a subset e.g. a particular College / School, Institute or department. When you create guidance you'll be asked to assign it to a guidance group.") %> -

+

+ <%= _("First create a guidance group. This could be institution wide or a subset e.g. a particular College / School, Institute or department. When you create guidance you'll be asked to assign it to a guidance group.") %> +

+
+
@@ -74,7 +78,7 @@ <% if @guidances.length > 0 then%> - <% if @guidances.length > 10 %> + <% if @guidances.length > TABLE_FILTER_MIN_ROWS %> + + + + <% end %> + +
<%= render(partial: "shared/table_filter", diff --git a/app/views/guidances/admin_new.html.erb b/app/views/guidances/admin_new.html.erb index 9f4899a..42240e7 100644 --- a/app/views/guidances/admin_new.html.erb +++ b/app/views/guidances/admin_new.html.erb @@ -1,7 +1,11 @@ <% javascript 'views/guidances/admin_edit.js' %> -

<%= _('New guidance') %>

+
+
+

<%= _('New guidance') %>

+
+
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ac6511e..d66a5a5 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -2,7 +2,11 @@

<%= _('Welcome.')%>

+
+
+
+
<%= raw _('

%{application_name} has been jointly developed by the %{organisation_name} to help you write data management plans.

') % {:application_name => Rails.configuration.branding[:application][:name], :organisation_name => Rails.configuration.branding[:organisation][:name]} %>

<%= _('Screencast on how to use %{application_name}') % {:application_name => Rails.configuration.branding[:application][:name]} %>

diff --git a/app/views/orgs/admin_edit.html.erb b/app/views/orgs/admin_edit.html.erb index f823dee..a1c18f5 100644 --- a/app/views/orgs/admin_edit.html.erb +++ b/app/views/orgs/admin_edit.html.erb @@ -1,6 +1,10 @@ <% javascript 'views/orgs/admin_edit.js' %> -

<%= _('Organisation details') %>

+
+
+

<%= _('Organisation details') %>

+
+
diff --git a/app/views/orgs/shibboleth_ds.html.erb b/app/views/orgs/shibboleth_ds.html.erb index 3baca32..4d6ee9d 100644 --- a/app/views/orgs/shibboleth_ds.html.erb +++ b/app/views/orgs/shibboleth_ds.html.erb @@ -1,6 +1,10 @@ <% javascript 'views/orgs/shibboleth_ds.js'%> -

Find your institution to sign in

+
+
+

Find your institution to sign in

+
+
diff --git a/app/views/phases/admin_add.html.erb b/app/views/phases/admin_add.html.erb index 9326e00..6dabbe7 100644 --- a/app/views/phases/admin_add.html.erb +++ b/app/views/phases/admin_add.html.erb @@ -1,7 +1,11 @@ <%- model_class = Phase -%> <% javascript "admin.js" %> -

<%= @template.title %>

+
+
+

<%= @template.title %>

+
+
diff --git a/app/views/phases/admin_preview.html.erb b/app/views/phases/admin_preview.html.erb index 0b7f689..0e7466a 100644 --- a/app/views/phases/admin_preview.html.erb +++ b/app/views/phases/admin_preview.html.erb @@ -1,60 +1,64 @@ <%- model_class = Phase -%> -

- <%= @template.title %> - -
- <%= link_to _('Back to edit view'), - admin_show_phase_path(id: @phase.id, edit: "true"), - class: 'btn btn-primary' %> - <%= link_to _('View all templates'), - admin_index_template_path, - class: 'btn btn-primary' %> +
+
+

+ <%= @template.title %> + +
+ <%= link_to _('Back to edit view'), + admin_show_phase_path(id: @phase.id, edit: "true"), + class: 'btn btn-primary' %> + <%= link_to _('View all templates'), + admin_index_template_path, + class: 'btn btn-primary' %> +
+

-

+
- - <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, active: @phase.id} %> + + <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, active: @phase.id} %> - -
-
- <% sections = @phase.sections %> - <% sections.order(:number).each do |section| %> -
- -
-
- <%= raw section.description %> -
-
- <% last_question_id = section.questions.order("number DESC").first.id%> + +
+
+ <% sections = @phase.sections %> + <% sections.order(:number).each do |section| %> +
+ +
+
+ <%= raw section.description %> +
+
+ <% last_question_id = section.questions.order("number DESC").first.id%> - <% section.questions.order("number").each do |question| %> - - <%= render partial: 'questions/preview_question', locals: {question: question}%> - <% if last_question_id == question.id then %> -
- <% else %> -
- <% end %> + <% section.questions.order("number").each do |question| %> + + <%= render partial: 'questions/preview_question', locals: {question: question}%> + <% if last_question_id == question.id then %> +
+ <% else %> +
+ <% end %> - <% end %> -
-
-
- <% end %> -
-
-
+ <% end %> +
+
+
+ <% end %> +
+
+
\ No newline at end of file diff --git a/app/views/phases/admin_show.html.erb b/app/views/phases/admin_show.html.erb index 96f2aba..e7a6854 100644 --- a/app/views/phases/admin_show.html.erb +++ b/app/views/phases/admin_show.html.erb @@ -1,6 +1,10 @@ <% javascript 'admin.js' %> -

<%= @phase.template.title %>

+
+
+

<%= @phase.template.title %>

+
+
diff --git a/app/views/phases/edit.html.erb b/app/views/phases/edit.html.erb index cf89c4c..9debccc 100644 --- a/app/views/phases/edit.html.erb +++ b/app/views/phases/edit.html.erb @@ -3,9 +3,12 @@ so if we come this way then we are editing a phase --> - -

<%= @plan.title %>

- +
+
+ +

<%= @plan.title %>

+
+
diff --git a/app/views/plans/index.html.erb b/app/views/plans/index.html.erb index fd7fef5..fd90df3 100644 --- a/app/views/plans/index.html.erb +++ b/app/views/plans/index.html.erb @@ -1,104 +1,105 @@ -<% javascript "views/plans/index.js" %> -

<%= _('My Dashboard') %>

+
+
+

<%= _('My Dashboard') %>

- -

-<% if @plans.count > 0 %> - - <%= _('The table below lists the plans that you have created, and any that have been shared with you by others.') %>
- <%= _('These can be edited, shared, exported or deleted at anytime.')%> -<% else %> - <%= _("Welcome.") %>
- <%= _("You are now ready to create your first DMP.") %>
- <%= _("Click the 'Create plan' button below to begin.")%> -<% end %> -

+ +

+ <% if @plans.count > 0 %> + <%= _('The table below lists the plans that you have created, and any that have been shared with you by others.') %>
+ <%= _('These can be edited, shared, exported or deleted at anytime.')%> + <% else %> + <%= _("Welcome.") %>
+ <%= _("You are now ready to create your first DMP.") %>
+ <%= _("Click the 'Create plan' button below to begin.")%> + <% end %> +

+
+
<% if @plans.length > 0 %> - - - <% if @plans.length > 10 %> +
+
+ + <% if @plans.length > TABLE_FILTER_MIN_ROWS %> + + + + <% end %> - + + + + + + + - <% end %> - - - - - - - - - - - - <% @plans.each do |plan| %> - - - - - - - - + <% @plans.each do |plan| %> + + + + + + - - <% end %> - -
+ <%= render(partial: "shared/table_filter", + locals: {path: plans_path, placeholder: _('Filter plans')}) %> +
- <%= render(partial: "shared/table_filter", - locals: {path: plans_path, placeholder: _('Filter plans')}) %> - <%= _('Project Title') %><%= _('Template') %><%= _('Edited') %><%= _('Role') %><%= _('Test') %><%= _('Visibility') %> + <%= _('Actions') %> +
<%= _('Project Title') %><%= _('Template') %><%= _('Edited') %><%= _('Role') %><%= _('Test') %><%= _('Visibility') %> - <%= _('Actions') %> -
- <%= link_to "#{plan.title.length > 60 ? "#{plan.title[0..59]} ..." : plan.title}", - plan_path(plan) %> - <%= plan.template.title %><%= l(plan.latest_update.to_date, formats: :short) %><%= display_role(plan.roles.find_by(user: current_user)) %> - <% if plan.administerable_by?(current_user.id) then %> - <%= plan.administerable_by?(current_user.id) ? '' : 'disabled="true"' %> /> - <% else %> - <%= plan.visibility === 'is_test' ? _('Yes') : _('No') %> - <% end %> - <%= raw display_visibility(plan.visibility) %> - - <%= _('Actions') %> - -
+ <%= link_to "#{plan.title.length > 60 ? "#{plan.title[0..59]} ..." : plan.title}", + plan_path(plan) %> + <%= plan.template.title %><%= l(plan.latest_update.to_date, formats: :short) %><%= display_role(plan.roles.find_by(user: current_user)) %> + <% if plan.administerable_by?(current_user.id) then %> + <%= plan.administerable_by?(current_user.id) ? '' : 'disabled="true"' %> /> <% else %> -
  • <%= link_to _('View'), - plan_path(plan) %>
  • - -
  • <%= link_to _('Download'), - show_export_plan_path(plan) %>
  • + <%= plan.visibility === 'is_test' ? _('Yes') : _('No') %> <% end %> - <% role = plan.roles.where(user_id: current_user.id).first %> - <% conf = (role.creator? && plan.publicly_visible?) ? _("Are you sure you wish to remove this public plan? This will remove it from the Public DMPs page but any collaborators will still be able to access it.") : _("Are you sure you wish to remove this plan? Any collaborators will still be able to access it.") %> -
  • <%= link_to _('Remove'), - deactivate_role_path(role), - method: :put, - data: {confirm: conf} %>
  • - -
    +
    <%= raw display_visibility(plan.visibility) %> +
    +
    <% end %>
    - <%= _('Create plan') %> + <%= link_to _('Create plan'), new_plan_path, class: 'btn btn-primary' %>
    diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb index 9453750..13297ab 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -1,9 +1,14 @@ <% javascript "views/plans/new.js" %> -

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

    -

    - <%= _("Before you get started, we need some information about your research project to set you up with the best DMP template for your needs.") %> -

    +
    +
    +

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

    + +

    + <%= _("Before you get started, we need some information about your research project to set you up with the best DMP template for your needs.") %> +

    +
    +
    diff --git a/app/views/plans/share.html.erb b/app/views/plans/share.html.erb index ff17499..6bcbb6d 100644 --- a/app/views/plans/share.html.erb +++ b/app/views/plans/share.html.erb @@ -1,6 +1,11 @@ <% javascript('views/plans/share.js') %> - -

    <%= @plan.title %>

    + +
    +
    + +

    <%= @plan.title %>

    +
    +
    diff --git a/app/views/plans/show.html.erb b/app/views/plans/show.html.erb index b96c8c9..85c18ec 100644 --- a/app/views/plans/show.html.erb +++ b/app/views/plans/show.html.erb @@ -1,5 +1,9 @@ - -

    <%= @plan.title %>

    +
    +
    + +

    <%= @plan.title %>

    +
    +
    diff --git a/app/views/plans/show_export.html.erb b/app/views/plans/show_export.html.erb index 4d23e85..9cd7704 100644 --- a/app/views/plans/show_export.html.erb +++ b/app/views/plans/show_export.html.erb @@ -1,7 +1,12 @@ <%- model_class = Plan -%> <% javascript('views/plans/export_configure.js') %> - -

    <%= @plan.title %>

    + +
    +
    + +

    <%= @plan.title %>

    +
    +
    diff --git a/app/views/public_pages/plan_index.html.erb b/app/views/public_pages/plan_index.html.erb index 420972e..3ea9622 100644 --- a/app/views/public_pages/plan_index.html.erb +++ b/app/views/public_pages/plan_index.html.erb @@ -1,5 +1,10 @@ <%- model_class = Plan -%> -

    <%= raw _('Public DMPs') %>

    + +
    +
    +

    <%= raw _('Public DMPs') %>

    +
    +
    @@ -18,7 +23,7 @@
    - <% if @plans.count > 10 %> + <% if @plans.count > TABLE_FILTER_MIN_ROWS %>
    <%= render(partial: "shared/table_filter", diff --git a/app/views/public_pages/template_index.html.erb b/app/views/public_pages/template_index.html.erb index b6316af..e49f7a1 100644 --- a/app/views/public_pages/template_index.html.erb +++ b/app/views/public_pages/template_index.html.erb @@ -1,4 +1,8 @@ -

    <%= raw _('DMP Templates') %>

    +
    +
    +

    <%= raw _('DMP Templates') %>

    +
    +
    @@ -12,7 +16,7 @@
    - <% if @templates.count > 10 %> + <% if @templates.count > TABLE_FILTER_MIN_ROWS %>
    <%= render(partial: "shared/table_filter", diff --git a/app/views/settings/phases/show.html.erb b/app/views/settings/phases/show.html.erb index c719d53..796bd51 100644 --- a/app/views/settings/phases/show.html.erb +++ b/app/views/settings/phases/show.html.erb @@ -1,6 +1,13 @@ +
    +
    +

    <%= _('File Name') -%> - <%= @plan.title -%>

    +

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

    +
    +
    -

    <%= _('File Name') -%> - <%= @plan.title -%>

    -

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

    - -<%= render "export_formatting_form" %> +
    +
    + <%= render "export_formatting_form" %> +
    +
    diff --git a/app/views/shared/_table_filter.html.erb b/app/views/shared/_table_filter.html.erb index d81a5e6..dae9f28 100644 --- a/app/views/shared/_table_filter.html.erb +++ b/app/views/shared/_table_filter.html.erb @@ -1,7 +1,10 @@ -
    +
    - <%= search_field_tag(:filter, params[:filter], placeholder: placeholder) %> - + <%= label_tag :filter, _('Filter plans'), class: "sr-only" %> + <%= search_field_tag(:filter, params[:filter], placeholder: placeholder, class: "form-control") %> +
    diff --git a/app/views/static_pages/about_us.html.erb b/app/views/static_pages/about_us.html.erb index ebd9579..f3df69e 100644 --- a/app/views/static_pages/about_us.html.erb +++ b/app/views/static_pages/about_us.html.erb @@ -1,4 +1,8 @@ -

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

    +
    +
    +

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

    +
    +
    diff --git a/app/views/static_pages/help.html.erb b/app/views/static_pages/help.html.erb index 620bd46..0fef262 100644 --- a/app/views/static_pages/help.html.erb +++ b/app/views/static_pages/help.html.erb @@ -1,4 +1,8 @@ -

    <%= _('Help')%>

    +
    +
    +

    <%= _('Help')%>

    +
    +
    diff --git a/app/views/static_pages/roadmap.html.erb b/app/views/static_pages/roadmap.html.erb index 8dabe33..ed84e52 100644 --- a/app/views/static_pages/roadmap.html.erb +++ b/app/views/static_pages/roadmap.html.erb @@ -1,4 +1,8 @@ -

    <%= _('Future plans')%>

    +
    +
    +

    <%= _('Future plans')%>

    +
    +
    diff --git a/app/views/static_pages/termsuse.html.erb b/app/views/static_pages/termsuse.html.erb index 866af80..37f0aa7 100644 --- a/app/views/static_pages/termsuse.html.erb +++ b/app/views/static_pages/termsuse.html.erb @@ -1,4 +1,8 @@ -

    <%= _('Terms of use')%>

    +
    +
    +

    <%= _('Terms of use')%>

    +
    +
    diff --git a/app/views/templates/admin_index.html.erb b/app/views/templates/admin_index.html.erb index 30933a9..7d16d87 100644 --- a/app/views/templates/admin_index.html.erb +++ b/app/views/templates/admin_index.html.erb @@ -1,12 +1,15 @@ -

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

    +
    +
    +

    <%= _('Templates') %>

    -

    - <%= _("If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.") %> -

    -

    - <%= _("Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.") %> -

    +

    + <%= _("If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.") %> +

    +

    + <%= _("Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.") %> +

    +
    +
    diff --git a/app/views/templates/admin_new.html.erb b/app/views/templates/admin_new.html.erb index dcd6a6c..c6c148e 100644 --- a/app/views/templates/admin_new.html.erb +++ b/app/views/templates/admin_new.html.erb @@ -1,12 +1,16 @@ <% javascript "admin.js" %> -

    - <%= _('New template') %> - -
    - <%= link_to _('View all templates'), - admin_index_template_path, class: "btn btn-primary" %> +
    +
    +

    + <%= _('New template') %> + +
    + <%= link_to _('View all templates'), + admin_index_template_path, class: "btn btn-primary" %> +
    +

    -

    +
    diff --git a/app/views/templates/admin_template.html.erb b/app/views/templates/admin_template.html.erb index c833745..3d0d441 100644 --- a/app/views/templates/admin_template.html.erb +++ b/app/views/templates/admin_template.html.erb @@ -1,57 +1,62 @@ <% javascript 'admin.js' %> -

    <%= @template.title %>

    + +
    +
    +

    <%= @template.title %>

    +
    +
    -
    - - <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, hash: @hash, active: "show_template"} %> +
    + + <%= render partial: "templates/admin_nav_tabs", locals: {template: @template, hash: @hash, active: "show_template"} %> -
    - -
    +
    + +
    -
    -

    <%= _('Template details')%>

    +
    +

    <%= _('Template details')%>

    -
    - <% if @template == @current && @template.customization_of.nil? %> - - <% end %> -
    - <%= render partial: "templates/show_template", locals: {template: @template, current: @current, hash: @hash}%> -
    -
    +
    + <% if @template == @current && @template.customization_of.nil? %> + + <% end %> +
    + <%= render partial: "templates/show_template", locals: {template: @template, current: @current, hash: @hash}%> +
    +
    - - <% if @hash[:template][:phases].present? %> - <% if @hash[:template][:phases].length == 1 %> - <% @hash[:template][:phases].each do |phase_no, phase| %> - - <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current} %> - <% end %> + + <% if @hash[:template][:phases].present? %> + <% if @hash[:template][:phases].length == 1 %> + <% @hash[:template][:phases].each do |phase_no, phase| %> + + <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current} %> + <% end %> - <% else %> - <% (1..@hash[:template][:phases].length).each do |phase_no| %> - <% phase = @hash[:template][:phases][phase_no] %> -

    <%= phase[:data].title %>

    + <% else %> + <% (1..@hash[:template][:phases].length).each do |phase_no| %> + <% phase = @hash[:template][:phases][phase_no] %> +

    <%= phase[:data].title %>

    -
    - - <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current}%> -
    - <% end %> - <% end %> - <% end %> -
    +
    + + <%= render partial: 'templates/show_phases_sections', locals: {phase: phase[:data], phase_hash: phase, template: @template, current: @current}%> +
    + <% end %> + <% end %> + <% end %> +
    -
    -
    -
    +
    +
    +
    -
    +
    diff --git a/app/views/templates/admin_template_history.html.erb b/app/views/templates/admin_template_history.html.erb index 27ef981..1b699c0 100644 --- a/app/views/templates/admin_template_history.html.erb +++ b/app/views/templates/admin_template_history.html.erb @@ -1,8 +1,12 @@ -

    <%= _('Template History') %>

    +
    +
    +

    <%= _('Template History') %>

    -

    - <%= _('Here you can view previously published versions of your template. These can no longer be modified.')%> -

    +

    + <%= _('Here you can view previously published versions of your template. These can no longer be modified.')%> +

    +
    +
    diff --git a/app/views/token_permission_types/index.html.erb b/app/views/token_permission_types/index.html.erb index 7215979..67ed7ad 100644 --- a/app/views/token_permission_types/index.html.erb +++ b/app/views/token_permission_types/index.html.erb @@ -1,14 +1,15 @@ +
    +
    + <% @token_types.each do |token_type|%> +

    + <%= token_type.token_type %> +

    +
    -<% @token_types.each do |token_type|%> -

    - <%= token_type.token_type %> -

    -
    +
    + <%= token_type.text_description %> +
    -
    - - <%= token_type.text_description %> - -
    - -<% end %> \ No newline at end of file + <% end %> +
    +
    \ No newline at end of file diff --git a/app/views/users/admin_grant_permissions.html.erb b/app/views/users/admin_grant_permissions.html.erb index 71386a4..69b5aa5 100644 --- a/app/views/users/admin_grant_permissions.html.erb +++ b/app/views/users/admin_grant_permissions.html.erb @@ -1,6 +1,8 @@ -

    - <%= _('Edit User Privileges') %> -

    +
    +
    +

    <%= _('Edit User Privileges') %>

    +
    +
    diff --git a/app/views/users/admin_index.html.erb b/app/views/users/admin_index.html.erb index 0ca966b..6648a31 100644 --- a/app/views/users/admin_index.html.erb +++ b/app/views/users/admin_index.html.erb @@ -1,15 +1,17 @@ -

    - <%= _('List of users') %> -

    -

    - <%= _('Below is a list of users registered for your organisation. You can sort the data by each field.')%> -

    +
    +
    +

    <%= _('List of users') %>

    +

    + <%= _('Below is a list of users registered for your organisation. You can sort the data by each field.')%> +

    +
    +
    - <% if @users.count > 10 %> + <% if @users.count > TABLE_FILTER_MIN_ROWS %>
    <%= render(partial: "shared/table_filter", diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index 927a84f..c3f0124 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -1,2 +1,3 @@ LANGUAGES = (ActiveRecord::Base.connection.table_exists? 'languages') ? Language.sorted_by_abbreviation : [] MANY_LANGUAGES = LANGUAGES.length > 1 +TABLE_FILTER_MIN_ROWS = 10 diff --git a/lib/assets/javascripts/application.js b/lib/assets/javascripts/application.js index 193f07d..38b319c 100644 --- a/lib/assets/javascripts/application.js +++ b/lib/assets/javascripts/application.js @@ -27,6 +27,7 @@ //= require jquery-accessible-autocomplete-list-aria/jquery-accessible-autocomplete-list-aria.js //= require placeholder/dist/placeholder.min.js //= require tablesorter/dist/js/jquery.tablesorter.min.js +//= require tablesorter/dist/js/jquery.tablesorter.widgets.min.js //= require timeago/jquery.timeago.js //= require tinymce/tinymce.min.js @@ -38,6 +39,8 @@ //= require utils/tinymce.js //= require utils/validate.js //= require utils/ariatiseForm.js +//= require utils/filteriseTable.js +//= require utils/collateTable.js // views JS files //= require views/answers/status.js @@ -47,12 +50,11 @@ //= require views/notes/edit.js //= require views/notes/archive.js //= require views/contacts/new.js +//= require views/plans/index.js // Rest of JS files //= require dmproadmap/accordions.js //= require dmproadmap/forms.js -//= require dmproadmap/tables.js -// require dmproadmap/tabs.js //= require views/shared/login_form.js //= require views/shared/register_form.js diff --git a/lib/assets/javascripts/dmproadmap/tables.js b/lib/assets/javascripts/dmproadmap/tables.js deleted file mode 100644 index 395181b..0000000 --- a/lib/assets/javascripts/dmproadmap/tables.js +++ /dev/null @@ -1,49 +0,0 @@ -$(function(){ - - $(".tablesorter").tablesorter({ - dateFormat: "uk" - }); - - $(".tablesorter thead th.tablesorter-headerUnSorted:not(.sorter-false) div") - .append('') - .click(function(e){ - if($(this).find("span.fa").hasClass('fa-sort') || $(this).find("span.fa").hasClass('fa-sort-asc')){ - $(this).find("span.fa").removeClass('fa-sort').removeClass('fa-sort-asc').addClass('fa-sort-desc'); - }else{ - $(this).find("span.fa").removeClass('fa-sort-desc').addClass('fa-sort-asc'); - } - }); - - // Table filter search - $("#filter").keyup(function(e){ - var query = $(this).val(), - regex = new RegExp(query, 'i'), - matched = false; - - if(query.length < 2){ - $(this).closest("table").find("tbody tr").show(); - $(this).closest("table").find("tbody tr.no-matches").hide(); - - }else{ - $.each($(this).closest("table").find("tbody tr"), function(idx, ctx){ - if($(ctx).text().match(regex)){ - $(ctx).show(); - }else{ - $(ctx).hide(); - } - }); - } - }); - - // Table filter clear - $('#clear_filter').click(function(e){ - e.preventDefault(); - - $("#filter").val(''); - $(this).closest("table").find("tbody tr").show(); - $(this).closest("table").find("tbody tr.no-matches").hide(); - }); - - $('#filter_form').submit(function(e){ e.preventDefault(); }); - -}); \ No newline at end of file diff --git a/lib/assets/javascripts/dmproadmap/tabs.js b/lib/assets/javascripts/dmproadmap/tabs.js deleted file mode 100644 index 17cd9af..0000000 --- a/lib/assets/javascripts/dmproadmap/tabs.js +++ /dev/null @@ -1,52 +0,0 @@ -/* -$(document).ready(function(){ - $(".tab-panels div.tab-panel:not(.active)").hide(); - - $("li[role='tab'] a").click(function(e){ - // Unselect the other tabs - $("li[role='tab']").removeClass('active').children('a').attr('aria-selected', 'false'); - // Select the current tab - $(this).attr('aria-selected', 'true').parent().addClass('active'); - - // Display the corresponding panel if its a page anchor otherwise just follow the target - if($(this).attr("href")[0] == '#'){ - e.preventDefault(); - - var panel = $($(this).attr("href")); - panel.show().attr("aria-hidden", 'false'); - $.each($(panel).siblings(), function(i, p){ - $(p).hide().attr("aria-hidden", 'true'); - }); - } - }); -}); - -function selectActiveTab(){ - var tab = getURLParameter('tab'); - if (tab != '') - { - // Unselect the other tabs - $("li[role='tab']").removeClass('active').children('a').attr('aria-selected', 'false'); - // Select the current tab - $(".tabs").find('#' + tab).attr('aria-selected', 'true').addClass('active'); - - // Display the corresponding panel if its a page anchor otherwise just follow the target - var panel = $(".tabs").find('#' + tab).children('a').attr("href"); - $(".tab-panels").find(panel).addClass('active'); - $.each($(".tab-panels").find(panel).siblings(), function(i, p){ - $(p).removeClass('active'); - }); - } -} - -function getURLParameter(sParam){ - var sPageURL = window.location.search.substring(1); - var sURLVariables = sPageURL.split('&'); - for (var i = 0; i < sURLVariables.length; i++) { - var sParameterName = sURLVariables[i].split('='); - if (sParameterName[0] == sParam){ - return sParameterName[1]; - } - } -} -*/ diff --git a/lib/assets/javascripts/utils/collateTable.js b/lib/assets/javascripts/utils/collateTable.js new file mode 100644 index 0000000..a410c12 --- /dev/null +++ b/lib/assets/javascripts/utils/collateTable.js @@ -0,0 +1,21 @@ +/* + tablesorter is an external library located in vendor/tablesorter. + + it does not provide us with icons though, so we add our own below along + with logic to change them to up/down arrows when the user sorts the column +*/ + +(function(ctx){ + ctx.init = ctx.init || (function(options){ + if($ && options && options.selector){ + /* Bind the table to the external tablesorter JS (see vendor/tablesorter) */ + $(options.selector).tablesorter({ + theme: 'bootstrap_3', + headerTemplate: '{content} {icon}', + cssIconAsc: 'fa fa-sort-asc', + cssIconDesc: 'fa fa-sort-desc', + cssIconNone: 'fa fa-sort' + }); + } + }); +})(define('dmproadmap.utils.collateTable')); \ No newline at end of file diff --git a/lib/assets/javascripts/utils/filteriseTable.js b/lib/assets/javascripts/utils/filteriseTable.js new file mode 100644 index 0000000..25e2aff --- /dev/null +++ b/lib/assets/javascripts/utils/filteriseTable.js @@ -0,0 +1,46 @@ +/* + filteriseTable adds filter capabilities to an HTML table + table rows are shown/hidden as the user enters text into the filter input field + all rows are made visible when the user clicks the 'clear' icon +*/ +(function(ctx){ + + var filter = (function(el){ + var query = $(el).val(), + regex = new RegExp(query, 'i'); + + $.each($(el).closest("table").find("tbody tr"), function(idx, tr){ + if(regex.test($(tr).text())){ + $(tr).show(); + }else{ + $(tr).hide(); + } + }); + }); + + var clear = (function(el){ + $(el).val(''); + $(el).closest("table").find("tbody tr").show(); + }); + + ctx.init = ctx.init || (function(options){ + if($ && options && options.selector){ + var id = $(this).attr("id"); + + /* initialize a debounced listener for the filter box */ + var debounced = dmproadmap.utils.debounce(filter); + + /* Bind the clear function to the clear icon's click event */ + $(options.selector).keyup(function(){ + debounced(this); + }); + + $(options.selector).siblings("#clear_filter").click(function(e){ + e.preventDefault(); + clear(this); + debounced.cancel(); + }); + } + }); + +})(define('dmproadmap.utils.filteriseTable')); \ No newline at end of file diff --git a/lib/assets/javascripts/views/plans/index.js b/lib/assets/javascripts/views/plans/index.js index cc6ac83..95f497b 100644 --- a/lib/assets/javascripts/views/plans/index.js +++ b/lib/assets/javascripts/views/plans/index.js @@ -1,4 +1,7 @@ $(document).ready(function(){ + dmproadmap.utils.collateTable.init({ selector: 'table.tablesorter' }); + dmproadmap.utils.filteriseTable.init({ selector: '#filter' }); + // Update the plan's test status via ajax when the checkbox is clicked $("input[type='checkbox']").on('click, change', function(e){ var self = this; diff --git a/lib/assets/stylesheets/application.scss b/lib/assets/stylesheets/application.scss index 2dcf13e..8e533b4 100644 --- a/lib/assets/stylesheets/application.scss +++ b/lib/assets/stylesheets/application.scss @@ -12,6 +12,7 @@ *= require_self * *= require bootstrap/dist/css/bootstrap + *= require tablesorter/dist/css/theme.bootstrap_3.min.css */ /* CSSs files for jquery-ui. TODO, remove when bootstrap is re-introduced diff --git a/lib/assets/stylesheets/dmproadmap.scss b/lib/assets/stylesheets/dmproadmap.scss index b751bd8..0ca9017 100644 --- a/lib/assets/stylesheets/dmproadmap.scss +++ b/lib/assets/stylesheets/dmproadmap.scss @@ -1,10 +1,11 @@ /**** font configuration ****/ +/* @font-face { font-family: 'GillSansLight'; src: font-url('GillSansLight.ttf') format('truetype'); font-weight: normal; } -/* + $black: #000; $white: #FFF; $highlight-color: $black; @@ -42,74 +43,4 @@ /* $header-logo-top-margin: 20px; $header-logo-left-margin: 10px; -*/ - - -/* EVERYTHING BELOW THIS LINE IS SPECIFIC TO THE BOOSTRAP 3.x IMPLEMENTATION OF ROADMAP */ -/* we unfortunately need to use `!important` throughout to get it to override consistently */ -/* ----------------------------------------------------------------------------------------- */ -/* SASS variables */ -$dark-grey: #333; -$medium-grey: #827D7E; -$light-grey: #CCC; - -$font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; - -$primary-color: #4f5253; -$primary-reverse-color: #FFF; /* Typically used for the font color when using $primary-color as the background-color */ - -$body-background: #FFF; - -$header-font: "GillSansLight"; - -$footer-background: $body-background; -$footer-color: $dark-grey; -$footer-margin-top: 30px; - -$tab-borders: 2px solid $primary-color; - - - -/* GENERIC PAGE STYLING */ -/* ------------------------------------------ */ -a, a:visited, a:hover, a:focus { - color: $primary-color !important; -} -footer { - margin-top: $footer-margin-top; -} - -/* GENERIC TAB STYLING */ -/* ------------------------------------------ */ -/* Make sure the active tab is the primarycolor and that it has a border */ -.nav-tabs > li.active > a, -.nav-tabs > li.active > a:hover, -.nav-tabs > li.active > a:focus { - color: $primary-reverse-color !important; - background-color: $primary-color !important; - border: $tab-borders; - border-bottom: none; -} -/* make sure that inactive tabs have a border */ -.nav-tabs > li:not(.active) > a { - border: 1px solid $light-grey; - border-bottom: none; -} -/* make sure that inactive tabs become the primary color when they receive focus/hover */ -.nav-tabs > li:not(.active) > a:hover, -.nav-tabs > li:not(.active) > a:focus { - color: $primary-reverse-color !important; - background-color: $primary-color !important; - border: $tab-borders; - border-bottom: none; -} -/* Make user that the tab content is surrounded by a border and has adequate padding */ -.tab-content { - border: $tab-borders; - margin-top: -1px; - - .tab-pane { - padding: 15px 15px 25px 15px; - } -} - +*/ \ No newline at end of file