diff --git a/README.md b/README.md index f354ea3..b697a06 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 4. To allow collaborative work when creating Data Management Plans. #### Current Release -[v1.1.2](https://github.com/DMPRoadmap/roadmap/releases/tag/v1.1.2) +[v1.1.3](https://github.com/DMPRoadmap/roadmap/releases/tag/v1.1.3) [![Build Status](https://travis-ci.org/DMPRoadmap/roadmap.svg)](https://travis-ci.org/DMPRoadmap/roadmap) #### Pre-requisites diff --git a/app/views/guidance_groups/admin_edit.html.erb b/app/views/guidance_groups/admin_edit.html.erb index ec5def9..606af02 100644 --- a/app/views/guidance_groups/admin_edit.html.erb +++ b/app/views/guidance_groups/admin_edit.html.erb @@ -2,9 +2,7 @@

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

- + <%= link_to _('View all guidance'), admin_index_guidance_path(current_user.org_id), class: 'btn btn-default pull-right' %>
diff --git a/app/views/guidances/admin_index.html.erb b/app/views/guidances/admin_index.html.erb index 56190a3..15c1f2c 100644 --- a/app/views/guidances/admin_index.html.erb +++ b/app/views/guidances/admin_index.html.erb @@ -21,9 +21,7 @@ scope: @guidance_groups, query_params: { sort_field: 'guidance_groups.name', sort_direction: :asc }) %>
- + <%= _('Create a guidance group') %>

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

@@ -44,9 +42,7 @@ query_params: { sort_field: 'guidances.text', sort_direction: :asc }) %>
- + <%= _('Create guidance') %>
diff --git a/app/views/guidances/new_edit.html.erb b/app/views/guidances/new_edit.html.erb index f635228..66e3e2c 100644 --- a/app/views/guidances/new_edit.html.erb +++ b/app/views/guidances/new_edit.html.erb @@ -3,9 +3,7 @@

<%= _('Guidance') %>

- + <%= link_to _('View all guidance'), admin_index_guidance_path(current_user.org_id), class: 'btn btn-default pull-right' %>
@@ -28,9 +26,7 @@
<%= f.submit _('Save'), name: "edit_guidance_submit", class: "btn btn-primary" %> - + <%= link_to _('Cancel'), admin_index_guidance_path, class: "btn btn-primary", role: 'button' %>
<%end%> diff --git a/app/views/org_admin/plans/index.html.erb b/app/views/org_admin/plans/index.html.erb index c96f956..0c89215 100644 --- a/app/views/org_admin/plans/index.html.erb +++ b/app/views/org_admin/plans/index.html.erb @@ -35,9 +35,7 @@ <% end %> <% if @plans.length > 0 %> - + <%= link_to _('Download plans'), org_admin_download_plans_path(format: :csv), target: '_blank', class: 'btn btn-default pull-right' %> <%= paginable_renderise( partial: '/paginable/plans/org_admin', controller: 'paginable/plans', diff --git a/app/views/org_admin/templates/index.html.erb b/app/views/org_admin/templates/index.html.erb index 6dc4fc4..ad18404 100644 --- a/app/views/org_admin/templates/index.html.erb +++ b/app/views/org_admin/templates/index.html.erb @@ -76,9 +76,8 @@ - + + <%= _('Create a template') %> + \ No newline at end of file diff --git a/app/views/phases/_overview.html.erb b/app/views/phases/_overview.html.erb index 0907d69..f216c85 100644 --- a/app/views/phases/_overview.html.erb +++ b/app/views/phases/_overview.html.erb @@ -3,9 +3,7 @@

<%= _('Instructions') %> - + <%= _('Write plan') %>

<%= raw(phase.description) %> diff --git a/app/views/plans/_share_form.html.erb b/app/views/plans/_share_form.html.erb index 3b89316..9caf694 100644 --- a/app/views/plans/_share_form.html.erb +++ b/app/views/plans/_share_form.html.erb @@ -104,11 +104,8 @@

<%= _('Click below to give data management staff at your organisation access to read and comment on your plan.') %>

<%= _('You can continue to edit and download the plan in the interim.') %>

-
- - <%= _("Feedback has been requested.") if @plan.feedback_requested? %> -
+
+ <%= link_to _('Request feedback'), request_feedback_plan_path, class: "btn btn-default#{' disabled' if @plan.feedback_requested?}" %> + <%= _("Feedback has been requested.") if @plan.feedback_requested? %>
<% end %> \ No newline at end of file diff --git a/app/views/plans/index.html.erb b/app/views/plans/index.html.erb index 2e721b1..862d276 100644 --- a/app/views/plans/index.html.erb +++ b/app/views/plans/index.html.erb @@ -26,9 +26,7 @@
- + <%= 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 35ae713..963960e 100644 --- a/app/views/plans/new.html.erb +++ b/app/views/plans/new.html.erb @@ -89,9 +89,7 @@ <%= f.hidden_field(:visibility, value: @is_test ? 'is_test' : Rails.application.config.default_plan_visibility) %> <%= f.button(_('Create plan'), class: "btn btn-primary", type: "submit") %> - + <%= link_to _('Cancel'), plans_path, class: 'btn btn-default' %> <% end %>
diff --git a/app/views/shared/_sign_in_form.html.erb b/app/views/shared/_sign_in_form.html.erb index 7608dba..bd4af43 100644 --- a/app/views/shared/_sign_in_form.html.erb +++ b/app/views/shared/_sign_in_form.html.erb @@ -19,12 +19,10 @@ <% if session['devise.shibboleth_data'].nil? %>

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

- + + <% target = (Rails.application.config.shibboleth_use_filtered_discovery_service ? shibboleth_ds_path : user_shibboleth_omniauth_authorize_path) %> + <%= _('Sign in with your institutional credentials') %> +
<% else %> <%= f.hidden_field :shibboleth_id, :value => session['devise.shibboleth_data']['uid'] %> diff --git a/app/views/super_admin/notifications/_form.html.erb b/app/views/super_admin/notifications/_form.html.erb index eddfa85..c6ff825 100644 --- a/app/views/super_admin/notifications/_form.html.erb +++ b/app/views/super_admin/notifications/_form.html.erb @@ -61,8 +61,6 @@ class: 'btn btn-default', method: :delete, data: { confirm: _('Are you sure you want to delete the notification "%{title}"') % { title: @notification.title }}) unless @notification.new_record? %> - + <%= link_to _('Cancel'), super_admin_notifications_path, class: 'btn btn-default', role: 'button' %> <% end %> diff --git a/app/views/super_admin/notifications/index.html.erb b/app/views/super_admin/notifications/index.html.erb index 0d4fc7b..216d7ee 100644 --- a/app/views/super_admin/notifications/index.html.erb +++ b/app/views/super_admin/notifications/index.html.erb @@ -7,10 +7,7 @@
- - + <%= link_to _('+ Add New Notification'), new_super_admin_notification_path, class: 'btn btn-default', role: 'button' %>
<%= paginable_renderise( diff --git a/app/views/super_admin/orgs/index.html.erb b/app/views/super_admin/orgs/index.html.erb index e3e08b6..ef42981 100644 --- a/app/views/super_admin/orgs/index.html.erb +++ b/app/views/super_admin/orgs/index.html.erb @@ -4,10 +4,8 @@
diff --git a/app/views/super_admin/themes/index.html.erb b/app/views/super_admin/themes/index.html.erb index 63582bf..917e48a 100644 --- a/app/views/super_admin/themes/index.html.erb +++ b/app/views/super_admin/themes/index.html.erb @@ -7,9 +7,7 @@
- + <%= link_to(_('+ Add New Theme'), new_super_admin_theme_path, class: 'btn btn-default', role: 'button') %>
<%= paginable_renderise( diff --git a/lib/assets/stylesheets/overrides.scss b/lib/assets/stylesheets/overrides.scss index 6d35866..6383889 100644 --- a/lib/assets/stylesheets/overrides.scss +++ b/lib/assets/stylesheets/overrides.scss @@ -233,7 +233,7 @@ background-color: $grey; color: $white; border-color: $grey; - outline-color: transparent; + outline: none; margin-top: 5px; margin-bottom: 10px; } @@ -249,7 +249,7 @@ background-color: $grey; color: $white; border-color: $grey; - outline-color: transparent; + outline: none; margin-top: 5px; margin-bottom: 10px; } @@ -631,4 +631,4 @@ position: absolute !important; width: 1px; word-wrap: normal !important; -} \ No newline at end of file +} diff --git a/lib/tasks/upgrade.rake b/lib/tasks/upgrade.rake index 9b625c2..14ecfbe 100644 --- a/lib/tasks/upgrade.rake +++ b/lib/tasks/upgrade.rake @@ -6,6 +6,7 @@ Rake::Task['upgrade:check_org_contact_emails'].execute Rake::Task['upgrade:check_for_guidance_multiple_themes'].execute Rake::Task['upgrade:remove_admin_preferences'].execute + Rake::Task['upgrade:add_other_org'].execute end desc "Upgrade to 1.0" @@ -433,4 +434,42 @@ end end end + + desc "Add the 'other' org if it is not present." + task add_other_org: :environment do + puts "Checking for existence of an 'Other' org. Unaffiliated users should be affiliated with this org" + + # Get the helpdesk email from the branding YAML + branding = YAML.load(File.open('./config/branding.yml')) + if branding.present? && branding['defaults'].present? && branding['defaults']['organisation'].present? && branding['defaults']['organisation']['helpdesk_email'].present? + email = branding['defaults']['organisation']['helpdesk_email'] + name = branding['defaults']['organisation']['name'].present? ? "#{branding['defaults']['organisation']['name']} helpdesk" : 'Helpdesk' + else + email = 'other.organisation@example.org' + name = 'Helpdesk' + end + + other_org = Org.find_by(is_other: true) + if other_org.present? + puts "Found the 'Other' org (is_other == true)" + else + puts "Could not find the 'Other' org (is_other == true), adding 'Other' org" + other_org = Org.create!({ + name: 'Other Organisation', + abbreviation: 'OTHER', + org_type: Org.org_type_values_for(:organisation).min, + contact_email: email, + contact_name: name, + links: {"org": []}, + is_other: true, + }) + end + + unaffiliated = User.where(org_id: nil) + unless unaffiliated.empty? + puts "The following users are not associated with an org. Assigning them to the 'Other' org." + puts unaffiliated.collect(&:email).join(', ') + unaffiliated.update_all(org_id: other_org.id) + end + end end