diff --git a/.gitignore b/.gitignore index c5c5970..f129506 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,5 @@ config/locale/*/app.po.time_stamp # ignore front-end dependencies +vendor/package-lock.json vendor/node_modules diff --git a/app/assets/javascripts/views/devise/registrations/edit.js b/app/assets/javascripts/views/devise/registrations/edit.js index 9d1eabb..8a2115f 100644 --- a/app/assets/javascripts/views/devise/registrations/edit.js +++ b/app/assets/javascripts/views/devise/registrations/edit.js @@ -53,6 +53,7 @@ }); toggleSubmit(); + selectActiveTab(); function validateEmailsDoNotMatch(){ var email = $("form.register-form #user_email").val().trim(); diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 3ea21db..df35cd6 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -10,6 +10,8 @@ * * require jquery.ui.all *= require_self + * + *= require bootstrap/dist/css/bootstrap */ /* CSSs files for jquery-ui. TODO, remove when bootstrap is re-introduced diff --git a/app/views/contact_us/contacts/new.html.erb b/app/views/contact_us/contacts/new.html.erb index 141a4c5..c8883dd 100644 --- a/app/views/contact_us/contacts/new.html.erb +++ b/app/views/contact_us/contacts/new.html.erb @@ -1,17 +1,15 @@ <% javascript "views/contacts/new_contact.js" %> - -

- <%= _("Contact Us") %> -

+

<%= _("Contact Us") %>

- <%= 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]} %> +<%= 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, html: {class: "roadmap-form"} do |f| %>
<% if ContactUs.require_name %> @@ -20,20 +18,20 @@ <%= f.text_field(:name, class: "left-indent required input-large", value: current_user.nil? ? '' : current_user.name(false), readonly: !current_user.nil?) %>
<% end %> - +
<%= f.label(:email, _('Email'), class: 'required') %> <%= f.text_field(:email, class: "left-indent required input-large", value: current_user.nil? ? '' : current_user.email, readonly: !current_user.nil?) %>
- + <% if ContactUs.require_subject %>
<%= f.label(:subject, _('Subject'), class: 'required') %> <%= f.text_field(:subject, class: "left-indent required input-large") %>
<% end %> - +
<%= f.label(:message, _('Message'), class: "align-top required") %> <%= f.text_area(:message, class: "required input-large", rows: 10, style: "height: 160px;") %> @@ -46,7 +44,7 @@
<% end %> - +
 
<%= render partial: 'shared/accessible_submit_button', @@ -56,12 +54,12 @@ tooltip: _('Fill in the required fields')} %>
- <% end %> +
-
+
    <% [Rails.configuration.branding[:organisation][:name], Rails.configuration.branding[:organisation][:address_line1], @@ -69,13 +67,13 @@ Rails.configuration.branding[:organisation][:address_line3], Rails.configuration.branding[:organisation][:address_line4], Rails.configuration.branding[:organisation][:address_country]].each do |addr_line| %> - + <% if addr_line %>
  • <%= addr_line %>
  • <% end %> <% end %>
- +

<%= "#{_('Helpline')} #{Rails.configuration.branding[:organisation][:telephone]}" %>

<%= _('Email') %> <%= Rails.configuration.branding[:organisation][:email] %>

@@ -85,5 +83,4 @@
- -
+ \ 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 9b1139d..15c6fe9 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,40 +1,37 @@ <% javascript "views/devise/registrations/edit.js" %> -

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

-
-
- +
+
+
+ -
-
- <%= render partial: 'devise/registrations/personal_details' %> -
+
+
+ <%= render partial: 'devise/registrations/personal_details' %> +
- + -
-
- - \ No newline at end of file +
\ 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 cfd27cc..f89dc20 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -1,55 +1,56 @@ <% javascript 'admin.js' %> -

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

+

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

-
- <%= form_for(@guidance_group, url: admin_update_guidance_group_path(@guidance_group), html: {method: :put, class: 'roadmap-form bordered'}) do |f| %> -
-
- <%= f.label _('Name'), for: :name %> - <%= f.text_field :name, as: :string, class: 'input-medium required' %> - -
- - - <% if @guidance_group.published == true then %> +
+
+ <%= form_for(@guidance_group, url: admin_update_guidance_group_path(@guidance_group), html: {method: :put, class: 'roadmap-form bordered'}) do |f| %> +
- <%= f.label _('Published'), for: :published %> - <%= f.check_box :published %> + <%= f.label _('Name'), for: :name %> + <%= f.text_field :name, as: :string, class: 'input-medium required' %>
- <% lbl = _("Check this box when you are ready for guidance associated with this group to appear on user's plans.") %> - + " aria-label="<%= _('More information: Guidance group names') %>">
- <% end %> - -
- <%= f.label _('Optional Subset'), for: :optional_subset %> - <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> - -
- - -
-
-
 
- <%= 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", role:"button" %> + + + <% if @guidance_group.published == true then %> +
+ <%= f.label _('Published'), for: :published %> + <%= f.check_box :published %> +
+ <% lbl = _("Check this box when you are ready for guidance associated with this group to appear on user's plans.") %> + + +
+
<% end %> -
-
- <% end %> + +
+ <%= f.label _('Optional Subset'), for: :optional_subset %> + <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> + +
+ + +
+
+
 
+ <%= 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", role:"button" %> + <% end %> +
+
+ <% end %> +
+ diff --git a/app/views/guidance_groups/admin_new.html.erb b/app/views/guidance_groups/admin_new.html.erb index a22ae2b..a34bf17 100644 --- a/app/views/guidance_groups/admin_new.html.erb +++ b/app/views/guidance_groups/admin_new.html.erb @@ -1,37 +1,37 @@ <% javascript 'admin.js' %> -

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

+

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

-
- <%= form_for :guidance_group, url: {action: "admin_create"}, html: {class: 'roadmap-form bordered'} do |f| %> -
-
- <%= f.label _('Name'), for: :name %> - <%= f.text_field :name, as: :string, class: "input-medium required" %> - -
-
- <%= f.label _('Optional Subset'), for: :optional_subset %> - <%= f.check_box :optional_subset %> <%= _('e.g. School/ Department') %> -
- <% end %> + +
+
+
 
+ <%= 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 8f617f8..8398dfc 100644 --- a/app/views/guidances/admin_edit.html.erb +++ b/app/views/guidances/admin_edit.html.erb @@ -1,46 +1,46 @@ <% javascript 'views/guidances/admin_edit.js' %> -

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

+

<%= _('Guidance') %>

-
- <%= form_for(@guidance, url: admin_update_guidance_path(@guidance), html: { method: :put , id: 'edit_guidance_form', class: 'roadmap-form bordered'}) do |f| %> -
-
- <%= f.label _('Text'), for: @guidance.text %> - <%= text_area_tag("guidance-text", @guidance.text, class: "tinymce") %> -
- <% lbl = %> - - -
-
-
- <%= f.label _('Themes'), for: :theme_ids %> - <%= f.collection_select(:theme_ids, @themes, :id, :title, - {prompt: false, include_blank: 'None'}, {multiple: true, title: _('Select which theme(s) this guidance relates to.')})%> -
-
- <%= f.label _('Published'), for: :published %> - <%= f.check_box :published , as: :check_boxes, title: _("Check this box when you are ready for this guidance to appear on user's plans.") %> -
-
- <%= f.label _('Guidance group'), for: :guidance_group_id %> - <%= 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.')})%> -
+
+
+ <%= form_for(@guidance, url: admin_update_guidance_path(@guidance), html: { method: :put , id: 'edit_guidance_form', class: 'roadmap-form bordered'}) do |f| %> +
+
+ <%= f.label _('Text'), for: @guidance.text %> + <%= text_area_tag("guidance-text", @guidance.text, class: "tinymce") %> +
+ <% lbl = %> + + +
+
+
+ <%= f.label _('Themes'), for: :theme_ids %> + <%= f.collection_select(:theme_ids, @themes, :id, :title, + {prompt: false, include_blank: 'None'}, {multiple: true, title: _('Select which theme(s) this guidance relates to.')})%> +
+
+ <%= f.label _('Published'), for: :published %> + <%= f.check_box :published , as: :check_boxes, title: _("Check this box when you are ready for this guidance to appear on user's plans.") %> +
+
+ <%= f.label _('Guidance group'), for: :guidance_group_id %> + <%= 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.')})%> +
-
-
-
 
- -
-
-<%end%> - +
+
+
 
+ +
+
+ <%end%> +
+
<%= tinymce :content_css => asset_path('application.css') %> diff --git a/app/views/guidances/admin_index.html.erb b/app/views/guidances/admin_index.html.erb index 71b4082..27b2b8a 100644 --- a/app/views/guidances/admin_index.html.erb +++ b/app/views/guidances/admin_index.html.erb @@ -1,141 +1,141 @@ <% 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.") %>

-
-

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

+
+
+

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

- - <% if @guidance_groups.length > 0 then%> - - - - - - - - - - - <% !@guidance_groups.each do |guidance_gr| %> - - - - - - - - - <% end %> - -
<%= _('Name') %><%= _('Published') %><%= _('Optional subset') %><%= _('Last updated') %><%= _('Actions') %> -
- <%= guidance_gr.name %> - - <% if guidance_gr.published.nil? || guidance_gr.published == false then%> - <%= _('No')%> - <% else %> - <%= _('Yes')%> - <% end %> - - <% if guidance_gr.optional_subset.nil? || guidance_gr.optional_subset == false then%> - <%= _('No')%> - <% else %> - <%= _('Yes')%> - <% end %> - - <%= l guidance_gr.updated_at.to_date, formats: :short %> - - <%= link_to _('Edit'), admin_edit_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
- <%= link_to _('Delete'), admin_destroy_guidance_group_path(guidance_gr), data: {confirm: _("You are about to delete '%{guidance_group_name}'. This will affect guidance. Are you sure?") % { :guidance_group_name => guidance_gr.name }}, method: :delete, class: "dmp_table_link"%> -
- <%end%> - -
- <%= _('Create a guidance group') %> -
-
- -

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

- -

- <%= _('You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.') %> -

-

- <%= _('If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.') %> -

- - - <% if @guidances.length > 0 then%> - - - <% if @guidances.length > 10 %> + + <% if @guidance_groups.length > 0 then%> +
+ - - - <% end %> - - - - + + + - - - <% @guidances.each do |guidance| %> - <% if guidance.in_group_belonging_to?(current_user.org_id) then %> + + + + <% !@guidance_groups.each do |guidance_gr| %> - <% if guidance.themes.present? then %> - - <% else %> - - <% end %> - <% if guidance.guidance_group.present? then %> - - <% else %> - - <% end %> - + + + + <% end %> - <% end %> - -
- <%= render(partial: "shared/table_filter", - locals: {path: admin_index_guidance_path, - placeholder: _('Filter guidance')}) %> -
<%= _('Text') %><%= _('Themes') %><%= _('Guidance group') %><%= _('Name') %><%= _('Published') %><%= _('Optional subset') %> <%= _('Last updated') %> <%= _('Actions') %> -
- <%= guidance.text.html_safe%> - - <% guidance.themes.each do |th| %> - <%= th.title %> - <% end %> - - - - - <%= guidance.guidance_group.name %> - - - - - <%= l guidance.updated_at.to_date, formats: :short %> + <%= guidance_gr.name %> - <%= link_to _('Edit'), admin_edit_guidance_path(guidance), class: "dmp_table_link"%>
- <%= link_to _('Delete'), admin_destroy_guidance_path(guidance), - data: {confirm: _("You are about to delete '%{guidance_summary}'. Are you sure?") % { :guidance_summary => truncate(sanitize(guidance.text,tags: %w(br a)), length: 20 , omission: _('... (continued)'))} }, method: :delete, class: "dmp_table_link"%> + <% if guidance_gr.published.nil? || guidance_gr.published == false then%> + <%= _('No')%> + <% else %> + <%= _('Yes')%> + <% end %> +
+ <% if guidance_gr.optional_subset.nil? || guidance_gr.optional_subset == false then%> + <%= _('No')%> + <% else %> + <%= _('Yes')%> + <% end %> + + <%= l guidance_gr.updated_at.to_date, formats: :short %> + + <%= link_to _('Edit'), admin_edit_guidance_group_path(guidance_gr), class: "dmp_table_link"%>
+ <%= link_to _('Delete'), admin_destroy_guidance_group_path(guidance_gr), data: {confirm: _("You are about to delete '%{guidance_group_name}'. This will affect guidance. Are you sure?") % { :guidance_group_name => guidance_gr.name }}, method: :delete, class: "dmp_table_link"%>
- <% end %> + + + <%end%> -
- <%= _('Create guidance') %> +
+ <%= _('Create a guidance group') %> +
+
+ +

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

+ +

+ <%= _('You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.') %> +

+

+ <%= _('If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.') %> +

+ + + <% if @guidances.length > 0 then%> + + + <% if @guidances.length > 10 %> + + + + <% end %> + + + + + + + + + <% @guidances.each do |guidance| %> + <% if guidance.in_group_belonging_to?(current_user.org_id) then %> + + + <% if guidance.themes.present? then %> + + <% else %> + + <% end %> + <% if guidance.guidance_group.present? then %> + + <% else %> + + <% end %> + + + + <% end %> + <% end %> + +
+ <%= render(partial: "shared/table_filter", + locals: {path: admin_index_guidance_path, + placeholder: _('Filter guidance')}) %> +
<%= _('Text') %><%= _('Themes') %><%= _('Guidance group') %><%= _('Last updated') %><%= _('Actions') %> +
+ <%= guidance.text.html_safe%> + + <% guidance.themes.each do |th| %> + <%= th.title %> + <% end %> + + - + + <%= guidance.guidance_group.name %> + + - + + <%= l guidance.updated_at.to_date, formats: :short %> + + <%= link_to _('Edit'), admin_edit_guidance_path(guidance), class: "dmp_table_link"%>
+ <%= link_to _('Delete'), admin_destroy_guidance_path(guidance), + data: {confirm: _("You are about to delete '%{guidance_summary}'. Are you sure?") % { :guidance_summary => truncate(sanitize(guidance.text,tags: %w(br a)), length: 20 , omission: _('... (continued)'))} }, method: :delete, class: "dmp_table_link"%> +
+ <% end %> + +
+ <%= _('Create guidance') %> +
diff --git a/app/views/guidances/admin_new.html.erb b/app/views/guidances/admin_new.html.erb index a487cb5..ee25eae 100644 --- a/app/views/guidances/admin_new.html.erb +++ b/app/views/guidances/admin_new.html.erb @@ -1,46 +1,46 @@ <% javascript 'views/guidances/admin_edit.js' %> -

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

+

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

-
- <%= form_for :guidance, url: {action: 'admin_create'}, html: {id: 'edit_guidance_form', class: 'roadmap-form bordered'} do |f| %> -
-
- <%= f.label :text %> - <%= text_area_tag("guidance-text", "", class: "tinymce") %> -
- <% lbl = _('Enter your guidance here. You can include links where needed.') %> - - +
+
+ <%= form_for :guidance, url: {action: 'admin_create'}, html: {id: 'edit_guidance_form', class: 'roadmap-form bordered'} do |f| %> +
+
+ <%= f.label :text %> + <%= text_area_tag("guidance-text", "", class: "tinymce") %> +
+ <% lbl = _('Enter your guidance here. You can include links where needed.') %> + + +
-
-
- <%= f.label _('Themes'), for: :theme_ids %> - <%= f.collection_select(:theme_ids, @themes, - :id, :title, {prompt: false, include_blank: 'None'}, {multiple: true, title: _('Select which theme(s) this guidance relates to.')}) %> -
-
- <%= f.label :published %> - <%= f.check_box :published , as: :check_boxes, title: _("Check this box when you are ready for this guidance to appear on user's plans.") %> -
-
- <%= f.label _('Guidance group'), for: :guidance_group_id %> - <%= 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.')})%> -
+
+ <%= f.label _('Themes'), for: :theme_ids %> + <%= f.collection_select(:theme_ids, @themes, + :id, :title, {prompt: false, include_blank: 'None'}, {multiple: true, title: _('Select which theme(s) this guidance relates to.')}) %> +
+
+ <%= f.label :published %> + <%= f.check_box :published , as: :check_boxes, title: _("Check this box when you are ready for this guidance to appear on user's plans.") %> +
+
+ <%= f.label _('Guidance group'), for: :guidance_group_id %> + <%= 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.')})%> +
-
-
-
 
- -
-
- <% end %> +
+
+
 
+ +
+ + <% end %> +
<%= tinymce :content_css => asset_path('application.css') %> diff --git a/app/views/guidances/untitled.txt b/app/views/guidances/untitled.txt deleted file mode 100644 index e69de29..0000000 --- a/app/views/guidances/untitled.txt +++ /dev/null diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ae609df..ac6511e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,9 +1,8 @@ <%= javascript 'views/home/index.js' %> +
+
+

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

-

<%= _('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]} %>

@@ -23,7 +22,7 @@
-
+
<%= render partial: 'shared/signin' %>
-
+
\ No newline at end of file diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 0afb421..3d0e76d 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -1,5 +1,5 @@ - -