From 494931c51754fc6673a29fd3562f98366a54daa6 Mon Sep 17 00:00:00 2001 From: briri Date: Thu, 7 Oct 2021 15:20:12 -0700 Subject: [PATCH 01/43] updated PDF coversheet to always show the creator of the DMP --- app/helpers/exports_helper.rb | 6 ------ app/models/concerns/exportable_plan.rb | 9 ++++----- app/views/shared/export/_plan_coversheet.erb | 4 +--- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/app/helpers/exports_helper.rb b/app/helpers/exports_helper.rb index 10cdfc9405..021d222944 100644 --- a/app/helpers/exports_helper.rb +++ b/app/helpers/exports_helper.rb @@ -33,12 +33,6 @@ def margin_right get_margin_value_for_side(:right) end - def plan_attribution(attribution) - attribution = Array(attribution) - prefix = attribution.many? ? _("Creators:") : _("Creator:") - "#{prefix} #{attribution.join(', ')}" - end - private def get_margin_value_for_side(side) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index 5d8d66a1b8..c3189c3309 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -95,11 +95,10 @@ def prepare(user, coversheet = false) # rubocop:disable Metrics/AbcSize def prepare_coversheet hash = {} - # name of owner and any co-owners - attribution = owner.present? ? [owner.name(false)] : [] - roles.administrator.not_creator.each do |role| - attribution << role.user.name(false) - end + # Use the name of the DMP owner/creator OR the first Co-owner if there is no + # owner for some reason + attribution = roles.creator.first&.user&.name(false) + roles.administrator.not_creator.first&.user&.name(false) unless attribution.present? hash[:attribution] = attribution # Org name of plan owner's org diff --git a/app/views/shared/export/_plan_coversheet.erb b/app/views/shared/export/_plan_coversheet.erb index df16331646..370fdf2338 100644 --- a/app/views/shared/export/_plan_coversheet.erb +++ b/app/views/shared/export/_plan_coversheet.erb @@ -3,9 +3,7 @@

<%= _("A Data Management Plan created using %{application_name}") % { application_name: ApplicationService.application_name } %>


- <%# Using tags as the htmltoword gem does not recognise css styles defined %> - <%# Allow raw html (==) for plan_attribution as it has tags %> -

<%== plan_attribution(@hash[:attribution]) %>


+

<%= _("Creator:") %><%= @hash[:attribution] %>


<%= _("Affiliation: ") %><%= @hash[:affiliation] %>


From 66b48667546c86755d00b96e654549b6ec1f73b1 Mon Sep 17 00:00:00 2001 From: briri Date: Tue, 26 Oct 2021 08:31:40 -0700 Subject: [PATCH 02/43] minor fix for issue generating PDF when no options were specified --- app/views/shared/export/_plan.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/export/_plan.erb b/app/views/shared/export/_plan.erb index f5c2e45e83..9e38de461f 100644 --- a/app/views/shared/export/_plan.erb +++ b/app/views/shared/export/_plan.erb @@ -57,7 +57,7 @@ <% else %> <%# case where Question has options %> - <% if options.any? %> + <% if options.present? && options.any? %>
    <% options.each do |opt| %>
  • <%= opt.text %>
  • From 2d3fc80fe8fec3a1b0ca85f967b3bcac59208ede Mon Sep 17 00:00:00 2001 From: John Pinto Date: Wed, 17 Nov 2021 13:00:08 +0000 Subject: [PATCH 03/43] Issue #2941 - Make the display of the phome number in the Plan contributor form configurable. Fix for #2941 Changes: - Added a property a boolean valued property config.x.application.display_contributor_phone_number to config/initializers/_dmproadmap.rb. - Wrapped the phone number field in app/views/contributors/_form.html.erb in a if Rails.configuration.x.application.display_contributor_phone_number statement. --- app/views/contributors/_form.html.erb | 26 ++++++++++++++------------ config/initializers/_dmproadmap.rb | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/views/contributors/_form.html.erb b/app/views/contributors/_form.html.erb index 3dcd50d396..b502e756b4 100644 --- a/app/views/contributors/_form.html.erb +++ b/app/views/contributors/_form.html.erb @@ -38,19 +38,21 @@ roles_tooltip = _("Select each role that applies to the contributor.") <% end %>
-
-
- <%= form.label(:phone, _("Phone number"), class: "control-label") %> -
-
- <%= phone_tooltip %> - <%= form.phone_field :phone, class: "form-control", - title: phone_tooltip, - data: { toggle: "tooltip" }, - pattern: "[0-9\-\.\(\)\+]+", - placeholder: "123-123-1234" %> +<% if Rails.configuration.x.application.display_contributor_phone_number %> +
+
+ <%= form.label(:phone, _("Phone number"), class: "control-label") %> +
+
+ <%= phone_tooltip %> + <%= form.phone_field :phone, class: "form-control", + title: phone_tooltip, + data: { toggle: "tooltip" }, + pattern: "[0-9\-\.\(\)\+]+", + placeholder: "123-123-1234" %> +
-
+<% end %>
diff --git a/config/initializers/_dmproadmap.rb b/config/initializers/_dmproadmap.rb index 0d44e72c5f..207d09e4ac 100644 --- a/config/initializers/_dmproadmap.rb +++ b/config/initializers/_dmproadmap.rb @@ -115,6 +115,8 @@ class Application < Rails::Application } # Setting to only take orgs from local and not allow on-the-fly creation config.x.application.restrict_orgs = false + # Setting to display phone number in contributor form + config.x.application.display_contributor_phone_number = false # ------------------- # # SHIBBOLETH SETTINGS # From db783fc2aad5bcca5eb688ad09914a4952a2c2bc Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 23 Nov 2021 13:28:11 +0000 Subject: [PATCH 04/43] Issue#dcc2983 - Fix for preventing adding a Contributor via Contributor form for Plan based on whether email and/or name are required. Fix for DCC bug https://github.com/DMPRoadmap/roadmap/issues/2983 Changes: - Added two new properties to config/initializers/_dmproadmap.rb (both devault to false): config.x.application.require_contributor_name = false config.x.application.require_contributor_email = false -In Contributor model the private method name_or_email_presence() has been updated to take account of the above mentioned property settings. --- app/models/contributor.rb | 33 ++++++++++++++++++++++++++---- config/initializers/_dmproadmap.rb | 4 ++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index f177935ad9..bdcce6c10b 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -130,11 +130,36 @@ def merge(other) private + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength def name_or_email_presence - return true unless name.blank? && email.blank? - - errors.add(:name, _("can't be blank if no email is provided")) - errors.add(:email, _("can't be blank if no name is provided")) + return true unless (name.blank? && email.blank?) || + (!!Rails.configuration.x.application.require_contributor_name && + name.blank?) || + (!!Rails.configuration.x.application.require_contributor_email && + email.blank?) + + # Error messages for case where name.blank? and email.blank? and + # properties Rails.configuration.x.application.require_contributor_name and + # Rails.configuration.x.application.require_contributor_email both not set (i.e, nil) or false. + if (name.blank? && email.blank?) && + !Rails.configuration.x.application.require_contributor_name && + !Rails.configuration.x.application.require_contributor_email + errors.add(:name, _("can't be blank if no email is provided.")) + errors.add(:email, _("can't be blank if no name is provided.")) + else + + # Error messages cases where enither ame.blank? or email.blank? + if name.blank? && !!Rails.configuration.x.application.require_contributor_name + errors.add(:name, _("can't be blank.")) + end + + if email.blank? && !!Rails.configuration.x.application.require_contributor_email + errors.add(:email, _("can't be blank.")) + end + end end + # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/AbcSize end diff --git a/config/initializers/_dmproadmap.rb b/config/initializers/_dmproadmap.rb index 0d44e72c5f..a084149670 100644 --- a/config/initializers/_dmproadmap.rb +++ b/config/initializers/_dmproadmap.rb @@ -116,6 +116,10 @@ class Application < Rails::Application # Setting to only take orgs from local and not allow on-the-fly creation config.x.application.restrict_orgs = false + # Setting require contributor requirement of contributor name and email + config.x.application.require_contributor_name = false + config.x.application.require_contributor_email = false + # ------------------- # # SHIBBOLETH SETTINGS # # ------------------- # From 2c00cde8a1fb917aaa38eb810f70e6a1fa178dbe Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 23 Dec 2021 16:47:00 +0000 Subject: [PATCH 05/43] Issue#3069 - (DCC Issue 675) - Org Admin and Super Admin searches and pagination of user's plans broken. Fix for issue #3069 and DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/675. Changes: - Replaced view files /paginable/plans/org_admin_other_user with /paginable/plans/_index.html.erb with extra checks for plan.owner.present? as missing plan.owner broke a DCC user's plans being render by org_admin. - Replaced partial with '/paginable/plans/org_admin_other_user' with '/paginable/plans/index', replaced action'org_admin_other_user' with 'index' in paginable_renderiser() method in views /org_admin/users/edit.html.erb. /org_admin/users/plans.html.erb and /super_admin/users/edit.html.erb. - In Paginable::PlansController replaced - # GET /paginable/plans/org_admin/:page with # GET /paginable/users/:id/plans associated with method org_admin_other_user() renamed index() - Routes replaced get "org_admin_other_user/:page", action: :org_admin_other_user, on: :collection, as: :org_admin_other_user # Paginable actions for users resources :users, only: [] do get "index/:page", action: :index, on: :collection, as: :index with resources :users, only: %i[index] do member do resources :plans, only: %(index) end end --- app/controllers/paginable/plans_controller.rb | 9 +++++---- app/views/org_admin/users/edit.html.erb | 4 ++-- app/views/org_admin/users/plans.html.erb | 4 ++-- ...{_org_admin_other_user.html.erb => _index.html.erb} | 4 ++-- app/views/super_admin/users/edit.html.erb | 4 ++-- config/routes.rb | 10 +++++----- 6 files changed, 18 insertions(+), 17 deletions(-) rename app/views/paginable/plans/{_org_admin_other_user.html.erb => _index.html.erb} (90%) diff --git a/app/controllers/paginable/plans_controller.rb b/app/controllers/paginable/plans_controller.rb index e29d26bdf9..be737e91e8 100644 --- a/app/controllers/paginable/plans_controller.rb +++ b/app/controllers/paginable/plans_controller.rb @@ -59,8 +59,8 @@ def org_admin ) end - # GET /paginable/plans/org_admin/:page - def org_admin_other_user + # GET /paginable/users/:id/plans + def index @user = User.find(params[:id]) authorize @user unless current_user.present? && current_user.can_org_admin? && @user.present? @@ -68,9 +68,10 @@ def org_admin_other_user end paginable_renderise( - partial: "org_admin_other_user", + partial: "index", scope: Plan.active(@user), - query_params: { sort_field: "plans.updated_at", sort_direction: :desc } + query_params: { sort_field: "plans.updated_at", sort_direction: :desc }, + format: :json ) end diff --git a/app/views/org_admin/users/edit.html.erb b/app/views/org_admin/users/edit.html.erb index 5c294ab297..e144293b34 100644 --- a/app/views/org_admin/users/edit.html.erb +++ b/app/views/org_admin/users/edit.html.erb @@ -75,9 +75,9 @@
<%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %>
diff --git a/app/views/org_admin/users/plans.html.erb b/app/views/org_admin/users/plans.html.erb index 25f05671a3..1381e16f34 100644 --- a/app/views/org_admin/users/plans.html.erb +++ b/app/views/org_admin/users/plans.html.erb @@ -7,9 +7,9 @@
<%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', remote: true, scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %> diff --git a/app/views/paginable/plans/_org_admin_other_user.html.erb b/app/views/paginable/plans/_index.html.erb similarity index 90% rename from app/views/paginable/plans/_org_admin_other_user.html.erb rename to app/views/paginable/plans/_index.html.erb index 1ea1cd663b..aff6854691 100644 --- a/app/views/paginable/plans/_org_admin_other_user.html.erb +++ b/app/views/paginable/plans/_index.html.erb @@ -21,8 +21,8 @@ <% end %> <%= plan.template.title %> - <%= plan.owner.org.name %> - <%= plan.owner.name(false) %> + <%= plan.owner.org.name if plan.owner.present? %> + <%= plan.owner.name(false) if plan.owner.present? %> <%= l(plan.updated_at.to_date, formats: :short) %> <%= plan.visibility === 'is_test' ? _('Test') : sanitize(display_visibility(plan.visibility)) %> diff --git a/app/views/super_admin/users/edit.html.erb b/app/views/super_admin/users/edit.html.erb index abc4870e33..098af7517a 100644 --- a/app/views/super_admin/users/edit.html.erb +++ b/app/views/super_admin/users/edit.html.erb @@ -109,9 +109,9 @@
<%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %>
diff --git a/config/routes.rb b/config/routes.rb index 1960a85ec2..15fbd98452 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -210,17 +210,17 @@ get "org_admin/:page", action: :org_admin, on: :collection, as: :org_admin - get "org_admin_other_user/:page", action: :org_admin_other_user, - on: :collection, as: :org_admin_other_user - # Paginable actions for contributors resources :contributors, only: %i[index] do get "index/:page", action: :index, on: :collection, as: :index end end + # Paginable actions for users - resources :users, only: [] do - get "index/:page", action: :index, on: :collection, as: :index + resources :users, only: %i[index] do + member do + resources :plans, only: %(index) + end end # Paginable actions for themes resources :themes, only: [] do From 1173d60b58f6e3f167233f2a45c782f0d622f297 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 11 Jan 2022 11:58:03 +0000 Subject: [PATCH 06/43] Bug DCC Issues 592, 645 - Fix for Org Admins seeing deleted Plans for Org. Fixes issues: https://github.com/DigitalCurationCentre/DMPonline-Service/issues/592 https://github.com/DigitalCurationCentre/DMPonline-Service/issues/645 https://github.com/DigitalCurationCentre/DMPonline-Service/issues/641 The reason we are seeing deleted (de-activated) Plans is that there is no filter for plans with Roles active in the Org model's org_admin_plans() method. Change added .where(roles: { active: true }) to filter plans in org_admin_plans() method of Org model. --- app/models/org.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/org.rb b/app/models/org.rb index de2526de38..07358d5a90 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -287,10 +287,12 @@ def org_admin_plans if Rails.configuration.x.plans.org_admins_read_all Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids) + .where(roles: { active: true }) else Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids) .where.not(visibility: Plan.visibilities[:privately_visible]) .where.not(visibility: Plan.visibilities[:is_test]) + .where(roles: { active: true }) end end From b2cded74ae8d9bc40b4dedf95069517f9a4ae3c4 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Mon, 10 Jan 2022 11:03:45 +0000 Subject: [PATCH 07/43] Issue DCC-674: Fix for broken CSV Download noticed because a nil exception occuring for an answer with question options selected but text nil. Link to issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/674 Change to app/models/concerns/exportable_plan.rb, we replaced line answer_text += answer.text if answer.answered? with answer.text present check answer_text += answer.text if answer.answered? && answer.text.present? --- app/models/concerns/exportable_plan.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index 5d8d66a1b8..4e4c72e73a 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -170,7 +170,7 @@ def show_section_for_csv(csv, phase, section, headings, unanswered, hash) if answer.question_options.any? answer_text += answer.question_options.pluck(:text).join(", ") end - answer_text += answer.text if answer.answered? + answer_text += answer.text if answer.answered? && answer.text.present? elsif unanswered answer_text += _("Not Answered") end From d5144d93907e39415517f9f9d9c534bcd45502fa Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 13 Jan 2022 12:13:19 +0000 Subject: [PATCH 08/43] DCC Issue 679 - Fix for issue that Super Admins unable to create new Orgs. Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/679 Changes: - in app/controllers/super_admin/orgs_controller.rb added missing params to orgs_params method :funder, :institution, :organisation - in app/models/org.rb removed (as it is never set on Org creation) validates :abbreviation, presence: { message: PRESENCE_MESSAGE } - in app/views/orgs/_profile_form.html.erb removed :abbreviation required "aria-required": true - in app/views/shared/org_selectors/_external_only.html.erb renamed wrongly named text field :org_name to :name <%= form.label :name, label %> <%= form.text_field :name, class: "form-control autocomplete", --- app/controllers/super_admin/orgs_controller.rb | 3 ++- app/models/org.rb | 2 -- app/views/orgs/_profile_form.html.erb | 2 +- app/views/shared/org_selectors/_external_only.html.erb | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/controllers/super_admin/orgs_controller.rb b/app/controllers/super_admin/orgs_controller.rb index 6e2c49634b..fd427143f9 100644 --- a/app/controllers/super_admin/orgs_controller.rb +++ b/app/controllers/super_admin/orgs_controller.rb @@ -150,7 +150,8 @@ def org_params params.require(:org).permit(:name, :abbreviation, :logo, :managed, :contact_email, :contact_name, :remove_logo, :feedback_enabled, :feedback_msg, - :org_id, :org_name, :org_crosswalk) + :org_id, :org_name, :org_crosswalk, + :funder, :institution, :organisation) end def merge_params diff --git a/app/models/org.rb b/app/models/org.rb index de2526de38..666096684e 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -93,8 +93,6 @@ class Org < ApplicationRecord validates :name, presence: { message: PRESENCE_MESSAGE }, uniqueness: { message: UNIQUENESS_MESSAGE } - validates :abbreviation, presence: { message: PRESENCE_MESSAGE } - validates :is_other, inclusion: { in: BOOLEAN_VALUES, message: PRESENCE_MESSAGE } diff --git a/app/views/orgs/_profile_form.html.erb b/app/views/orgs/_profile_form.html.erb index 15971d2c3c..5226143c6d 100644 --- a/app/views/orgs/_profile_form.html.erb +++ b/app/views/orgs/_profile_form.html.erb @@ -25,7 +25,7 @@
<%= f.label :abbreviation, _('Organisation abbreviated name'), class: "control-label" %> - <%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control", "aria-required": true %> + <%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control" %>
<% end %> diff --git a/app/views/shared/org_selectors/_external_only.html.erb b/app/views/shared/org_selectors/_external_only.html.erb index daf0ef3456..9353e1c05a 100644 --- a/app/views/shared/org_selectors/_external_only.html.erb +++ b/app/views/shared/org_selectors/_external_only.html.erb @@ -13,8 +13,8 @@ presenter = OrgSelectionPresenter.new(orgs: [default_org], placeholder = _("Begin typing to see a list of suggestions.") %> -<%= form.label :org_name, label %> -<%= form.text_field :org_name, class: "form-control autocomplete", +<%= form.label :name, label %> +<%= form.text_field :name, class: "form-control autocomplete", placeholder: placeholder, value: presenter.name, spellcheck: true, From 1512944d9e6b10f18b9490f6b9112b7a92fff2ee Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 18 Jan 2022 11:11:06 +0000 Subject: [PATCH 09/43] TEMP CHANGE FOR DCC 453 BUG --- app/views/api/v0/statistics/plans.json.jbuilder | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index bfef9c9061..3106111efc 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -21,6 +21,10 @@ json.plans @org_plans.each do |plan| json.name plan.contributors.investigation.first&.name end + json.owners plan.owner_and_coowners.each do |owner| + json.email owner.email + end + json.data_contact do json.info plan.contributors.data_curation.first&.name end From 8df635f124d08cd5e7067cdd51c1844b7a804072 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Wed, 19 Jan 2022 09:26:54 +0000 Subject: [PATCH 10/43] DCC bug 453 - Unlike in previous version of the DMP Roadmap a API user pointed oout that the Plan Owner email was missing in call /api/v0/statistics/plans. DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/453 Changed app/views/api/v0/statistics/plans.json.jbuilder to include owner of Plan. So extra fragment of json in each Plan now includes "owner": { "email": "abc@test.com" }, as in previous version of Roadmap. --- app/views/api/v0/statistics/plans.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index 3106111efc..813d7114e4 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -21,8 +21,8 @@ json.plans @org_plans.each do |plan| json.name plan.contributors.investigation.first&.name end - json.owners plan.owner_and_coowners.each do |owner| - json.email owner.email + json.owner do + json.email plan.owner.present? ? plan.owner.email : "" end json.data_contact do From b2eff34800afbc2afcc1da2b00e91951c125c301 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 20 Jan 2022 13:11:24 +0000 Subject: [PATCH 11/43] DCC Bug 668 - Fix for issue of roles in a plan that does not have a user_id set. This has proved in several cases. Fix for DCC bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/688 Change in the Plan model method owner_and_coowners() we check that each role we currently get also has associated user that is not nil. --- app/models/plan.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/plan.rb b/app/models/plan.rb index ddbf275cd8..42f52e42ac 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -482,7 +482,7 @@ def shared? def owner_and_coowners # We only need to search for :administrator in the bitflag # since :creator includes :administrator rights - roles.select { |r| r.active && r.administrator }.map(&:user).uniq + roles.select { |r| r.active && r.administrator && !r.user.nil? }.map(&:user).uniq end # The creator, administrator and editors From 0ddec3d2369e4a756af29df613f349cd17730765 Mon Sep 17 00:00:00 2001 From: briri Date: Thu, 7 Oct 2021 15:20:12 -0700 Subject: [PATCH 12/43] updated PDF coversheet to always show the creator of the DMP --- app/models/concerns/exportable_plan.rb | 9 ++++----- app/views/shared/export/_plan_coversheet.erb | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index d805df2b02..69159c16b0 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -104,11 +104,10 @@ def prepare(user, coversheet = false) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity def prepare_coversheet hash = {} - # name of owner and any co-owners - attribution = owner.present? ? [owner.name(false)] : [] - roles.administrator.not_creator.each do |role| - attribution << role.user.name(false) - end + # Use the name of the DMP owner/creator OR the first Co-owner if there is no + # owner for some reason + attribution = roles.creator.first&.user&.name(false) + roles.administrator.not_creator.first&.user&.name(false) unless attribution.present? hash[:attribution] = attribution # Org name of plan owner's org diff --git a/app/views/shared/export/_plan_coversheet.erb b/app/views/shared/export/_plan_coversheet.erb index df16331646..370fdf2338 100644 --- a/app/views/shared/export/_plan_coversheet.erb +++ b/app/views/shared/export/_plan_coversheet.erb @@ -3,9 +3,7 @@

<%= _("A Data Management Plan created using %{application_name}") % { application_name: ApplicationService.application_name } %>


- <%# Using tags as the htmltoword gem does not recognise css styles defined %> - <%# Allow raw html (==) for plan_attribution as it has tags %> -

<%== plan_attribution(@hash[:attribution]) %>


+

<%= _("Creator:") %><%= @hash[:attribution] %>


<%= _("Affiliation: ") %><%= @hash[:affiliation] %>


From c9b2f8f14fa40822ad485756e819ffbeb78589d8 Mon Sep 17 00:00:00 2001 From: briri Date: Tue, 26 Oct 2021 08:31:40 -0700 Subject: [PATCH 13/43] minor fix for issue generating PDF when no options were specified --- app/views/shared/export/_plan.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/export/_plan.erb b/app/views/shared/export/_plan.erb index f5c2e45e83..9e38de461f 100644 --- a/app/views/shared/export/_plan.erb +++ b/app/views/shared/export/_plan.erb @@ -57,7 +57,7 @@ <% else %> <%# case where Question has options %> - <% if options.any? %> + <% if options.present? && options.any? %>
    <% options.each do |opt| %>
  • <%= opt.text %>
  • From 53012c38f088430ab5977acac5ae553a655078a5 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Mon, 31 Jan 2022 12:52:46 +0000 Subject: [PATCH 14/43] update Gemfile.lock --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c0e95e3b9b..81eca25817 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,7 +64,7 @@ GEM debug_inspector (>= 0.0.1) bootsnap (1.10.2) msgpack (~> 1.2) - brakeman (5.2.0) + brakeman (5.2.1) builder (3.2.4) bullet (7.0.1) activesupport (>= 3.0.0) @@ -218,7 +218,7 @@ GEM httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.8.11) + i18n (1.9.1) concurrent-ruby (~> 1.0) ipaddress (0.8.3) jbuilder (2.11.5) @@ -317,7 +317,7 @@ GEM coderay (~> 1.1) method_source (~> 1.0) public_suffix (4.0.6) - puma (5.6.0) + puma (5.6.1) nio4r (~> 2.0) pundit (2.1.1) activesupport (>= 3.0.0) @@ -380,12 +380,12 @@ GEM rspec-mocks (~> 3.10.0) rspec-collection_matchers (1.2.0) rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.10.1) + rspec-core (3.10.2) rspec-support (~> 3.10.0) rspec-expectations (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-mocks (3.10.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) rspec-rails (5.1.0) From 816f1273507e7b91fb5bbd4671745e77ac45a315 Mon Sep 17 00:00:00 2001 From: briri Date: Thu, 7 Oct 2021 15:20:12 -0700 Subject: [PATCH 15/43] updated PDF coversheet to always show the creator of the DMP --- app/models/concerns/exportable_plan.rb | 9 ++++----- app/views/shared/export/_plan_coversheet.erb | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index d805df2b02..69159c16b0 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -104,11 +104,10 @@ def prepare(user, coversheet = false) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity def prepare_coversheet hash = {} - # name of owner and any co-owners - attribution = owner.present? ? [owner.name(false)] : [] - roles.administrator.not_creator.each do |role| - attribution << role.user.name(false) - end + # Use the name of the DMP owner/creator OR the first Co-owner if there is no + # owner for some reason + attribution = roles.creator.first&.user&.name(false) + roles.administrator.not_creator.first&.user&.name(false) unless attribution.present? hash[:attribution] = attribution # Org name of plan owner's org diff --git a/app/views/shared/export/_plan_coversheet.erb b/app/views/shared/export/_plan_coversheet.erb index df16331646..370fdf2338 100644 --- a/app/views/shared/export/_plan_coversheet.erb +++ b/app/views/shared/export/_plan_coversheet.erb @@ -3,9 +3,7 @@

    <%= _("A Data Management Plan created using %{application_name}") % { application_name: ApplicationService.application_name } %>


    - <%# Using tags as the htmltoword gem does not recognise css styles defined %> - <%# Allow raw html (==) for plan_attribution as it has tags %> -

    <%== plan_attribution(@hash[:attribution]) %>


    +

    <%= _("Creator:") %><%= @hash[:attribution] %>


    <%= _("Affiliation: ") %><%= @hash[:affiliation] %>


    From 6adaf461f0a6d05f25ab7db100e2164e6b4e020c Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 20 Jan 2022 13:11:24 +0000 Subject: [PATCH 16/43] DCC Bug 668 - Fix for issue of roles in a plan that does not have a user_id set. This has proved in several cases. Fix for DCC bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/688 Change in the Plan model method owner_and_coowners() we check that each role we currently get also has associated user that is not nil. --- app/models/plan.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/plan.rb b/app/models/plan.rb index 69c59d50ce..2884d28581 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -487,7 +487,7 @@ def shared? def owner_and_coowners # We only need to search for :administrator in the bitflag # since :creator includes :administrator rights - roles.select { |r| r.active && r.administrator }.map(&:user).uniq + roles.select { |r| r.active && r.administrator && !r.user.nil? }.map(&:user).uniq end # The creator, administrator and editors From 98b941bfa52db462a9380b21f07c9c3051f4b3f0 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 18 Jan 2022 11:11:06 +0000 Subject: [PATCH 17/43] TEMP CHANGE FOR DCC 453 BUG --- app/views/api/v0/statistics/plans.json.jbuilder | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index 0a975e7d14..00bd9cde09 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -21,6 +21,10 @@ json.plans @org_plans.each do |plan| json.name plan.contributors.investigation.first&.name end + json.owners plan.owner_and_coowners.each do |owner| + json.email owner.email + end + json.data_contact do json.info plan.contributors.data_curation.first&.name end From 52350999c76488b4b751bdca3f5aa8ff2d96d112 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Wed, 19 Jan 2022 09:26:54 +0000 Subject: [PATCH 18/43] DCC bug 453 - Unlike in previous version of the DMP Roadmap a API user pointed oout that the Plan Owner email was missing in call /api/v0/statistics/plans. DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/453 Changed app/views/api/v0/statistics/plans.json.jbuilder to include owner of Plan. So extra fragment of json in each Plan now includes "owner": { "email": "abc@test.com" }, as in previous version of Roadmap. --- app/views/api/v0/statistics/plans.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index 00bd9cde09..d933d333f0 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -21,8 +21,8 @@ json.plans @org_plans.each do |plan| json.name plan.contributors.investigation.first&.name end - json.owners plan.owner_and_coowners.each do |owner| - json.email owner.email + json.owner do + json.email plan.owner.present? ? plan.owner.email : "" end json.data_contact do From 147ea322c1c547b86d0381c6ed319182f4bad851 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Mon, 31 Jan 2022 13:59:35 +0000 Subject: [PATCH 19/43] rubocop fixes various minor rubocop fixes --- app/views/api/v0/statistics/plans.json.jbuilder | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/api/v0/statistics/plans.json.jbuilder b/app/views/api/v0/statistics/plans.json.jbuilder index d933d333f0..c76e9ea751 100644 --- a/app/views/api/v0/statistics/plans.json.jbuilder +++ b/app/views/api/v0/statistics/plans.json.jbuilder @@ -2,6 +2,7 @@ json.prettify! +# rubocop:disable Metrics/BlockLength json.plans @org_plans.each do |plan| json.id plan.id json.grant_number plan.grant&.value @@ -21,12 +22,12 @@ json.plans @org_plans.each do |plan| json.name plan.contributors.investigation.first&.name end - json.owner do - json.email plan.owner.present? ? plan.owner.email : "" + json.owner do + json.email plan.owner.present? ? plan.owner.email : "" end json.data_contact do - json.info plan.contributors.data_curation.first&.name + json.info plan.contributors.data_curation.first&.name end json.description plan.description @@ -39,3 +40,4 @@ json.plans @org_plans.each do |plan| json.answered_questions plan.answers.count end end +# rubocop:enable Metrics/BlockLength From b419b18a1c10f15eb779230bc7a2f807d48a1098 Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 13 Jan 2022 12:13:19 +0000 Subject: [PATCH 20/43] DCC Issue 679 - Fix for issue that Super Admins unable to create new Orgs. Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/679 Changes: - in app/controllers/super_admin/orgs_controller.rb added missing params to orgs_params method :funder, :institution, :organisation - in app/models/org.rb removed (as it is never set on Org creation) validates :abbreviation, presence: { message: PRESENCE_MESSAGE } - in app/views/orgs/_profile_form.html.erb removed :abbreviation required "aria-required": true - in app/views/shared/org_selectors/_external_only.html.erb renamed wrongly named text field :org_name to :name <%= form.label :name, label %> <%= form.text_field :name, class: "form-control autocomplete", --- app/controllers/super_admin/orgs_controller.rb | 3 ++- app/models/org.rb | 2 -- app/views/orgs/_profile_form.html.erb | 2 +- app/views/shared/org_selectors/_external_only.html.erb | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/controllers/super_admin/orgs_controller.rb b/app/controllers/super_admin/orgs_controller.rb index a2cd2fe183..50ff0b421b 100644 --- a/app/controllers/super_admin/orgs_controller.rb +++ b/app/controllers/super_admin/orgs_controller.rb @@ -153,7 +153,8 @@ def org_params params.require(:org).permit(:name, :abbreviation, :logo, :managed, :contact_email, :contact_name, :remove_logo, :feedback_enabled, :feedback_msg, - :org_id, :org_name, :org_crosswalk) + :org_id, :org_name, :org_crosswalk, + :funder, :institution, :organisation) end def merge_params diff --git a/app/models/org.rb b/app/models/org.rb index 147f64348a..5a7466f6f7 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -94,8 +94,6 @@ class Org < ApplicationRecord validates :name, presence: { message: PRESENCE_MESSAGE }, uniqueness: { message: UNIQUENESS_MESSAGE } - validates :abbreviation, presence: { message: PRESENCE_MESSAGE } - validates :is_other, inclusion: { in: BOOLEAN_VALUES, message: PRESENCE_MESSAGE } diff --git a/app/views/orgs/_profile_form.html.erb b/app/views/orgs/_profile_form.html.erb index 15971d2c3c..5226143c6d 100644 --- a/app/views/orgs/_profile_form.html.erb +++ b/app/views/orgs/_profile_form.html.erb @@ -25,7 +25,7 @@
    <%= f.label :abbreviation, _('Organisation abbreviated name'), class: "control-label" %> - <%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control", "aria-required": true %> + <%= f.text_field :abbreviation, id: "org_abbreviation", class: "form-control" %>
    <% end %> diff --git a/app/views/shared/org_selectors/_external_only.html.erb b/app/views/shared/org_selectors/_external_only.html.erb index daf0ef3456..9353e1c05a 100644 --- a/app/views/shared/org_selectors/_external_only.html.erb +++ b/app/views/shared/org_selectors/_external_only.html.erb @@ -13,8 +13,8 @@ presenter = OrgSelectionPresenter.new(orgs: [default_org], placeholder = _("Begin typing to see a list of suggestions.") %> -<%= form.label :org_name, label %> -<%= form.text_field :org_name, class: "form-control autocomplete", +<%= form.label :name, label %> +<%= form.text_field :name, class: "form-control autocomplete", placeholder: placeholder, value: presenter.name, spellcheck: true, From 7e0f2e286bdc207ce17b44bec5b4138eef056fa7 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 10:59:36 +0000 Subject: [PATCH 21/43] debugging look at what comes out of safe_save --- spec/services/api/v1/persistence_service_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/services/api/v1/persistence_service_spec.rb b/spec/services/api/v1/persistence_service_spec.rb index d39b65c852..12e6ac47ad 100644 --- a/spec/services/api/v1/persistence_service_spec.rb +++ b/spec/services/api/v1/persistence_service_spec.rb @@ -43,6 +43,8 @@ plan.contributors << contributor plan.contributors << contributor2 result = described_class.safe_save(plan: plan) + pp "CONTRIBUTORS:" + pp result.contributors expect(result.contributors.length).to eql(2) expect(result.contributors.first.org).to eql(result.contributors.last.org) end From ce359956fbbc75c31010294e07668d01876a473b Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 11:09:51 +0000 Subject: [PATCH 22/43] undo debug - now working Schrodinger's cat, it seems --- spec/services/api/v1/persistence_service_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/services/api/v1/persistence_service_spec.rb b/spec/services/api/v1/persistence_service_spec.rb index 12e6ac47ad..d39b65c852 100644 --- a/spec/services/api/v1/persistence_service_spec.rb +++ b/spec/services/api/v1/persistence_service_spec.rb @@ -43,8 +43,6 @@ plan.contributors << contributor plan.contributors << contributor2 result = described_class.safe_save(plan: plan) - pp "CONTRIBUTORS:" - pp result.contributors expect(result.contributors.length).to eql(2) expect(result.contributors.first.org).to eql(result.contributors.last.org) end From 60a88be6eb75cf96ffdb460deda685fdbc54ac0a Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 11:31:56 +0000 Subject: [PATCH 23/43] debugging failure in org model spec --- spec/models/org_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/models/org_spec.rb b/spec/models/org_spec.rb index 5e412f74d6..eb8622645a 100644 --- a/spec/models/org_spec.rb +++ b/spec/models/org_spec.rb @@ -11,7 +11,8 @@ is_expected.to validate_uniqueness_of(:name) .with_message('must be unique') } - + pp "ORG:" + pp subject it { is_expected.to validate_presence_of(:abbreviation) } it { is_expected.to allow_values(true, false).for(:is_other) } From 1be3a6047f4ac585809be14e2053a88802f64101 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 11:38:26 +0000 Subject: [PATCH 24/43] once more to debug org spec failing with no abbrev for some reason. --- spec/models/org_spec.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/models/org_spec.rb b/spec/models/org_spec.rb index eb8622645a..366b0d84eb 100644 --- a/spec/models/org_spec.rb +++ b/spec/models/org_spec.rb @@ -11,9 +11,12 @@ is_expected.to validate_uniqueness_of(:name) .with_message('must be unique') } - pp "ORG:" - pp subject - it { is_expected.to validate_presence_of(:abbreviation) } + + it "is expected to have an abbeviation" do + pp "ORG:" + pp subject + is_expected.to validate_presence_of(:abbreviation) + end it { is_expected.to allow_values(true, false).for(:is_other) } From e2c49142e7d8ffcbcf8ffb5cc9e63d1692b8a427 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 12:02:00 +0000 Subject: [PATCH 25/43] Remove prg has to have abbrev test Used to be that org had to have an abbrev. That stopped the Super Admin creating the org so was removed. Remove check from this test. --- spec/models/org_spec.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spec/models/org_spec.rb b/spec/models/org_spec.rb index 366b0d84eb..1fbe9c8e8f 100644 --- a/spec/models/org_spec.rb +++ b/spec/models/org_spec.rb @@ -12,12 +12,6 @@ .with_message('must be unique') } - it "is expected to have an abbeviation" do - pp "ORG:" - pp subject - is_expected.to validate_presence_of(:abbreviation) - end - it { is_expected.to allow_values(true, false).for(:is_other) } it { is_expected.not_to allow_value(nil).for(:is_other) } From 1edafec90f6f7a80bbeb76859589570bb1ec9d5a Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 11 Jan 2022 11:58:03 +0000 Subject: [PATCH 26/43] Bug DCC Issues 592, 645 - Fix for Org Admins seeing deleted Plans for Org. Fixes issues: https://github.com/DigitalCurationCentre/DMPonline-Service/issues/592 https://github.com/DigitalCurationCentre/DMPonline-Service/issues/645 https://github.com/DigitalCurationCentre/DMPonline-Service/issues/641 The reason we are seeing deleted (de-activated) Plans is that there is no filter for plans with Roles active in the Org model's org_admin_plans() method. Change added .where(roles: { active: true }) to filter plans in org_admin_plans() method of Org model. --- app/models/org.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/org.rb b/app/models/org.rb index 5a7466f6f7..8f25d00e79 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -288,10 +288,12 @@ def org_admin_plans if Rails.configuration.x.plans.org_admins_read_all Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids) + .where(roles: { active: true }) else Plan.includes(:template, :phases, :roles, :users).where(id: combined_plan_ids) .where.not(visibility: Plan.visibilities[:privately_visible]) .where.not(visibility: Plan.visibilities[:is_test]) + .where(roles: { active: true }) end end # rubocop:enable Metrics/AbcSize From 7d9bd5740fa37e329f0dbd6b4475b8dbb963bf43 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 13:12:23 +0000 Subject: [PATCH 27/43] needs active role for org_admin_plans to work --- spec/models/org_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/models/org_spec.rb b/spec/models/org_spec.rb index 1fbe9c8e8f..1310c8afe1 100644 --- a/spec/models/org_spec.rb +++ b/spec/models/org_spec.rb @@ -399,6 +399,7 @@ @perm = build(:perm) @perm.name = 'grant_permissions' user.perms << @perm + plan.add_user!(user.id, :reviewer) plan.privately_visible! end @@ -411,6 +412,7 @@ @perm = build(:perm) @perm.name = 'grant_permissions' user.perms << @perm + plan.add_user!(user.id, :reviewer) plan.publicly_visible! end From 230aa8db1985e955bcf732e03f4febeb6b3c95e3 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 13:23:13 +0000 Subject: [PATCH 28/43] fix merge conflict --- app/models/concerns/exportable_plan.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index 69159c16b0..7a7584c794 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -173,8 +173,10 @@ def show_section_for_csv(csv, phase, section, headings, unanswered, hash) answer = self.answer(question[:id], false) answer_text = '' if answer.present? - answer_text += answer.question_options.pluck(:text).join(', ') if answer.question_options.any? - answer_text += answer.text if answer.answered? + if answer.question_options.any? + answer_text += answer.question_options.pluck(:text).join(", ") + end + answer_text += answer.text if answer.answered? && answer.text.present? elsif unanswered answer_text += _('Not Answered') end From 6bcc6a26fb2e95f69c21e21616333dec2c8df8fa Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Tue, 1 Feb 2022 13:38:02 +0000 Subject: [PATCH 29/43] rubocop fixes --- app/models/concerns/exportable_plan.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb index 7a7584c794..2838098aa7 100644 --- a/app/models/concerns/exportable_plan.rb +++ b/app/models/concerns/exportable_plan.rb @@ -173,9 +173,7 @@ def show_section_for_csv(csv, phase, section, headings, unanswered, hash) answer = self.answer(question[:id], false) answer_text = '' if answer.present? - if answer.question_options.any? - answer_text += answer.question_options.pluck(:text).join(", ") - end + answer_text += answer.question_options.pluck(:text).join(', ') if answer.question_options.any? answer_text += answer.text if answer.answered? && answer.text.present? elsif unanswered answer_text += _('Not Answered') From 61e6d1959cbe95333bc3e4b7d1a97c3c46dcac3e Mon Sep 17 00:00:00 2001 From: John Pinto Date: Thu, 23 Dec 2021 16:47:00 +0000 Subject: [PATCH 30/43] Issue#3069 - (DCC Issue 675) - Org Admin and Super Admin searches and pagination of user's plans broken. Fix for issue #3069 and DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/675. Changes: - Replaced view files /paginable/plans/org_admin_other_user with /paginable/plans/_index.html.erb with extra checks for plan.owner.present? as missing plan.owner broke a DCC user's plans being render by org_admin. - Replaced partial with '/paginable/plans/org_admin_other_user' with '/paginable/plans/index', replaced action'org_admin_other_user' with 'index' in paginable_renderiser() method in views /org_admin/users/edit.html.erb. /org_admin/users/plans.html.erb and /super_admin/users/edit.html.erb. - In Paginable::PlansController replaced - # GET /paginable/plans/org_admin/:page with # GET /paginable/users/:id/plans associated with method org_admin_other_user() renamed index() - Routes replaced get "org_admin_other_user/:page", action: :org_admin_other_user, on: :collection, as: :org_admin_other_user # Paginable actions for users resources :users, only: [] do get "index/:page", action: :index, on: :collection, as: :index with resources :users, only: %i[index] do member do resources :plans, only: %(index) end end --- app/controllers/paginable/plans_controller.rb | 24 ++++++++++--------- app/views/org_admin/users/edit.html.erb | 4 ++-- app/views/org_admin/users/plans.html.erb | 4 ++-- ...in_other_user.html.erb => _index.html.erb} | 5 ++++ app/views/super_admin/users/edit.html.erb | 4 ++-- config/routes.rb | 10 ++++---- 6 files changed, 29 insertions(+), 22 deletions(-) rename app/views/paginable/plans/{_org_admin_other_user.html.erb => _index.html.erb} (80%) diff --git a/app/controllers/paginable/plans_controller.rb b/app/controllers/paginable/plans_controller.rb index c0c5667f63..16b761d062 100644 --- a/app/controllers/paginable/plans_controller.rb +++ b/app/controllers/paginable/plans_controller.rb @@ -58,17 +58,19 @@ def org_admin end # rubocop:enable Metrics/AbcSize - # GET /paginable/plans/org_admin/:page - def org_admin_other_user - @user = User.find(params[:id]) - authorize @user - raise Pundit::NotAuthorizedError unless current_user.present? && current_user.can_org_admin? && @user.present? - - paginable_renderise( - partial: 'org_admin_other_user', - scope: Plan.active(@user), - query_params: { sort_field: 'plans.updated_at', sort_direction: :desc } - ) + # GET /paginable/users/:id/plans + def index + @user = User.find(params[:id]) + authorize @user + unless current_user.present? && current_user.can_org_admin? && @user.present? + raise Pundit::NotAuthorizedError end + + paginable_renderise( + partial: "index", + scope: Plan.active(@user), + query_params: { sort_field: "plans.updated_at", sort_direction: :desc }, + format: :json + ) end end diff --git a/app/views/org_admin/users/edit.html.erb b/app/views/org_admin/users/edit.html.erb index 5c294ab297..e144293b34 100644 --- a/app/views/org_admin/users/edit.html.erb +++ b/app/views/org_admin/users/edit.html.erb @@ -75,9 +75,9 @@
    <%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %>
    diff --git a/app/views/org_admin/users/plans.html.erb b/app/views/org_admin/users/plans.html.erb index 25f05671a3..1381e16f34 100644 --- a/app/views/org_admin/users/plans.html.erb +++ b/app/views/org_admin/users/plans.html.erb @@ -7,9 +7,9 @@
    <%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', remote: true, scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %> diff --git a/app/views/paginable/plans/_org_admin_other_user.html.erb b/app/views/paginable/plans/_index.html.erb similarity index 80% rename from app/views/paginable/plans/_org_admin_other_user.html.erb rename to app/views/paginable/plans/_index.html.erb index e4ddfcbde6..b706479ac2 100644 --- a/app/views/paginable/plans/_org_admin_other_user.html.erb +++ b/app/views/paginable/plans/_index.html.erb @@ -21,8 +21,13 @@ <% end %> <%= plan.template.title %> +<<<<<<< HEAD:app/views/paginable/plans/_org_admin_other_user.html.erb <%= plan.owner&.org&.name %> <%= plan.owner&.name(false) %> +======= + <%= plan.owner.org.name if plan.owner.present? %> + <%= plan.owner.name(false) if plan.owner.present? %> +>>>>>>> Issue#3069 - (DCC Issue 675) - Org Admin and Super Admin searches and:app/views/paginable/plans/_index.html.erb <%= l(plan.updated_at.to_date, formats: :short) %> <%= plan.visibility === 'is_test' ? _('Test') : sanitize(display_visibility(plan.visibility)) %> diff --git a/app/views/super_admin/users/edit.html.erb b/app/views/super_admin/users/edit.html.erb index abc4870e33..098af7517a 100644 --- a/app/views/super_admin/users/edit.html.erb +++ b/app/views/super_admin/users/edit.html.erb @@ -109,9 +109,9 @@
    <%= paginable_renderise( - partial: '/paginable/plans/org_admin_other_user', + partial: '/paginable/plans/index', controller: 'paginable/plans', - action: 'org_admin_other_user', + action: 'index', scope: @plans, query_params: { sort_field: 'plans.updated_at', sort_direction: 'desc' }) %>
    diff --git a/config/routes.rb b/config/routes.rb index e715b99f32..61209f2be4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -210,17 +210,17 @@ get 'org_admin/:page', action: :org_admin, on: :collection, as: :org_admin - get 'org_admin_other_user/:page', action: :org_admin_other_user, - on: :collection, as: :org_admin_other_user - # Paginable actions for contributors resources :contributors, only: %i[index] do get 'index/:page', action: :index, on: :collection, as: :index end end + # Paginable actions for users - resources :users, only: [] do - get 'index/:page', action: :index, on: :collection, as: :index + resources :users, only: %i[index] do + member do + resources :plans, only: %(index) + end end # Paginable actions for themes resources :themes, only: [] do From 1c3b679fb8b35d548d1874e6b5a631977961a6d6 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 10:15:05 +0000 Subject: [PATCH 31/43] bad indenting and missing end --- app/controllers/paginable/plans_controller.rb | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/controllers/paginable/plans_controller.rb b/app/controllers/paginable/plans_controller.rb index 16b761d062..c2ee243814 100644 --- a/app/controllers/paginable/plans_controller.rb +++ b/app/controllers/paginable/plans_controller.rb @@ -58,19 +58,20 @@ def org_admin end # rubocop:enable Metrics/AbcSize - # GET /paginable/users/:id/plans - def index - @user = User.find(params[:id]) - authorize @user - unless current_user.present? && current_user.can_org_admin? && @user.present? - raise Pundit::NotAuthorizedError - end + # GET /paginable/users/:id/plans + def index + @user = User.find(params[:id]) + authorize @user + unless current_user.present? && current_user.can_org_admin? && @user.present? + raise Pundit::NotAuthorizedError + end - paginable_renderise( - partial: "index", - scope: Plan.active(@user), - query_params: { sort_field: "plans.updated_at", sort_direction: :desc }, - format: :json - ) + paginable_renderise( + partial: "index", + scope: Plan.active(@user), + query_params: { sort_field: "plans.updated_at", sort_direction: :desc }, + format: :json + ) + end end end From fb19b910ae5aa0ff3c42b88e942bf80513e4ebeb Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 10:21:12 +0000 Subject: [PATCH 32/43] rubocop clean up --- app/controllers/paginable/plans_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/paginable/plans_controller.rb b/app/controllers/paginable/plans_controller.rb index c2ee243814..b4ddbae87f 100644 --- a/app/controllers/paginable/plans_controller.rb +++ b/app/controllers/paginable/plans_controller.rb @@ -62,14 +62,12 @@ def org_admin def index @user = User.find(params[:id]) authorize @user - unless current_user.present? && current_user.can_org_admin? && @user.present? - raise Pundit::NotAuthorizedError - end + raise Pundit::NotAuthorizedError unless current_user.present? && current_user.can_org_admin? && @user.present? paginable_renderise( - partial: "index", + partial: 'index', scope: Plan.active(@user), - query_params: { sort_field: "plans.updated_at", sort_direction: :desc }, + query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }, format: :json ) end From 35fa59531b6cec3a8f119e72541a0a0a641ce81a Mon Sep 17 00:00:00 2001 From: John Pinto Date: Tue, 23 Nov 2021 13:28:11 +0000 Subject: [PATCH 33/43] Issue#dcc2983 - Fix for preventing adding a Contributor via Contributor form for Plan based on whether email and/or name are required. Fix for DCC bug https://github.com/DMPRoadmap/roadmap/issues/2983 Changes: - Added two new properties to config/initializers/_dmproadmap.rb (both devault to false): config.x.application.require_contributor_name = false config.x.application.require_contributor_email = false -In Contributor model the private method name_or_email_presence() has been updated to take account of the above mentioned property settings. --- app/models/contributor.rb | 33 ++++++++++++++++++++++++++---- config/initializers/_dmproadmap.rb | 4 ++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index de5e03eea6..2d316a8fce 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -130,10 +130,35 @@ def merge(other) private + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/MethodLength def name_or_email_presence - return true unless name.blank? && email.blank? - - errors.add(:name, _("can't be blank if no email is provided")) - errors.add(:email, _("can't be blank if no name is provided")) + return true unless (name.blank? && email.blank?) || + (!!Rails.configuration.x.application.require_contributor_name && + name.blank?) || + (!!Rails.configuration.x.application.require_contributor_email && + email.blank?) + + # Error messages for case where name.blank? and email.blank? and + # properties Rails.configuration.x.application.require_contributor_name and + # Rails.configuration.x.application.require_contributor_email both not set (i.e, nil) or false. + if (name.blank? && email.blank?) && + !Rails.configuration.x.application.require_contributor_name && + !Rails.configuration.x.application.require_contributor_email + errors.add(:name, _("can't be blank if no email is provided.")) + errors.add(:email, _("can't be blank if no name is provided.")) + else + + # Error messages cases where enither ame.blank? or email.blank? + if name.blank? && !!Rails.configuration.x.application.require_contributor_name + errors.add(:name, _("can't be blank.")) + end + + if email.blank? && !!Rails.configuration.x.application.require_contributor_email + errors.add(:email, _("can't be blank.")) + end + end end + # rubocop:enable Metrics/MethodLength + # rubocop:enable Metrics/AbcSize end diff --git a/config/initializers/_dmproadmap.rb b/config/initializers/_dmproadmap.rb index 25518abeae..06c664419a 100644 --- a/config/initializers/_dmproadmap.rb +++ b/config/initializers/_dmproadmap.rb @@ -118,6 +118,10 @@ class Application < Rails::Application # Setting to display phone number in contributor form config.x.application.display_contributor_phone_number = false + # Setting require contributor requirement of contributor name and email + config.x.application.require_contributor_name = false + config.x.application.require_contributor_email = false + # ------------------- # # SHIBBOLETH SETTINGS # # ------------------- # From d0f301be3c7bff8f1c02632432124a5eba89ed94 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 11:17:52 +0000 Subject: [PATCH 34/43] clean up name_or_email_presence --- app/models/contributor.rb | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index 2d316a8fce..5e5e19f85f 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -130,35 +130,20 @@ def merge(other) private - # rubocop:disable Metrics/AbcSize - # rubocop:disable Metrics/MethodLength def name_or_email_presence - return true unless (name.blank? && email.blank?) || - (!!Rails.configuration.x.application.require_contributor_name && - name.blank?) || - (!!Rails.configuration.x.application.require_contributor_email && - email.blank?) - - # Error messages for case where name.blank? and email.blank? and - # properties Rails.configuration.x.application.require_contributor_name and - # Rails.configuration.x.application.require_contributor_email both not set (i.e, nil) or false. - if (name.blank? && email.blank?) && - !Rails.configuration.x.application.require_contributor_name && - !Rails.configuration.x.application.require_contributor_email + if name.blank? && Rails.configuration.x.application.require_contributor_name + errors.add(:name, _("can't be blank.")) + end + + if email.blank? && Rails.configuration.x.application.require_contributor_email + errors.add(:email, _("can't be blank.")) + end + + if name.blank? && email.blank? && errors.length == 0 errors.add(:name, _("can't be blank if no email is provided.")) errors.add(:email, _("can't be blank if no name is provided.")) - else - - # Error messages cases where enither ame.blank? or email.blank? - if name.blank? && !!Rails.configuration.x.application.require_contributor_name - errors.add(:name, _("can't be blank.")) - end - - if email.blank? && !!Rails.configuration.x.application.require_contributor_email - errors.add(:email, _("can't be blank.")) - end end - end - # rubocop:enable Metrics/MethodLength - # rubocop:enable Metrics/AbcSize + + return errors.length == 0 +end end From b3822920b728af3b23d390c4e194784f9f8a50e8 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 11:18:30 +0000 Subject: [PATCH 35/43] Typo typo --- app/models/contributor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index 5e5e19f85f..212863c4ae 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -145,5 +145,5 @@ def name_or_email_presence end return errors.length == 0 -end + end end From f4920cf2c2201d48a6c254a144f5fb0af0f96239 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 11:25:12 +0000 Subject: [PATCH 36/43] rubocop rubocop stuff. Single line ifs and use of zero? --- app/models/contributor.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index 212863c4ae..db1a0293cc 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -130,20 +130,17 @@ def merge(other) private + # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity def name_or_email_presence - if name.blank? && Rails.configuration.x.application.require_contributor_name - errors.add(:name, _("can't be blank.")) - end - - if email.blank? && Rails.configuration.x.application.require_contributor_email - errors.add(:email, _("can't be blank.")) - end - - if name.blank? && email.blank? && errors.length == 0 + errors.add(:name, _("can't be blank.")) if name.blank? && Rails.configuration.x.application.require_contributor_name + errors.add(:email, _("can't be blank.")) if email.blank? && Rails.configuration.x.application.require_contributor_email + + if name.blank? && email.blank? && errors.length.zero? errors.add(:name, _("can't be blank if no email is provided.")) errors.add(:email, _("can't be blank if no name is provided.")) end - return errors.length == 0 + return errors.length.zero? end + # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity end From 477b9817473706a5aaf7559ca74be69bb84241c8 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 11:29:28 +0000 Subject: [PATCH 37/43] more rubcocop stuff --- app/models/contributor.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index db1a0293cc..fee9cc3f29 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -133,14 +133,17 @@ def merge(other) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity def name_or_email_presence errors.add(:name, _("can't be blank.")) if name.blank? && Rails.configuration.x.application.require_contributor_name - errors.add(:email, _("can't be blank.")) if email.blank? && Rails.configuration.x.application.require_contributor_email - + if email.blank? && Rails.configuration.x.application.require_contributor_email + errors.add(:email, + _("can't be blank.")) + end + if name.blank? && email.blank? && errors.length.zero? errors.add(:name, _("can't be blank if no email is provided.")) errors.add(:email, _("can't be blank if no name is provided.")) end - return errors.length.zero? + errors.length.zero? end # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity end From 3df80e650fc4583b92e13a1d466b0054c9b959d8 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Wed, 2 Feb 2022 12:19:45 +0000 Subject: [PATCH 38/43] fix errors --- app/models/contributor.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/contributor.rb b/app/models/contributor.rb index fee9cc3f29..5cb2d9094d 100644 --- a/app/models/contributor.rb +++ b/app/models/contributor.rb @@ -138,12 +138,12 @@ def name_or_email_presence _("can't be blank.")) end - if name.blank? && email.blank? && errors.length.zero? + if name.blank? && email.blank? && errors.size.zero? errors.add(:name, _("can't be blank if no email is provided.")) errors.add(:email, _("can't be blank if no name is provided.")) end - errors.length.zero? + errors.size.zero? end # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity end From 93c914f1bcaca9a7ee6e9c0a3f5e1c88d4183108 Mon Sep 17 00:00:00 2001 From: briri Date: Wed, 2 Feb 2022 09:53:25 -0800 Subject: [PATCH 39/43] fixed merge conflict in paginable/plans_controller.rb --- app/controllers/paginable/plans_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/paginable/plans_controller.rb b/app/controllers/paginable/plans_controller.rb index c0c5667f63..6b9e56e472 100644 --- a/app/controllers/paginable/plans_controller.rb +++ b/app/controllers/paginable/plans_controller.rb @@ -67,7 +67,8 @@ def org_admin_other_user paginable_renderise( partial: 'org_admin_other_user', scope: Plan.active(@user), - query_params: { sort_field: 'plans.updated_at', sort_direction: :desc } + query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }, + format: :json ) end end From 6238ca9c8fe4dc9532374f44487d1a2205e87496 Mon Sep 17 00:00:00 2001 From: Ray Carrick Date: Thu, 10 Feb 2022 08:51:45 +0000 Subject: [PATCH 40/43] translation.io sync --- config/locale/app.pot | 1418 +++++++++-------- config/locale/de/LC_MESSAGES/app.mo | Bin 144745 -> 146799 bytes config/locale/de/app.po | 1925 ++++++++++++----------- config/locale/en_CA/LC_MESSAGES/app.mo | Bin 630 -> 630 bytes config/locale/en_CA/app.po | 1419 +++++++++-------- config/locale/en_GB/LC_MESSAGES/app.mo | Bin 1916 -> 1916 bytes config/locale/en_GB/app.po | 1423 +++++++++-------- config/locale/en_US/LC_MESSAGES/app.mo | Bin 21173 -> 20973 bytes config/locale/en_US/app.po | 1445 +++++++++-------- config/locale/es/LC_MESSAGES/app.mo | Bin 141384 -> 143576 bytes config/locale/es/app.po | 1921 ++++++++++++----------- config/locale/fi/LC_MESSAGES/app.mo | Bin 137216 -> 138723 bytes config/locale/fi/app.po | 1938 ++++++++++++----------- config/locale/fr_CA/LC_MESSAGES/app.mo | Bin 139298 -> 122826 bytes config/locale/fr_CA/app.po | 1833 +++++++++++----------- config/locale/fr_FR/LC_MESSAGES/app.mo | Bin 144558 -> 146804 bytes config/locale/fr_FR/app.po | 1984 ++++++++++++------------ config/locale/pt_BR/LC_MESSAGES/app.mo | Bin 139922 -> 142200 bytes config/locale/pt_BR/app.po | 1913 ++++++++++++----------- config/locale/sv_FI/LC_MESSAGES/app.mo | Bin 136464 -> 138591 bytes config/locale/sv_FI/app.po | 1915 ++++++++++++----------- config/locale/tr_TR/LC_MESSAGES/app.mo | Bin 137161 -> 125610 bytes config/locale/tr_TR/app.po | 1942 ++++++++++++----------- config/locales/.translation_io | 2 +- config/locales/translation.de.yml | 9 + config/locales/translation.en-CA.yml | 3 + config/locales/translation.en-GB.yml | 3 + config/locales/translation.en-US.yml | 3 + config/locales/translation.es.yml | 10 + config/locales/translation.fi.yml | 9 +- config/locales/translation.fr-CA.yml | 11 + config/locales/translation.fr-FR.yml | 27 +- config/locales/translation.pt-BR.yml | 12 + config/locales/translation.sv-FI.yml | 10 + config/locales/translation.tr-TR.yml | 22 +- 35 files changed, 10968 insertions(+), 10229 deletions(-) diff --git a/config/locale/app.pot b/config/locale/app.pot index bc5ca09dfb..8fbf5ca3ff 100644 --- a/config/locale/app.pot +++ b/config/locale/app.pot @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2021 app +# Copyright (C) 2022 app # This file is distributed under the same license as the app package. -# FIRST AUTHOR , 2021. +# FIRST AUTHOR , 2022. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: app 1.0\n" "Report-Msgid-Bugs-To: contact@translation.io\n" -"POT-Creation-Date: 2021-10-01 11:19+0000\n" -"PO-Revision-Date: 2021-10-01 11:19+0000\n" +"POT-Creation-Date: 2022-02-10 08:50+0000\n" +"PO-Revision-Date: 2022-02-10 08:50+0000\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -18,25 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: ../../app/controllers/answers_controller.rb:24 +#: ../../app/controllers/answers_controller.rb:25 msgid "" -"There is no question with id %s associated to plan id %s f" -"or which to create or update an answer" +"There is no question with id %s associated to plan id %s" +" for which to create or update an answer" msgstr "" -#: ../../app/controllers/answers_controller.rb:34 +#: ../../app/controllers/answers_controller.rb:33 msgid "There is no plan with id %s for which to create or update an answer" msgstr "" -#: ../../app/controllers/api/v0/base_controller.rb:124 +#: ../../app/controllers/api/v0/base_controller.rb:126 msgid "Bad Credentials" msgstr "" -#: ../../app/controllers/api/v0/departments_controller.rb:20 +#: ../../app/controllers/api/v0/departments_controller.rb:22 msgid "Departments code and name must be unique" msgstr "" -#: ../../app/controllers/api/v0/plans_controller.rb:26 +#: ../../app/controllers/api/v0/plans_controller.rb:27 msgid "user must be in your organisation" msgstr "" @@ -44,28 +44,28 @@ msgstr "" msgid "Bad Parameters" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:40 +#: ../../app/controllers/api/v0/statistics_controller.rb:41 #: ../../app/controllers/api/v0/statistics_controller.rb:89 -#: ../../app/controllers/api/v0/statistics_controller.rb:135 -#: ../../app/controllers/usage_controller.rb:68 +#: ../../app/controllers/api/v0/statistics_controller.rb:136 +#: ../../app/controllers/usage_controller.rb:66 #: ../../app/controllers/usage_controller.rb:87 msgid "Month" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:40 -#: ../../app/controllers/usage_controller.rb:68 +#: ../../app/controllers/api/v0/statistics_controller.rb:41 +#: ../../app/controllers/usage_controller.rb:66 msgid "No. Users joined" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:46 +#: ../../app/controllers/api/v0/statistics_controller.rb:47 #: ../../app/controllers/api/v0/statistics_controller.rb:95 -#: ../../app/controllers/api/v0/statistics_controller.rb:141 -#: ../../app/controllers/usage_controller.rb:74 +#: ../../app/controllers/api/v0/statistics_controller.rb:142 +#: ../../app/controllers/usage_controller.rb:72 #: ../../app/controllers/usage_controller.rb:93 msgid "Total" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:47 +#: ../../app/controllers/api/v0/statistics_controller.rb:48 msgid "users_joined" msgstr "" @@ -78,137 +78,141 @@ msgstr "" msgid "completed_plans" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:135 +#: ../../app/controllers/api/v0/statistics_controller.rb:136 msgid "No. Plans" msgstr "" -#: ../../app/controllers/api/v0/statistics_controller.rb:142 +#: ../../app/controllers/api/v0/statistics_controller.rb:143 msgid "plans" msgstr "" -#: ../../app/controllers/api/v1/authentication_controller.rb:49 +#: ../../app/controllers/api/v1/authentication_controller.rb:47 msgid "Missing or invalid JSON" msgstr "" -#: ../../app/controllers/api/v1/base_api_controller.rb:81 +#: ../../app/controllers/api/v1/base_api_controller.rb:79 msgid "Invalid JSON format" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:20 +#: ../../app/controllers/api/v1/plans_controller.rb:18 msgid "Plan not found" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:37 +#: ../../app/controllers/api/v1/plans_controller.rb:36 msgid "Unable to create your DMP" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:38 +#: ../../app/controllers/api/v1/plans_controller.rb:37 msgid "Plan already exists. Send an update instead." msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:39 +#: ../../app/controllers/api/v1/plans_controller.rb:38 msgid "" "Could not determine ownership of the DMP. Please add an\n" " :affiliation to the :contact" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:74 +#: ../../app/controllers/api/v1/plans_controller.rb:70 msgid "Invalid JSON!" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:77 +#: ../../app/controllers/api/v1/plans_controller.rb:73 msgid "Invalid JSON" msgstr "" -#: ../../app/controllers/api/v1/plans_controller.rb:93 +#: ../../app/controllers/api/v1/plans_controller.rb:90 msgid "No Plans found" msgstr "" -#: ../../app/controllers/application_controller.rb:33 +#: ../../app/controllers/application_controller.rb:36 msgid "You are not authorized to perform this action." msgstr "" -#: ../../app/controllers/application_controller.rb:35 +#: ../../app/controllers/application_controller.rb:40 msgid "You need to sign in or sign up before continuing." msgstr "" -#: ../../app/controllers/application_controller.rb:100 +#: ../../app/controllers/application_controller.rb:108 msgid "Unable to %s the %s.%s" msgstr "" -#: ../../app/controllers/application_controller.rb:108 +#: ../../app/controllers/application_controller.rb:114 msgid "Successfully %s the %s." msgstr "" -#: ../../app/controllers/application_controller.rb:123 +#: ../../app/controllers/application_controller.rb:127 msgid "API client" msgstr "" -#: ../../app/controllers/application_controller.rb:124 +#: ../../app/controllers/application_controller.rb:128 msgid "plan" msgstr "" -#: ../../app/controllers/application_controller.rb:125 +#: ../../app/controllers/application_controller.rb:129 msgid "guidance group" msgstr "" -#: ../../app/controllers/application_controller.rb:126 +#: ../../app/controllers/application_controller.rb:130 msgid "comment" msgstr "" -#: ../../app/controllers/application_controller.rb:127 +#: ../../app/controllers/application_controller.rb:131 msgid "organisation" msgstr "" -#: ../../app/controllers/application_controller.rb:128 +#: ../../app/controllers/application_controller.rb:132 msgid "permission" msgstr "" -#: ../../app/controllers/application_controller.rb:129 +#: ../../app/controllers/application_controller.rb:133 msgid "preferences" msgstr "" -#: ../../app/controllers/application_controller.rb:130 +#: ../../app/controllers/application_controller.rb:134 msgid "profile" msgstr "" -#: ../../app/controllers/application_controller.rb:130 +#: ../../app/controllers/application_controller.rb:134 msgid "user" msgstr "" -#: ../../app/controllers/application_controller.rb:131 +#: ../../app/controllers/application_controller.rb:135 msgid "question option" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:44 +#: ../../app/controllers/application_controller.rb:181 +msgid "Record Not Found" +msgstr "" + +#: ../../app/controllers/concerns/paginable.rb:45 msgid "scope should be an ActiveRecord::Relation object" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:46 +#: ../../app/controllers/concerns/paginable.rb:47 msgid "path_params should be a Hash object" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:47 +#: ../../app/controllers/concerns/paginable.rb:48 msgid "query_params should be a Hash object" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:48 +#: ../../app/controllers/concerns/paginable.rb:49 msgid "locals should be a Hash object" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:69 +#: ../../app/controllers/concerns/paginable.rb:70 msgid "Restricted access to View All the records" msgstr "" -#: ../../app/controllers/concerns/paginable.rb:180 +#: ../../app/controllers/concerns/paginable.rb:182 msgid "Sort by %s" msgstr "" -#: ../../app/controllers/concerns/template_methods.rb:10 +#: ../../app/controllers/concerns/template_methods.rb:8 msgid "customisation" msgstr "" -#: ../../app/controllers/concerns/template_methods.rb:10 +#: ../../app/controllers/concerns/template_methods.rb:8 msgid "template" msgstr "" @@ -216,28 +220,28 @@ msgstr "" msgid "obj should be a Template, Phase, Section, Question, or Annotation" msgstr "" -#: ../../app/controllers/concerns/versionable.rb:46 -#: ../../app/controllers/concerns/versionable.rb:65 +#: ../../app/controllers/concerns/versionable.rb:47 +#: ../../app/controllers/concerns/versionable.rb:66 msgid "obj should be a Phase, Section, Question, or Annotation" msgstr "" -#: ../../app/controllers/concerns/versionable.rb:88 +#: ../../app/controllers/concerns/versionable.rb:90 msgid "The search_space does not respond to each" msgstr "" -#: ../../app/controllers/concerns/versionable.rb:93 +#: ../../app/controllers/concerns/versionable.rb:94 msgid "The search space does not have elements associated" msgstr "" -#: ../../app/controllers/contacts_controller.rb:10 +#: ../../app/controllers/contacts_controller.rb:13 msgid "Captcha verification failed, please retry." msgstr "" -#: ../../app/controllers/contacts_controller.rb:16 +#: ../../app/controllers/contacts_controller.rb:18 msgid "Contact email was successfully sent." msgstr "" -#: ../../app/controllers/contacts_controller.rb:18 +#: ../../app/controllers/contacts_controller.rb:20 msgid "Unable to submit your request" msgstr "" @@ -251,60 +255,60 @@ msgid "added" msgstr "" #: ../../app/controllers/contributors_controller.rb:72 -#: ../../app/controllers/guidance_groups_controller.rb:48 -#: ../../app/controllers/guidances_controller.rb:71 -#: ../../app/controllers/notes_controller.rb:92 -#: ../../app/controllers/org_admin/departments_controller.rb:48 -#: ../../app/controllers/org_admin/sections_controller.rb:102 -#: ../../app/controllers/org_admin/templates_controller.rb:203 -#: ../../app/controllers/orgs_controller.rb:87 -#: ../../app/controllers/plans_controller.rb:271 -#: ../../app/controllers/plans_controller.rb:274 -#: ../../app/controllers/registrations_controller.rb:247 -#: ../../app/controllers/registrations_controller.rb:251 -#: ../../app/controllers/registrations_controller.rb:276 +#: ../../app/controllers/guidance_groups_controller.rb:51 +#: ../../app/controllers/guidances_controller.rb:74 +#: ../../app/controllers/notes_controller.rb:89 +#: ../../app/controllers/org_admin/departments_controller.rb:50 +#: ../../app/controllers/org_admin/sections_controller.rb:103 +#: ../../app/controllers/org_admin/templates_controller.rb:204 +#: ../../app/controllers/orgs_controller.rb:88 +#: ../../app/controllers/plans_controller.rb:282 +#: ../../app/controllers/plans_controller.rb:285 +#: ../../app/controllers/registrations_controller.rb:249 +#: ../../app/controllers/registrations_controller.rb:253 #: ../../app/controllers/registrations_controller.rb:280 -#: ../../app/controllers/users_controller.rb:98 -#: ../../app/controllers/users_controller.rb:125 +#: ../../app/controllers/registrations_controller.rb:284 +#: ../../app/controllers/users_controller.rb:101 +#: ../../app/controllers/users_controller.rb:129 msgid "saved" msgstr "" #: ../../app/controllers/contributors_controller.rb:74 -#: ../../app/controllers/guidance_groups_controller.rb:50 -#: ../../app/controllers/guidances_controller.rb:73 -#: ../../app/controllers/notes_controller.rb:110 -#: ../../app/controllers/org_admin/departments_controller.rb:50 -#: ../../app/controllers/org_admin/sections_controller.rb:104 -#: ../../app/controllers/org_admin/templates_controller.rb:208 -#: ../../app/controllers/orgs_controller.rb:89 -#: ../../app/controllers/plans_controller.rb:280 -#: ../../app/controllers/plans_controller.rb:283 -#: ../../app/controllers/plans_controller.rb:287 -#: ../../app/controllers/plans_controller.rb:290 -#: ../../app/controllers/registrations_controller.rb:254 -#: ../../app/controllers/registrations_controller.rb:283 +#: ../../app/controllers/guidance_groups_controller.rb:53 +#: ../../app/controllers/guidances_controller.rb:76 +#: ../../app/controllers/notes_controller.rb:107 +#: ../../app/controllers/org_admin/departments_controller.rb:52 +#: ../../app/controllers/org_admin/sections_controller.rb:105 +#: ../../app/controllers/org_admin/templates_controller.rb:209 +#: ../../app/controllers/orgs_controller.rb:90 +#: ../../app/controllers/plans_controller.rb:291 +#: ../../app/controllers/plans_controller.rb:294 +#: ../../app/controllers/plans_controller.rb:298 +#: ../../app/controllers/plans_controller.rb:301 +#: ../../app/controllers/registrations_controller.rb:256 +#: ../../app/controllers/registrations_controller.rb:287 msgid "save" msgstr "" #: ../../app/controllers/contributors_controller.rb:84 -#: ../../app/controllers/notes_controller.rb:134 -#: ../../app/controllers/org_admin/templates_controller.rb:236 +#: ../../app/controllers/notes_controller.rb:131 +#: ../../app/controllers/org_admin/templates_controller.rb:237 #: ../../app/controllers/super_admin/orgs_controller.rb:94 msgid "removed" msgstr "" #: ../../app/controllers/contributors_controller.rb:87 -#: ../../app/controllers/notes_controller.rb:152 -#: ../../app/controllers/org_admin/templates_controller.rb:238 +#: ../../app/controllers/notes_controller.rb:149 +#: ../../app/controllers/org_admin/templates_controller.rb:239 #: ../../app/controllers/super_admin/orgs_controller.rb:97 msgid "remove" msgstr "" -#: ../../app/controllers/contributors_controller.rb:160 +#: ../../app/controllers/contributors_controller.rb:161 msgid "plan not found" msgstr "" -#: ../../app/controllers/contributors_controller.rb:168 +#: ../../app/controllers/contributors_controller.rb:169 msgid "contributor not found" msgstr "" @@ -316,93 +320,93 @@ msgstr "" msgid "An error occurred when requesting feedback for this plan." msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:28 -#: ../../app/controllers/guidances_controller.rb:51 -#: ../../app/controllers/notes_controller.rb:51 -#: ../../app/controllers/org_admin/departments_controller.rb:25 -#: ../../app/controllers/org_admin/phases_controller.rb:120 -#: ../../app/controllers/org_admin/questions_controller.rb:95 -#: ../../app/controllers/org_admin/sections_controller.rb:78 -#: ../../app/controllers/org_admin/templates_controller.rb:177 -#: ../../app/controllers/plans_controller.rb:118 +#: ../../app/controllers/guidance_groups_controller.rb:29 +#: ../../app/controllers/guidances_controller.rb:52 +#: ../../app/controllers/notes_controller.rb:48 +#: ../../app/controllers/org_admin/departments_controller.rb:26 +#: ../../app/controllers/org_admin/phases_controller.rb:121 +#: ../../app/controllers/org_admin/questions_controller.rb:94 +#: ../../app/controllers/org_admin/sections_controller.rb:79 +#: ../../app/controllers/org_admin/templates_controller.rb:180 +#: ../../app/controllers/plans_controller.rb:120 #: ../../app/controllers/super_admin/api_clients_controller.rb:44 #: ../../app/controllers/super_admin/notifications_controller.rb:38 -#: ../../app/controllers/super_admin/orgs_controller.rb:62 -#: ../../app/controllers/super_admin/themes_controller.rb:22 +#: ../../app/controllers/super_admin/orgs_controller.rb:61 +#: ../../app/controllers/super_admin/themes_controller.rb:21 msgid "created" msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:31 -#: ../../app/controllers/guidances_controller.rb:53 -#: ../../app/controllers/notes_controller.rb:70 -#: ../../app/controllers/org_admin/departments_controller.rb:29 -#: ../../app/controllers/org_admin/phases_controller.rb:122 -#: ../../app/controllers/org_admin/questions_controller.rb:97 -#: ../../app/controllers/org_admin/sections_controller.rb:85 -#: ../../app/controllers/org_admin/templates_controller.rb:179 +#: ../../app/controllers/guidance_groups_controller.rb:32 +#: ../../app/controllers/guidances_controller.rb:54 +#: ../../app/controllers/notes_controller.rb:67 +#: ../../app/controllers/org_admin/departments_controller.rb:30 +#: ../../app/controllers/org_admin/phases_controller.rb:123 +#: ../../app/controllers/org_admin/questions_controller.rb:96 +#: ../../app/controllers/org_admin/sections_controller.rb:86 +#: ../../app/controllers/org_admin/templates_controller.rb:182 #: ../../app/controllers/plans_controller.rb:151 -#: ../../app/controllers/super_admin/api_clients_controller.rb:51 +#: ../../app/controllers/super_admin/api_clients_controller.rb:50 #: ../../app/controllers/super_admin/notifications_controller.rb:41 -#: ../../app/controllers/super_admin/orgs_controller.rb:65 -#: ../../app/controllers/super_admin/themes_controller.rb:25 +#: ../../app/controllers/super_admin/orgs_controller.rb:64 +#: ../../app/controllers/super_admin/themes_controller.rb:24 msgid "create" msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:61 +#: ../../app/controllers/guidance_groups_controller.rb:65 msgid "Your guidance group has been published and is now available to users." msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:64 -#: ../../app/controllers/guidances_controller.rb:107 +#: ../../app/controllers/guidance_groups_controller.rb:68 +#: ../../app/controllers/guidances_controller.rb:112 msgid "publish" msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:76 +#: ../../app/controllers/guidance_groups_controller.rb:79 msgid "Your guidance group is no longer published and will not be available to users." msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:79 -#: ../../app/controllers/guidances_controller.rb:124 +#: ../../app/controllers/guidance_groups_controller.rb:81 +#: ../../app/controllers/guidances_controller.rb:129 msgid "unpublish" msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:89 -#: ../../app/controllers/guidances_controller.rb:88 -#: ../../app/controllers/org_admin/departments_controller.rb:63 -#: ../../app/controllers/org_admin/phases_controller.rb:174 -#: ../../app/controllers/org_admin/question_options_controller.rb:25 +#: ../../app/controllers/guidance_groups_controller.rb:91 +#: ../../app/controllers/guidances_controller.rb:93 +#: ../../app/controllers/org_admin/departments_controller.rb:66 +#: ../../app/controllers/org_admin/phases_controller.rb:179 +#: ../../app/controllers/org_admin/question_options_controller.rb:24 #: ../../app/controllers/org_admin/questions_controller.rb:197 -#: ../../app/controllers/org_admin/sections_controller.rb:126 -#: ../../app/controllers/plans_controller.rb:332 -#: ../../app/controllers/super_admin/api_clients_controller.rb:79 -#: ../../app/controllers/super_admin/notifications_controller.rb:84 -#: ../../app/controllers/super_admin/themes_controller.rb:50 +#: ../../app/controllers/org_admin/sections_controller.rb:128 +#: ../../app/controllers/plans_controller.rb:344 +#: ../../app/controllers/super_admin/api_clients_controller.rb:81 +#: ../../app/controllers/super_admin/notifications_controller.rb:85 +#: ../../app/controllers/super_admin/themes_controller.rb:51 msgid "deleted" msgstr "" -#: ../../app/controllers/guidance_groups_controller.rb:91 -#: ../../app/controllers/guidances_controller.rb:90 -#: ../../app/controllers/org_admin/departments_controller.rb:65 -#: ../../app/controllers/org_admin/phases_controller.rb:176 -#: ../../app/controllers/org_admin/question_options_controller.rb:27 +#: ../../app/controllers/guidance_groups_controller.rb:93 +#: ../../app/controllers/guidances_controller.rb:95 +#: ../../app/controllers/org_admin/departments_controller.rb:68 +#: ../../app/controllers/org_admin/phases_controller.rb:181 +#: ../../app/controllers/org_admin/question_options_controller.rb:26 #: ../../app/controllers/org_admin/questions_controller.rb:199 -#: ../../app/controllers/org_admin/sections_controller.rb:128 -#: ../../app/controllers/plans_controller.rb:337 -#: ../../app/controllers/super_admin/api_clients_controller.rb:82 -#: ../../app/controllers/super_admin/notifications_controller.rb:87 -#: ../../app/controllers/super_admin/themes_controller.rb:53 +#: ../../app/controllers/org_admin/sections_controller.rb:130 +#: ../../app/controllers/plans_controller.rb:349 +#: ../../app/controllers/super_admin/api_clients_controller.rb:84 +#: ../../app/controllers/super_admin/notifications_controller.rb:88 +#: ../../app/controllers/super_admin/themes_controller.rb:54 msgid "delete" msgstr "" -#: ../../app/controllers/guidances_controller.rb:104 +#: ../../app/controllers/guidances_controller.rb:109 msgid "Your guidance has been published and is now available to users." msgstr "" -#: ../../app/controllers/guidances_controller.rb:121 +#: ../../app/controllers/guidances_controller.rb:126 msgid "Your guidance is no longer published and will not be available to users." msgstr "" -#: ../../app/controllers/identifiers_controller.rb:18 +#: ../../app/controllers/identifiers_controller.rb:19 msgid "Successfully unlinked your account from %s." msgstr "" @@ -410,8 +414,8 @@ msgstr "" msgid "Unable to unlink your account from %s." msgstr "" -#: ../../app/controllers/org_admin/phases_controller.rb:18 -#: ../../app/controllers/org_admin/templates_controller.rb:114 +#: ../../app/controllers/org_admin/phases_controller.rb:17 +#: ../../app/controllers/org_admin/templates_controller.rb:115 msgid "" "You are viewing a historical version of this template. You will not be able to" " make changes." @@ -421,70 +425,72 @@ msgstr "" msgid "You cannot add a phase to a historical version of a template." msgstr "" -#: ../../app/controllers/org_admin/phases_controller.rb:125 -#: ../../app/controllers/org_admin/phases_controller.rb:149 -#: ../../app/controllers/org_admin/phases_controller.rb:179 -#: ../../app/controllers/org_admin/question_options_controller.rb:30 -#: ../../app/controllers/org_admin/questions_controller.rb:100 -#: ../../app/controllers/org_admin/questions_controller.rb:202 -#: ../../app/controllers/org_admin/sections_controller.rb:107 -#: ../../app/controllers/org_admin/sections_controller.rb:131 -msgid "Unable to create a new version of this template." +#: ../../app/controllers/org_admin/phases_controller.rb:126 +msgid "Unable to create a new version of this template.
    " msgstr "" -#: ../../app/controllers/org_admin/phases_controller.rb:144 +#: ../../app/controllers/org_admin/phases_controller.rb:147 #: ../../app/controllers/org_admin/questions_controller.rb:166 #: ../../app/controllers/org_admin/users_controller.rb:30 -#: ../../app/controllers/plans_controller.rb:400 -#: ../../app/controllers/super_admin/api_clients_controller.rb:67 -#: ../../app/controllers/super_admin/notifications_controller.rb:51 +#: ../../app/controllers/plans_controller.rb:417 +#: ../../app/controllers/super_admin/api_clients_controller.rb:68 +#: ../../app/controllers/super_admin/notifications_controller.rb:52 #: ../../app/controllers/super_admin/themes_controller.rb:39 -#: ../../app/controllers/super_admin/users_controller.rb:55 -#: ../../app/controllers/users_controller.rb:103 +#: ../../app/controllers/super_admin/users_controller.rb:54 +#: ../../app/controllers/users_controller.rb:106 msgid "updated" msgstr "" -#: ../../app/controllers/org_admin/phases_controller.rb:146 +#: ../../app/controllers/org_admin/phases_controller.rb:149 #: ../../app/controllers/org_admin/questions_controller.rb:169 #: ../../app/controllers/org_admin/users_controller.rb:32 -#: ../../app/controllers/plans_controller.rb:403 -#: ../../app/controllers/super_admin/api_clients_controller.rb:69 -#: ../../app/controllers/super_admin/notifications_controller.rb:54 +#: ../../app/controllers/plans_controller.rb:420 +#: ../../app/controllers/super_admin/api_clients_controller.rb:70 +#: ../../app/controllers/super_admin/notifications_controller.rb:55 #: ../../app/controllers/super_admin/themes_controller.rb:41 -#: ../../app/controllers/super_admin/users_controller.rb:57 +#: ../../app/controllers/super_admin/users_controller.rb:56 msgid "update" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:32 +#: ../../app/controllers/org_admin/phases_controller.rb:152 +#: ../../app/controllers/org_admin/phases_controller.rb:184 +#: ../../app/controllers/org_admin/question_options_controller.rb:29 +#: ../../app/controllers/org_admin/questions_controller.rb:99 +#: ../../app/controllers/org_admin/questions_controller.rb:202 +#: ../../app/controllers/org_admin/sections_controller.rb:108 +msgid "Unable to create a new version of this template." +msgstr "" + +#: ../../app/controllers/org_admin/plans_controller.rb:36 msgid "%s has been notified that you have finished providing feedback" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:38 +#: ../../app/controllers/org_admin/plans_controller.rb:40 msgid "Unable to notify user that you have finished providing feedback." msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:53 -#: ../../app/views/plans/_project_details.html.erb:9 +#: ../../app/controllers/org_admin/plans_controller.rb:56 +#: ../../app/views/plans/_project_details.html.erb:14 msgid "Project title" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:54 +#: ../../app/controllers/org_admin/plans_controller.rb:57 +#: ../../app/views/paginable/plans/_index.html.erb:6 #: ../../app/views/paginable/plans/_org_admin.html.erb:19 -#: ../../app/views/paginable/plans/_org_admin_other_user.html.erb:6 #: ../../app/views/paginable/plans/_organisationally_or_publicly_visible.html.erb:13 #: ../../app/views/paginable/plans/_privately_visible.html.erb:6 #: ../../app/views/paginable/plans/_publicly_visible.html.erb:6 msgid "Template" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:55 +#: ../../app/controllers/org_admin/plans_controller.rb:58 #: ../../app/helpers/plans_helper.rb:22 -#: ../../app/helpers/settings_template_helper.rb:15 +#: ../../app/helpers/settings_template_helper.rb:16 #: ../../app/views/devise/registrations/_password_confirmation.html.erb:22 #: ../../app/views/orgs/_profile_form.html.erb:141 #: ../../app/views/paginable/orgs/_index.html.erb:5 +#: ../../app/views/paginable/plans/_index.html.erb:7 #: ../../app/views/paginable/plans/_org_admin.html.erb:20 -#: ../../app/views/paginable/plans/_org_admin_other_user.html.erb:7 #: ../../app/views/paginable/plans/_publicly_visible.html.erb:7 #: ../../app/views/paginable/templates/_index.html.erb:6 #: ../../app/views/paginable/templates/_organisational.html.erb:12 @@ -495,63 +501,66 @@ msgstr "" msgid "Organisation" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:56 +#: ../../app/controllers/org_admin/plans_controller.rb:59 msgid "Owner name" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:57 +#: ../../app/controllers/org_admin/plans_controller.rb:60 msgid "Owner email" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:58 +#: ../../app/controllers/org_admin/plans_controller.rb:61 +#: ../../app/views/paginable/plans/_index.html.erb:9 #: ../../app/views/paginable/plans/_org_admin.html.erb:23 -#: ../../app/views/paginable/plans/_org_admin_other_user.html.erb:9 #: ../../app/views/paginable/plans/_organisationally_or_publicly_visible.html.erb:18 msgid "Updated" msgstr "" -#: ../../app/controllers/org_admin/plans_controller.rb:59 +#: ../../app/controllers/org_admin/plans_controller.rb:62 #: ../../app/views/org_admin/templates/_form.html.erb:17 #: ../../app/views/org_admin/templates/_show.html.erb:32 +#: ../../app/views/paginable/plans/_index.html.erb:10 #: ../../app/views/paginable/plans/_org_admin.html.erb:24 -#: ../../app/views/paginable/plans/_org_admin_other_user.html.erb:10 #: ../../app/views/paginable/plans/_privately_visible.html.erb:10 msgid "Visibility" msgstr "" -#: ../../app/controllers/org_admin/sections_controller.rb:70 +#: ../../app/controllers/org_admin/sections_controller.rb:71 msgid "Unable to create a new section. The phase you specified does not exist." msgstr "" -#: ../../app/controllers/org_admin/template_copies_controller.rb:18 -#: ../../app/controllers/plans_controller.rb:380 +#: ../../app/controllers/org_admin/sections_controller.rb:133 +msgid "Unable to delete this version of the template." +msgstr "" + +#: ../../app/controllers/org_admin/template_copies_controller.rb:20 +#: ../../app/controllers/plans_controller.rb:396 msgid "copy" msgstr "" #: -#: ../../app/controllers/org_admin/template_customization_transfers_controller.rb:27 +#: ../../app/controllers/org_admin/template_customization_transfers_controller.rb:28 msgid "That template is no longer customizable." msgstr "" -#: ../../app/controllers/org_admin/template_customizations_controller.rb:19 +#: ../../app/controllers/org_admin/template_customizations_controller.rb:21 msgid "Unable to customize that template." msgstr "" -#: ../../app/controllers/org_admin/template_customizations_controller.rb:22 +#: ../../app/controllers/org_admin/template_customizations_controller.rb:24 msgid "That template is not customizable." msgstr "" -#: ../../app/controllers/org_admin/templates_controller.rb:23 +#: ../../app/controllers/org_admin/templates_controller.rb:21 #: ../../app/views/org_admin/templates/index.html.erb:43 msgid "All Templates" msgstr "" -#: ../../app/controllers/org_admin/templates_controller.rb:48 -#: ../../app/views/org_admin/templates/index.html.erb:52 +#: ../../app/controllers/org_admin/templates_controller.rb:47 msgid "%s Templates" msgstr "" -#: ../../app/controllers/org_admin/templates_controller.rb:50 +#: ../../app/controllers/org_admin/templates_controller.rb:49 #: ../../app/views/org_admin/templates/index.html.erb:54 msgid "Own Templates" msgstr "" @@ -560,100 +569,102 @@ msgstr "" msgid "Customizable Templates" msgstr "" -#: ../../app/controllers/org_admin/templates_controller.rb:214 +#: ../../app/controllers/org_admin/templates_controller.rb:215 msgid "Error parsing links for a %