diff --git a/Gemfile b/Gemfile index 768e046..2d9b5b9 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ # ------------------------------------------------ # SUPER ADMIN SECTION -gem "administrate", :github => 'thoughtbot/administrate', :branch =>'master' #:branch =>'v0.4.0' +gem "administrate", :github => 'thoughtbot/administrate', :branch =>'v0.7.0' # ------------------------------------------------ # USERS diff --git a/Gemfile.lock b/Gemfile.lock index 31af02b..53bf3cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,18 +1,18 @@ GIT remote: git://github.com/thoughtbot/administrate.git - revision: 47a2f99e22be87119ef0e3a7af3956984df5842c - branch: master + revision: 6bc227907e8567ca9d8c51658abc92fc2b19ca2d + branch: v0.7.0 specs: - administrate (0.4.0) + administrate (0.7.0) + actionpack (>= 4.2, < 5.1) + actionview (>= 4.2, < 5.1) + activerecord (>= 4.2, < 5.1) autoprefixer-rails (~> 6.0) - bourbon (>= 5.0.0.beta.6) datetime_picker_rails (~> 0.0.7) - jquery-rails (~> 4.0) + jquery-rails (>= 4.0) kaminari (>= 1.0) momentjs-rails (~> 2.8) - neat (~> 1.1) normalize-rails (>= 3.0) - rails (>= 4.2, < 5.1) sass-rails (~> 5.0) selectize-rails (~> 0.6) @@ -65,7 +65,7 @@ addressable (2.4.0) ansi (1.5.0) arel (6.0.3) - autoprefixer-rails (6.7.7.1) + autoprefixer-rails (6.7.7.2) execjs bcrypt (3.1.11) better_errors (2.1.1) @@ -74,9 +74,6 @@ rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bourbon (5.0.0.beta.7) - sass (~> 3.4.22) - thor (~> 0.19.1) builder (3.2.2) byebug (9.0.5) capybara (2.9.1) @@ -218,9 +215,6 @@ multi_xml (0.5.5) multipart-post (2.0.0) mysql2 (0.3.21) - neat (1.8.0) - sass (>= 3.3) - thor (~> 0.19) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) diff --git a/app/controllers/admin/annotations_controller.rb b/app/controllers/admin/annotations_controller.rb new file mode 100644 index 0000000..dc0830e --- /dev/null +++ b/app/controllers/admin/annotations_controller.rb @@ -0,0 +1,21 @@ +module Admin + class AnnotationsController < Admin::ApplicationController + # To customize the behavior of this controller, + # you can overwrite any of the RESTful actions. For example: + # + # def index + # super + # @resources = SuggestedAnswer. + # page(params[:page]). + # per(10) + # end + + # Define a custom finder by overriding the `find_resource` method: + # def find_resource(param) + # SuggestedAnswer.find_by!(slug: param) + # end + + # See https://administrate-prototype.herokuapp.com/customizing_controller_actions + # for more information + end +end diff --git a/app/controllers/admin/answers_controller.rb b/app/controllers/admin/answers_controller.rb index c220635..8960f9f 100644 --- a/app/controllers/admin/answers_controller.rb +++ b/app/controllers/admin/answers_controller.rb @@ -1,7 +1,7 @@ module Admin class AnswersController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/exported_plans_controller.rb b/app/controllers/admin/exported_plans_controller.rb index aecd7f0..e4bde90 100644 --- a/app/controllers/admin/exported_plans_controller.rb +++ b/app/controllers/admin/exported_plans_controller.rb @@ -1,7 +1,7 @@ module Admin class ExportedPlansController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/guidance_groups_controller.rb b/app/controllers/admin/guidance_groups_controller.rb index 6b9ad4b..95d3e7c 100644 --- a/app/controllers/admin/guidance_groups_controller.rb +++ b/app/controllers/admin/guidance_groups_controller.rb @@ -1,7 +1,7 @@ module Admin class GuidanceGroupsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/guidances_controller.rb b/app/controllers/admin/guidances_controller.rb index 6690ff3..1f2495f 100644 --- a/app/controllers/admin/guidances_controller.rb +++ b/app/controllers/admin/guidances_controller.rb @@ -1,7 +1,7 @@ module Admin class GuidancesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/identifier_schemes_controller.rb b/app/controllers/admin/identifier_schemes_controller.rb index 43911d1..eb50d8a 100644 --- a/app/controllers/admin/identifier_schemes_controller.rb +++ b/app/controllers/admin/identifier_schemes_controller.rb @@ -1,7 +1,7 @@ module Admin class IdentifierSchemesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/languages_controller.rb b/app/controllers/admin/languages_controller.rb index e70e606..e58baa9 100644 --- a/app/controllers/admin/languages_controller.rb +++ b/app/controllers/admin/languages_controller.rb @@ -1,7 +1,7 @@ module Admin class LanguagesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/notes_controller.rb b/app/controllers/admin/notes_controller.rb index c740124..db832f4 100644 --- a/app/controllers/admin/notes_controller.rb +++ b/app/controllers/admin/notes_controller.rb @@ -1,7 +1,7 @@ module Admin class NotesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/orgs_controller.rb b/app/controllers/admin/orgs_controller.rb index 91092db..d68f358 100644 --- a/app/controllers/admin/orgs_controller.rb +++ b/app/controllers/admin/orgs_controller.rb @@ -1,7 +1,7 @@ module Admin class OrgsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/perms_controller.rb b/app/controllers/admin/perms_controller.rb index 4e153cc..99e9b95 100644 --- a/app/controllers/admin/perms_controller.rb +++ b/app/controllers/admin/perms_controller.rb @@ -1,7 +1,7 @@ module Admin class PermsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/phases_controller.rb b/app/controllers/admin/phases_controller.rb index 5877a50..de6e3c3 100644 --- a/app/controllers/admin/phases_controller.rb +++ b/app/controllers/admin/phases_controller.rb @@ -1,7 +1,7 @@ module Admin class PhasesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/plans_controller.rb b/app/controllers/admin/plans_controller.rb index aaa9189..424389f 100644 --- a/app/controllers/admin/plans_controller.rb +++ b/app/controllers/admin/plans_controller.rb @@ -1,7 +1,7 @@ module Admin class PlansController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/question_formats_controller.rb b/app/controllers/admin/question_formats_controller.rb index 7644265..1338b69 100644 --- a/app/controllers/admin/question_formats_controller.rb +++ b/app/controllers/admin/question_formats_controller.rb @@ -1,7 +1,7 @@ module Admin class QuestionFormatsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/question_options_controller.rb b/app/controllers/admin/question_options_controller.rb index 237df25..103e543 100644 --- a/app/controllers/admin/question_options_controller.rb +++ b/app/controllers/admin/question_options_controller.rb @@ -1,7 +1,7 @@ module Admin class QuestionOptionsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/questions_controller.rb b/app/controllers/admin/questions_controller.rb index 1be38bf..be5d2a7 100644 --- a/app/controllers/admin/questions_controller.rb +++ b/app/controllers/admin/questions_controller.rb @@ -1,7 +1,7 @@ module Admin class QuestionsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/regions_controller.rb b/app/controllers/admin/regions_controller.rb index 44d2065..6e5627b 100644 --- a/app/controllers/admin/regions_controller.rb +++ b/app/controllers/admin/regions_controller.rb @@ -1,7 +1,7 @@ module Admin class RegionsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/roles_controller.rb b/app/controllers/admin/roles_controller.rb index 6633242..748c165 100644 --- a/app/controllers/admin/roles_controller.rb +++ b/app/controllers/admin/roles_controller.rb @@ -1,7 +1,7 @@ module Admin class RolesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/sections_controller.rb b/app/controllers/admin/sections_controller.rb index b06bb8c..3b94a0a 100644 --- a/app/controllers/admin/sections_controller.rb +++ b/app/controllers/admin/sections_controller.rb @@ -1,7 +1,7 @@ module Admin class SectionsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/splash_logs_controller.rb b/app/controllers/admin/splash_logs_controller.rb index 4cb0f85..aa3fa22 100644 --- a/app/controllers/admin/splash_logs_controller.rb +++ b/app/controllers/admin/splash_logs_controller.rb @@ -1,7 +1,7 @@ module Admin class SplashLogsController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/suggested_answers_controller.rb b/app/controllers/admin/suggested_answers_controller.rb deleted file mode 100644 index 5ee314e..0000000 --- a/app/controllers/admin/suggested_answers_controller.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Admin - class SuggestedAnswersController < Admin::ApplicationController - # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: - # - # def index - # super - # @resources = SuggestedAnswer. - # page(params[:page]). - # per(10) - # end - - # Define a custom finder by overriding the `find_resource` method: - # def find_resource(param) - # SuggestedAnswer.find_by!(slug: param) - # end - - # See https://administrate-prototype.herokuapp.com/customizing_controller_actions - # for more information - end -end diff --git a/app/controllers/admin/templates_controller.rb b/app/controllers/admin/templates_controller.rb index 090a84b..8ac79e1 100644 --- a/app/controllers/admin/templates_controller.rb +++ b/app/controllers/admin/templates_controller.rb @@ -1,7 +1,7 @@ module Admin class TemplatesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/themes_controller.rb b/app/controllers/admin/themes_controller.rb index f15a730..9617c6c 100644 --- a/app/controllers/admin/themes_controller.rb +++ b/app/controllers/admin/themes_controller.rb @@ -1,7 +1,7 @@ module Admin class ThemesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/token_permission_types_controller.rb b/app/controllers/admin/token_permission_types_controller.rb index 7e90c37..37b3487 100644 --- a/app/controllers/admin/token_permission_types_controller.rb +++ b/app/controllers/admin/token_permission_types_controller.rb @@ -1,7 +1,7 @@ module Admin class TokenPermissionTypesController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/user_identifiers_controller.rb b/app/controllers/admin/user_identifiers_controller.rb index 6699719..bdf5faa 100644 --- a/app/controllers/admin/user_identifiers_controller.rb +++ b/app/controllers/admin/user_identifiers_controller.rb @@ -1,7 +1,7 @@ module Admin class UserIdentifiersController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index b456891..70251c0 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,7 +1,7 @@ module Admin class UsersController < Admin::ApplicationController # To customize the behavior of this controller, - # simply overwrite any of the RESTful actions. For example: + # you can overwrite any of the RESTful actions. For example: # # def index # super diff --git a/app/controllers/annotations_controller.rb b/app/controllers/annotations_controller.rb new file mode 100644 index 0000000..a262cb3 --- /dev/null +++ b/app/controllers/annotations_controller.rb @@ -0,0 +1,53 @@ +class AnnotationsController < ApplicationController + respond_to :html + after_action :verify_authorized + + #create annotations + def admin_create + @example_answer = Annotation.new(params[:annotation]) + authorize @example_answer + if @example_answer.save + redirect_to admin_show_phase_path(id: @example_answer.question.section.phase_id, section_id: @example_answer.question.section_id, question_id: @example_answer.question.id, edit: 'true'), notice: _('Information was successfully created.') + else + @section = @example_answer.question.section + @phase = @section.phase + @open = true + @sections = @phase.sections + @section_id = @section.id + @question_id = @example_answer.question + flash[:notice] = failed_create_error(@example_answer, _('example answer')) + render "phases/admin_show" + end + end + + + #update a example answer of a template + def admin_update + @example_answer = Annotation.includes(question: { section: {phase: :template}}).find(params[:id]) + authorize @example_answer #.question.section.phase.template + @question = @example_answer.question + @section = @question.section + @phase = @section.phase + if @example_answer.update_attributes(params[:annotation]) + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, question_id: @question.id, edit: 'true'), notice: _('Information was successfully updated.') + else + flash[:notice] = failed_update_error(@example_answer, _('example answer')) + render action: "phases/admin_show" + end + end + + #delete an annotation + def admin_destroy + @example_answer = Annotation.includes(question: { section: {phase: :template}}).find(params[:id]) + authorize @example_answer + @question = @example_answer.question + @section = @question.section + @phase = @section.phase + if @example_answer.destroy + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: _('Information was successfully deleted.') + else + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: flash[:notice] = failed_destroy_error(@example_answer, _('example answer')) + end + end + +end \ No newline at end of file diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb index 6ed74f3..14a6d21 100644 --- a/app/controllers/questions_controller.rb +++ b/app/controllers/questions_controller.rb @@ -6,12 +6,24 @@ def admin_create @question = Question.new(params[:question]) authorize @question - @question.guidance = params["new-question-guidance"] + example = @question.annotations.first + if example.present? + example.org_id = current_user.org_id + example.example_answer! + end + if params["new-question-guidance"].present? + guidance = @question.annotations.build + guidance.text = params["new-question-guidance"] + guidance.org_id = current_user.org_id + guidance.guidance! + guidance.save + end @question.default_value = params["new-question-default-value"] + @question.modifiable = true if @question.save @question.section.phase.template.dirty = true @question.section.phase.template.save! - + redirect_to admin_show_phase_path(id: @question.section.phase_id, section_id: @question.section_id, question_id: @question.id, edit: 'true'), notice: _('Information was successfully created.') else @edit = (@question.section.phase.template.org == current_user.org) @@ -21,7 +33,7 @@ @sections = @phase.sections @section_id = @question.section.id @question_id = @question.id - + flash[:notice] = failed_create_error(@question, _('question')) render template: 'phases/admin_show' end @@ -31,14 +43,23 @@ def admin_update @question = Question.find(params[:id]) authorize @question - @question.guidance = params["question-guidance-#{params[:id]}"] + guidance = @question.get_guidance_annotation(current_user.org_id) + if params["question-guidance-#{params[:id]}"].present? + if guidance.blank? + guidance = @question.annotations.build + guidance.type = :guidance + end + guidance.text = params["question-guidance-#{params[:id]}"] + guidance.save + end @question.default_value = params["question-default-value-#{params[:id]}"] @section = @question.section @phase = @section.phase + template = @phase.template if @question.update_attributes(params[:question]) - @question.section.phase.template.dirty = true - @question.section.phase.template.save! - + @phase.template.dirty = true + @phase.template.save! + redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, question_id: @question.id, edit: 'true'), notice: _('Information was successfully updated.') else @edit = (@phase.template.org == current_user.org) @@ -46,7 +67,7 @@ @sections = @phase.sections @section_id = @section.id @question_id = @question.id - + flash[:notice] = failed_update_error(@question, _('question')) render template: 'phases/admin_show' end diff --git a/app/controllers/suggested_answers_controller.rb b/app/controllers/suggested_answers_controller.rb deleted file mode 100644 index e15d0c0..0000000 --- a/app/controllers/suggested_answers_controller.rb +++ /dev/null @@ -1,65 +0,0 @@ -class SuggestedAnswersController < ApplicationController - respond_to :html - after_action :verify_authorized - - #create suggested answers - def admin_create - @suggested_answer = SuggestedAnswer.new(params[:suggested_answer]) - authorize @suggested_answer - if @suggested_answer.save - # Set the template's dirty flag to true - @suggested_answer.question.section.phase.template.dirty = true - @suggested_answer.question.section.phase.template.save - - redirect_to admin_show_phase_path(id: @suggested_answer.question.section.phase_id, section_id: @suggested_answer.question.section_id, question_id: @suggested_answer.question.id, edit: 'true'), notice: _('Information was successfully created.') - else - @phase = @suggested_answer.question.section.phase - @section = @suggested_answer.question.section - @open = true - @sections = @phase.sections - @section_id = @section.id - @question_id = @suggested_answer.question - flash[:notice] = failed_create_error(@suggested_answer, _('suggested answer')) - render "phases/admin_show" - end - end - - - #update a suggested answer of a template - def admin_update - @suggested_answer = SuggestedAnswer.includes(question: { section: {phase: :template}}).find(params[:id]) - authorize @suggested_answer #.question.section.phase.template - @question = @suggested_answer.question - @section = @question.section - @phase = @section.phase - if @suggested_answer.update_attributes(params[:suggested_answer]) - # Set the template's dirty flag to true - @phase.template.dirty = true - @phase.template.save - - redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, question_id: @question.id, edit: 'true'), notice: _('Information was successfully updated.') - else - flash[:notice] = failed_update_error(@suggested_answer, _('suggested answer')) - render action: "phases/admin_show" - end - end - - #delete a suggested answer - def admin_destroy - @suggested_answer = SuggestedAnswer.includes(question: { section: {phase: :template}}).find(params[:id]) - authorize @suggested_answer - @question = @suggested_answer.question - @section = @question.section - @phase = @section.phase - if @suggested_answer.destroy - # Set the template's dirty flag to true - @phase.template.dirty = true - @phase.template.save - - redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: _('Information was successfully deleted.') - else - redirect_to admin_show_phase_path(id: @phase.id, section_id: @section.id, edit: 'true'), notice: flash[:notice] = failed_destroy_error(@suggested_answer, _('suggested answer')) - end - end - -end \ No newline at end of file diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index d496f20..4f83340 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -10,30 +10,30 @@ # ----------------------------------------------------- def admin_index authorize Template - + funder_templates, org_templates, customizations = [], [], [] - + # Get all of the unique template family ids (dmptemplate_id) for each funder and the current org funder_ids = Org.funders.includes(:templates).collect{|f| f.templates.collect{|ft| ft.dmptemplate_id } }.flatten.uniq org_ids = current_user.org.templates.collect{|t| t.dmptemplate_id }.flatten.uniq - + org_ids.each do |id| current = Template.current(id) live = Template.live(id) - + # If this isn't a customization of a funder template if current.customization_of.nil? org_templates << {current: current, live: live} - + # This is a customization of a funder template else funder_live = Template.live(current.customization_of) customizations << current.customization_of # Mark the customization as stale if the funder has a newer version - funder_templates << {current: current, live: live, stale: funder_live.updated_at > current.created_at} + funder_templates << {current: current, live: live, stale: funder_live.updated_at > current.created_at} end end - + # Get the funder templates funder_ids.each do |id| # If the org has a customization we don't want to load the funder version @@ -41,11 +41,11 @@ funder_templates << {current: Template.current(id), live: Template.live(id)} end end - - @funder_templates = funder_templates.sort{|x,y| + + @funder_templates = funder_templates.sort{|x,y| x[:current].title <=> y[:current].title } - @org_templates = org_templates.sort{|x,y| + @org_templates = org_templates.sort{|x,y| x[:current].title <=> y[:current].title } end @@ -55,7 +55,7 @@ def admin_customize @template = Template.find(params[:id]) authorize @template - + customisation = Template.deep_copy(@template) customisation.org = current_user.org customisation.version = 0 @@ -65,7 +65,7 @@ break random unless Template.exists?(dmptemplate_id: random) end customisation.save - + customisation.phases.includes(:sections, :questions).each do |phase| phase.modifiable = false phase.save! @@ -78,10 +78,10 @@ end end end - + redirect_to admin_template_template_path(customisation) end - + # PUT /org/admin/templates/:id/admin_publish # ----------------------------------------------------- def admin_publish @@ -89,7 +89,7 @@ authorize @template current = Template.current(@template.dmptemplate_id) - + # Only allow the current version to be updated if current != @template redirect_to admin_template_template_path(@template), notice: _('You can not publish a historical version of this template.') @@ -128,23 +128,32 @@ @template.save flash[:notice] = _('Your template is no longer published. Users will not be able to create new DMPs for this template until you re-publish it') end - + redirect_to admin_index_template_path(current_user.org) end # GET /org/admin/templates/:id/admin_template # ----------------------------------------------------- def admin_template - @template = Template.includes(:org, phases: [sections: [questions: [:question_options, :question_format, - :suggested_answers]]]).find(params[:id]) + @template = Template.includes(:org, phases: [sections: [questions: [:question_options, :question_format, :annotations]]]).find(params[:id]) authorize @template - + @current = Template.current(@template.dmptemplate_id) - + unless @template == @current flash[:notice] = _('You are viewing a historical version of this template. You will not be able to make changes.') end - + + # If the template is published + if @template.published? + # We need to create a new, editable version + new_version = Template.deep_copy(@template) + new_version.version = (@template.version + 1) + new_version.published = false + new_version.save + @template = new_version + end + # once the correct template has been generated, we convert it to hash @hash = @template.to_hash end @@ -155,40 +164,30 @@ def admin_update @template = Template.find(params[:id]) authorize @template - + current = Template.current(@template.dmptemplate_id) - + # Only allow the current version to be updated if current != @template redirect_to admin_template_template_path(@template), notice: _('You can not edit a historical version of this template.') else - # If the template is published so we need to create a new version - if @template.published? - # Create a new version - new_version = Template.deep_copy(@template) - new_version.version = (@template.version + 1) - new_version.published = false - new_version.save - @template = new_version - end - if @template.description != params["template-desc"] || @template.title != params[:template][:title] @template.dirty = true end - + @template.description = params["template-desc"] if @template.update_attributes(params[:template]) flash[:notice] = _('Information was successfully updated.') - + else flash[:notice] = failed_update_error(@template, _('template')) end - + @hash = @template.to_hash render 'admin_template' - end + end end @@ -223,9 +222,9 @@ def admin_destroy @template = Template.find(params[:id]) authorize @template - + current = Template.current(@template.dmptemplate_id) - + # Only allow the current version to be destroyed if current == @template if @template.destroy @@ -250,4 +249,4 @@ @current = Template.current(@template.dmptemplate_id) end -end \ No newline at end of file +end diff --git a/app/dashboards/annotation_dashboard.rb b/app/dashboards/annotation_dashboard.rb new file mode 100644 index 0000000..add7afa --- /dev/null +++ b/app/dashboards/annotation_dashboard.rb @@ -0,0 +1,60 @@ +require "administrate/base_dashboard" + +class AnnotationDashboard < Administrate::BaseDashboard + # ATTRIBUTE_TYPES + # a hash that describes the type of each of the model's fields. + # + # Each different type represents an Administrate::Field object, + # which determines how the attribute is displayed + # on pages throughout the dashboard. + ATTRIBUTE_TYPES = { + org: Field::BelongsTo, + question: Field::BelongsTo, + id: Field::Number, + text: Field::Text, + type: Field::integer, + created_at: Field::DateTime, + updated_at: Field::DateTime, + }.freeze + + # COLLECTION_ATTRIBUTES + # an array of attributes that will be displayed on the model's index page. + # + # By default, it's limited to four items to reduce clutter on index pages. + # Feel free to add, remove, or rearrange items. + COLLECTION_ATTRIBUTES = [ + :org, + :question, + :id, + :text, + ].freeze + + # SHOW_PAGE_ATTRIBUTES + # an array of attributes that will be displayed on the model's show page. + SHOW_PAGE_ATTRIBUTES = [ + :org, + :question, + :id, + :text, + :type, + :created_at, + :updated_at, + ].freeze + + # FORM_ATTRIBUTES + # an array of attributes that will be displayed + # on the model's form (`new` and `edit`) pages. + FORM_ATTRIBUTES = [ + :org, + :question, + :text, + :type, + ].freeze + + # Overwrite this method to customize how suggested answers are displayed + # across all pages of the admin dashboard. + # + # def display_resource(suggested_answer) + # "SuggestedAnswer ##{suggested_answer.id}" + # end +end diff --git a/app/dashboards/org_dashboard.rb b/app/dashboards/org_dashboard.rb index 013748f..c00db7b 100644 --- a/app/dashboards/org_dashboard.rb +++ b/app/dashboards/org_dashboard.rb @@ -12,7 +12,7 @@ guidance_groups: Field::HasMany, templates: Field::HasMany, users: Field::HasMany, - suggested_answers: Field::HasMany, + annotations: Field::HasMany, token_permission_types: Field::HasMany, id: Field::Number, name: Field::String, @@ -59,7 +59,7 @@ :contact_email, :org_type, :users, - :suggested_answers, + :annotations, :token_permission_types, :id, :target_url, @@ -84,7 +84,7 @@ :guidance_groups, # :templates, # :users, -# :suggested_answers, +# :annotations, :token_permission_types, :name, :abbreviation, diff --git a/app/dashboards/question_dashboard.rb b/app/dashboards/question_dashboard.rb index 1d1f8aa..af3d8bb 100644 --- a/app/dashboards/question_dashboard.rb +++ b/app/dashboards/question_dashboard.rb @@ -10,7 +10,7 @@ ATTRIBUTE_TYPES = { answers: Field::HasMany, question_options: Field::HasMany, - suggested_answers: Field::HasMany, + annotations: Field::HasMany, themes: Field::HasMany, section: Field::BelongsTo, question_format: Field::BelongsTo, @@ -33,7 +33,7 @@ COLLECTION_ATTRIBUTES = [ :answers, :question_options, - :suggested_answers, + :annotations, :themes, ].freeze @@ -42,7 +42,7 @@ SHOW_PAGE_ATTRIBUTES = [ :answers, :question_options, - :suggested_answers, + :annotations, :themes, :section, :question_format, @@ -63,7 +63,7 @@ FORM_ATTRIBUTES = [ :answers, :question_options, - :suggested_answers, + :annotations, :themes, :section, :question_format, diff --git a/app/dashboards/suggested_answer_dashboard.rb b/app/dashboards/suggested_answer_dashboard.rb deleted file mode 100644 index 980ef11..0000000 --- a/app/dashboards/suggested_answer_dashboard.rb +++ /dev/null @@ -1,60 +0,0 @@ -require "administrate/base_dashboard" - -class SuggestedAnswerDashboard < Administrate::BaseDashboard - # ATTRIBUTE_TYPES - # a hash that describes the type of each of the model's fields. - # - # Each different type represents an Administrate::Field object, - # which determines how the attribute is displayed - # on pages throughout the dashboard. - ATTRIBUTE_TYPES = { - org: Field::BelongsTo, - question: Field::BelongsTo, - id: Field::Number, - text: Field::Text, - is_example: Field::Boolean, - created_at: Field::DateTime, - updated_at: Field::DateTime, - }.freeze - - # COLLECTION_ATTRIBUTES - # an array of attributes that will be displayed on the model's index page. - # - # By default, it's limited to four items to reduce clutter on index pages. - # Feel free to add, remove, or rearrange items. - COLLECTION_ATTRIBUTES = [ - :org, - :question, - :id, - :text, - ].freeze - - # SHOW_PAGE_ATTRIBUTES - # an array of attributes that will be displayed on the model's show page. - SHOW_PAGE_ATTRIBUTES = [ - :org, - :question, - :id, - :text, - :is_example, - :created_at, - :updated_at, - ].freeze - - # FORM_ATTRIBUTES - # an array of attributes that will be displayed - # on the model's form (`new` and `edit`) pages. - FORM_ATTRIBUTES = [ - :org, - :question, - :text, - :is_example, - ].freeze - - # Overwrite this method to customize how suggested answers are displayed - # across all pages of the admin dashboard. - # - # def display_resource(suggested_answer) - # "SuggestedAnswer ##{suggested_answer.id}" - # end -end diff --git a/app/dashboards/user_dashboard.rb b/app/dashboards/user_dashboard.rb index 687d2b9..4ba23ad 100644 --- a/app/dashboards/user_dashboard.rb +++ b/app/dashboards/user_dashboard.rb @@ -82,7 +82,6 @@ :plans, :user_identifiers, :identifier_schemes, - :setting_objects, :orcid_id, :shibboleth_id, :created_at, @@ -122,7 +121,6 @@ # :plans, :user_identifiers, :identifier_schemes, -# :setting_objects, :firstname, :surname, :email, @@ -159,5 +157,4 @@ def display_resource(user) "#{user.firstname} #{user.surname} (##{user.id})" end - end diff --git a/app/models/annotation.rb b/app/models/annotation.rb new file mode 100644 index 0000000..66b58e6 --- /dev/null +++ b/app/models/annotation.rb @@ -0,0 +1,40 @@ +class Annotation < ActiveRecord::Base + enum type: [ :guidance, :example_answer] + ## + # Associations + belongs_to :org + belongs_to :question + + ## + # I liked type as the name for the enum so overriding inheritance column + self.inheritance_column = nil + + ## + # Possibly needed for active_admin + # -relies on protected_attributes gem as syntax depricated in rails 4.2 + attr_accessible :org_id, :question_id, :text, :type, + :org, :question, :as => [:default, :admin] + + + validates :question, :org, presence: {message: _("can't be blank")} + + ## + # returns the text from the annotation + # + # @return [String] the text from the annotation + def to_s + "#{text}" + end + + + ## + # deep copy the given annotation and all it's associations + # + # @params [Annotation] annotation to be deep copied + # @return [Annotation] the saved, copied annotation + def self.deep_copy(annotation) + annotation_copy = annotation.dup + annotation_copy.save! + return annotation_copy + end +end \ No newline at end of file diff --git a/app/models/org.rb b/app/models/org.rb index e11d5e1..e754693 100644 --- a/app/models/org.rb +++ b/app/models/org.rb @@ -10,7 +10,7 @@ has_many :guidance_groups has_many :templates has_many :users - has_many :suggested_answers + has_many :annotations has_and_belongs_to_many :token_permission_types, join_table: "org_token_permissions", unique: true diff --git a/app/models/plan.rb b/app/models/plan.rb index 8c8d3c7..549b4fe 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -970,7 +970,7 @@ def self.eager_load2(id) Plan.includes( [{template: [ - {phases: {sections: {questions: [{answers: :notes}, :suggested_answers, :question_format, :themes]}}}, + {phases: {sections: {questions: [{answers: :notes}, :annotations, :question_format, :themes]}}}, {customizations: :org}, :org ]}, diff --git a/app/models/question.rb b/app/models/question.rb index 336cae9..10efc8b 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -3,7 +3,7 @@ # Associations has_many :answers, :dependent => :destroy has_many :question_options, :dependent => :destroy - has_many :suggested_answers, :dependent => :destroy + has_many :annotations, :dependent => :destroy has_and_belongs_to_many :themes, join_table: "questions_themes" belongs_to :section belongs_to :question_format @@ -13,17 +13,17 @@ # TODO: evaluate if we need this accepts_nested_attributes_for :answers, :reject_if => lambda {|a| a[:text].blank? }, :allow_destroy => true accepts_nested_attributes_for :question_options, :reject_if => lambda {|a| a[:text].blank? }, :allow_destroy => true - accepts_nested_attributes_for :suggested_answers, :allow_destroy => true + accepts_nested_attributes_for :annotations, :allow_destroy => true accepts_nested_attributes_for :themes ## # Possibly needed for active_admin # -relies on protected_attributes gem as syntax depricated in rails 4.2 attr_accessible :default_value, :dependency_id, :dependency_text, :guidance,:number, - :suggested_answer, :text, :section_id, :question_format_id, - :question_options_attributes, :suggested_answers_attributes, + :annotation, :text, :section_id, :question_format_id, + :question_options_attributes, :annotations_attributes, :option_comment_display, :theme_ids, :section, :question_format, - :question_options, :suggested_answers, :answers, :themes, + :question_options, :annotations, :answers, :themes, :modifiable, :option_comment_display, :as => [:default, :admin] validates :text, :section, :number, presence: {message: _("can't be blank")} @@ -65,10 +65,10 @@ question_option_copy.question_id = question_copy.id question_option_copy.save! end - question.suggested_answers.each do |suggested_answer| - suggested_answer_copy = SuggestedAnswer.deep_copy(suggested_answer) - suggested_answer_copy.question_id = question_copy.id - suggested_answer_copy.save! + question.annotations.each do |annotation| + annotation_copy = Annotation.deep_copy(annotation) + annotation_copy.question_id = question_copy.id + annotation_copy.save! end question.themes.each do |theme| question_copy.themes << theme @@ -101,13 +101,24 @@ end ## - # get suggested answer belonging to the currents user for this question + # get example answer belonging to the currents user for this question # # @param org_id [Integer] the id for the organisation - # @return [String] the suggested_answer for this question for the specified organisation - def get_suggested_answer(org_id) - suggested_answer = suggested_answers.find_by(org_id: org_id) - return suggested_answer + # @return [String] the example answer for this question for the specified org + def get_example_answer(org_id) + example_answer = self.annotations.where(org_id: org_id).where(type: Annotation.types[:example_answer]).order(:created_at) + return example_answer.first end + ## + # get guidance belonging to the current user's org for this question(need org + # to distinguish customizations) + # + # @param org_id [Integer] the id for the organisation + # @return [String] the annotation guidance for this question for the specified org + def get_guidance_annotation(org_id) + guidance = self.annotations.where(org_id: org_id).where(type: Annotation.types[:guidance]) + return guidance.first + end + end diff --git a/app/models/suggested_answer.rb b/app/models/suggested_answer.rb deleted file mode 100644 index 881f302..0000000 --- a/app/models/suggested_answer.rb +++ /dev/null @@ -1,42 +0,0 @@ -class SuggestedAnswer < ActiveRecord::Base - - ## - # Associations - belongs_to :org - belongs_to :question - - ## - # Possibly needed for active_admin - # -relies on protected_attributes gem as syntax depricated in rails 4.2 - attr_accessible :org_id, :question_id, :text, :is_example, - :org, :question, :as => [:default, :admin] - - - validates :question, :org, presence: {message: _("can't be blank")} - - # EVALUATE CLASS AND INSTANCE METHODS BELOW - # - # What do they do? do they do it efficiently, and do we need them? - - - - ## - # returns the text from the suggested_answer - # - # @return [String] the text from the suggested_answer - def to_s - "#{text}" - end - - - ## - # deep copy the given question_option and all it's associations - # - # @params [QuestionOption] question_option to be deep copied - # @return [QuestionOption] the saved, copied question_option - def self.deep_copy(suggested_answer) - suggested_answer_copy = suggested_answer.dup - suggested_answer_copy.save! - return suggested_answer_copy - end -end \ No newline at end of file diff --git a/app/models/template.rb b/app/models/template.rb index 94a845b..f7d5639 100644 --- a/app/models/template.rb +++ b/app/models/template.rb @@ -67,11 +67,11 @@ ## # convert the given template to a hash and return with all it's associations - # to use, please pre-fetch org, phases, section, questions, suggested_answers, + # to use, please pre-fetch org, phases, section, questions, annotations, # question_options, question_formats, # TODO: Themes & guidance? # - # @return [hash] hash of template, phases, sections, questions, question_options, suggested_answers + # @return [hash] hash of template, phases, sections, questions, question_options, annotations def to_hash hash = {} hash[:template] = {} @@ -90,10 +90,10 @@ section.questions.each do |question| phases[phase.number][:sections][section.number][:questions][question.number] = {} phases[phase.number][:sections][section.number][:questions][question.number][:data] = question - phases[phase.number][:sections][section.number][:questions][question.number][:suggested_answers] = {} - question.suggested_answers.each do |suggested_answer| - phases[phase.number][:sections][section.number][:questions][question.number][:suggested_answers][suggested_answer.id] = {} - phases[phase.number][:sections][section.number][:questions][question.number][:suggested_answers][suggested_answer.id][:data] = suggested_answer + phases[phase.number][:sections][section.number][:questions][question.number][:annotations] = {} + question.annotations.each do |annotation| + phases[phase.number][:sections][section.number][:questions][question.number][:annotations][annotation.id] = {} + phases[phase.number][:sections][section.number][:questions][question.number][:annotations][annotation.id][:data] = annotation end phases[phase.number][:sections][section.number][:questions][question.number][:question_options] = {} question.question_options.each do |question_option| diff --git a/app/policies/annotation_policy.rb b/app/policies/annotation_policy.rb new file mode 100644 index 0000000..cf63f42 --- /dev/null +++ b/app/policies/annotation_policy.rb @@ -0,0 +1,28 @@ +class AnnotationPolicy < ApplicationPolicy + attr_reader :user, :annotation + + def initialize(user, annotation) + raise Pundit::NotAuthorizedError, "must be logged in" unless user + @user = user + @annotation = annotation + end + + ## + # Users can modify annotations if: + # - They can modify templates + # - The template which they are modifying belongs to their orggi + ## + + def admin_create? + user.can_modify_templates? && (annotation.question.section.phase.template.org_id == user.org_id) + end + + def admin_update? + user.can_modify_templates? && (annotation.question.section.phase.template.org_id == user.org_id) + end + + def admin_destroy? + user.can_modify_templates? && (annotation.question.section.phase.template.org_id == user.org_id) + end + +end \ No newline at end of file diff --git a/app/policies/suggested_answer_policy.rb b/app/policies/suggested_answer_policy.rb deleted file mode 100644 index e6cd49c..0000000 --- a/app/policies/suggested_answer_policy.rb +++ /dev/null @@ -1,28 +0,0 @@ -class SuggestedAnswerPolicy < ApplicationPolicy - attr_reader :user, :suggested_answer - - def initialize(user, suggested_answer) - raise Pundit::NotAuthorizedError, "must be logged in" unless user - @user = user - @suggested_answer = suggested_answer - end - - ## - # Users can modify suggested answers if: - # - They can modify templates - # - The template which they are modifying belongs to their org - ## - - def admin_create? - user.can_modify_templates? && (suggested_answer.question.section.phase.template.org_id == user.org_id) - end - - def admin_update? - user.can_modify_templates? && (suggested_answer.question.section.phase.template.org_id == user.org_id) - end - - def admin_destroy? - user.can_modify_templates? && (suggested_answer.question.section.phase.template.org_id == user.org_id) - end - -end \ No newline at end of file diff --git a/app/views/admin/application/_admin_header.html.erb b/app/views/admin/application/_admin_header.html.erb deleted file mode 100644 index 6f7bcb5..0000000 --- a/app/views/admin/application/_admin_header.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -
| <%= _('Example Answer')%> | +
+
|
+
| <%= _('Example of Answer')%> | +
+
|
+
| + <%= _('Example of answer')%> + | +<%= raw annotation.text %> | +
- <%= raw suggested_answer.text %> + <%= raw annotation.text %>
<%= comments_label_with_count %>
- <%else%> + <% else %><%= _('Share note') %>
- <%end%> + <% end %>- <%= raw suggested_answer.text %> + <%= raw annotation.text %>
- <%= raw suggested_answer.text %> -
-<%= comments_label_with_count %>
- <%else%> -<%= _('Share note') %>
- <%end%> -- <%= raw suggested_answer.text %> + <%= raw annotation.text %>
- <%= raw suggested_answer.text %> + <%= raw annotations.text %>
| <%= _('Suggested answer/ Example')%> | -
-
|
-
| <%= _('Suggested answer/ Example')%> | -
-
|
-
| - <% if suggested_answer.is_example? then %> - <%= _('Example of answer')%> - <% else %> - <%= _('Suggested answer')%> - <% end %> - | -<%= raw suggested_answer.text %> | -
If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "" @@ -204,6 +201,18 @@ msgid "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" msgstr "" +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "" + msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "" @@ -213,6 +222,9 @@ msgid "A required setting has not been provided" msgstr "" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "" @@ -327,6 +339,9 @@ msgid "Before submitting, please consider:" msgstr "" +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "" @@ -351,9 +366,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "" -msgid "Choose a template" -msgstr "" - msgid "Click here" msgstr "" @@ -390,6 +402,9 @@ msgid "Contact Email" msgstr "" +msgid "Contact Us" +msgstr "" + msgid "Contact us" msgstr "" @@ -540,6 +555,9 @@ msgid "File Name" msgstr "" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "" @@ -552,13 +570,16 @@ msgid "Forgot your password?" msgstr "" +msgid "Format" +msgstr "" + msgid "Funder" msgstr "" -msgid "Funder name" +msgid "Funders templates" msgstr "" -msgid "Funders templates" +msgid "Funding organisation" msgstr "" msgid "Future plans" @@ -627,10 +648,10 @@ msgid "ID" msgstr "" -msgid "If applying for funding, select your research funder." +msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "" -msgid "If applying for funding, state the name exactly as in the grant proposal." +msgid "If applying for funding, state the title exactly as in the proposal." msgstr "" msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." @@ -699,9 +720,6 @@ msgid "Left" msgstr "" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "" - msgid "List of users" msgstr "" @@ -726,16 +744,22 @@ msgid "Me" msgstr "" +msgid "Message" +msgstr "" + msgid "Multi select box" msgstr "" +msgid "My Plan" +msgstr "" + msgid "My organisation isn't listed." msgstr "" -msgid "My plan" +msgid "My plans" msgstr "" -msgid "My plans" +msgid "My research organisation is not on the list" msgstr "" msgid "Name" @@ -747,9 +771,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "" -msgid "Name of funder, if applicable." -msgstr "" - msgid "New guidance" msgstr "" @@ -771,6 +792,12 @@ msgid "No additional comment area will be displayed." msgstr "" +msgid "No funder associated with this plan" +msgstr "" + +msgid "No items available." +msgstr "" + msgid "No matches" msgstr "" @@ -780,9 +807,6 @@ msgid "Not answered yet" msgstr "" -msgid "Not applicable/not listed." -msgstr "" - msgid "Note" msgstr "" @@ -846,9 +870,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "" - msgid "Own templates" msgstr "" @@ -894,9 +915,6 @@ msgid "Plan name" msgstr "" -msgid "Plan was successfully created." -msgstr "" - msgid "Plan was successfully deleted." msgstr "" @@ -921,6 +939,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "" @@ -933,18 +954,30 @@ msgid "Please enter your surname or family name." msgstr "" +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "" +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "" + msgid "Please only enter up to 165 characters, you have used" msgstr "" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "" msgid "Preview" msgstr "" +msgid "Primary research organisation" +msgstr "" + msgid "Principal Investigator / Researcher" msgstr "" @@ -963,6 +996,9 @@ msgid "Privileges" msgstr "" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "" @@ -1047,24 +1083,24 @@ msgid "Sections" msgstr "" -msgid "Select Funder" -msgstr "" - -msgid "Select Organisation" +msgid "Select a template" msgstr "" msgid "Select an action" msgstr "" +msgid "Select the funding organisation" +msgstr "" + +msgid "Select the primary research organisation responsible" +msgstr "" + msgid "Select which group this guidance relates to." msgstr "" msgid "Select which theme(s) this guidance relates to." msgstr "" -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1104,6 +1140,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1155,6 +1194,9 @@ msgid "That template is not currently published." msgstr "" +msgid "The" +msgstr "" + msgid "The " msgstr "" @@ -1170,9 +1212,6 @@ msgid "Themes" msgstr "" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "" - msgid "There are no public DMPs." msgstr "" @@ -1203,21 +1242,18 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "" +msgid "This plan is based on the default template." +msgstr "" + msgid "This plan is based on:" msgstr "" msgid "This section is locked for editing by " msgstr "" -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "" - msgid "Title" msgstr "" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "" - msgid "Top" msgstr "" @@ -1248,9 +1284,6 @@ msgid "Unlink institutional credentials alert" msgstr "" -msgid "Unlink your institutional credentials" -msgstr "" - msgid "Unlock my account" msgstr "" @@ -1278,6 +1311,9 @@ msgid "Users" msgstr "" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "" @@ -1299,6 +1335,15 @@ msgid "Visibility" msgstr "" +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "" + +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "" + +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "" + msgid "Website" msgstr "" @@ -1311,9 +1356,15 @@ msgid "Welcome." msgstr "" +msgid "What research project are you planning?" +msgstr "" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "" +msgid "Which DMP template would you like to use?" +msgstr "" + msgid "While you were editing " msgstr "" @@ -1356,6 +1407,9 @@ msgid "You can edit any of the details below." msgstr "" +msgid "You can not continue until you have filled in all of the required information." +msgstr "" + msgid "You can not edit a historical version of this template." msgstr "" @@ -1380,9 +1434,6 @@ msgid "You have unsaved answers in the following sections:" msgstr "" -msgid "You may leave blank or select a different organisation to your own." -msgstr "" - msgid "You must accept the terms and conditions to register." msgstr "" @@ -1407,9 +1458,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "" -msgid "Your account is linked to your institutional credentials." -msgstr "" - msgid "Your account won't be created until you access the link above and set your password." msgstr "" @@ -1491,10 +1539,10 @@ msgid "e.g. School/ Department" msgstr "" -msgid "format" +msgid "from now" msgstr "" -msgid "from now" +msgid "generic template" msgstr "" msgid "guidance" @@ -1539,6 +1587,9 @@ msgid "must have access to guidances api" msgstr "" +msgid "no research organisation is associated with this plan" +msgstr "" + msgid "note" msgstr "" diff --git a/config/locale/de/app.po b/config/locale/de/app.po index 36ef44b..bdbe788 100644 --- a/config/locale/de/app.po +++ b/config/locale/de/app.po @@ -23,31 +23,22 @@ msgstr " - " #, fuzzy -msgid " - choosing default template for your institution" -msgstr " - " - -#, fuzzy -msgid " - no funder or institution template, choosing default template" -msgstr " - " - -#, fuzzy -msgid " - there are more than one to choose from" -msgstr " - " - -#, fuzzy -msgid " - using template customised by your institution" -msgstr " von " - -#, fuzzy msgid " I accept the terms and conditions *" msgstr "Ich akzeptiere die Nutzungsbedingungen *" +#, fuzzy +msgid " Plan" +msgstr "plans" + msgid " access to" msgstr "" msgid " access. " msgstr "" +msgid " and " +msgstr "" + #, fuzzy msgid " by" msgstr " von " @@ -73,10 +64,17 @@ msgid " once you click save!" msgstr "" +msgid " or " +msgstr "" + #, fuzzy msgid " password. You can do this through the link below." msgstr "password. You can do this through the link below." +#, fuzzy +msgid " provided by " +msgstr " von " + msgid " saved the following answer:" msgstr "" @@ -85,6 +83,10 @@ msgstr "am" #, fuzzy +msgid " that has been customised by " +msgstr " von " + +#, fuzzy msgid " to accept the invitation, (or copy " msgstr "(or copy" @@ -121,6 +123,10 @@ msgid "%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "Falls Sie eine Vorlage für eine Institution anlegen möchten, können Sie den Knopf 'Vorlage erstellen' nutzen. Sie können verschiedene Vorlagen erstellen um auf Spezialisierungen einzugehen, z.B. für Forscher und für Doktoranden.
" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "Bitte beachten Sie, dass Ihre Email-Adresse als Nutzername verwendet wird. Vergessen Sie nicht, Ihre neue E-Mail-Adresse beim der nächsten Anmeldung zu verwenden, falls Sie diese geändert haben.
" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "Bitte wählen Sie aus folgendem Drop-Down-Menü, so dass wir bestimmen können, welche Fragen und Hilfestellungen in Ihrem Plan angezeigt werden sollen.
Falls Sie nicht den spezifischen Anforderungen eines Geldgebers oder einer Institution folgen, wählen Sie hier, um einen generischen DMP zu schreiben , der auf den allgemeinsten Themen basiert.
" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "Wählen Sie die für diese Frage relevanten Themen aus.
Dies erlaubt es, sowohl generischen Hilfestellungen auf Institutions-Ebene, als auch aus anderen Quellen, wie z.B. der DINI, oder jedweder Institute oder Einrichtungen, für die Sie Unterstützung anbieten, einzubeziehen.
Sie können mehrere Themen durch klicken und gleichzeitiges Drücken der Steuerungs- bzw. Kommando-Taste auswählen.
" @@ -220,6 +217,19 @@ msgstr "templates" #, fuzzy +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "DMPonline" + +#, fuzzy msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "A colleague has invited you to contribute to their Data Management Plan at" @@ -229,6 +239,9 @@ msgid "A required setting has not been provided" msgstr "Eine benötigte Einstellung wurde nicht erbracht" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "" @@ -347,6 +360,10 @@ msgid "Before submitting, please consider:" msgstr "" +#, fuzzy +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "Fragen" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "Folgend findet sich die Liste von Benutzern registriert bzgl. Ihrer Org. Sie können diese Liste bzgl. aller Felder sortieren." @@ -372,9 +389,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "Markieren Sie dieses Kästchen, wenn Sie bereit sind, für diese Anleitung für Benutzer-Pläne zu erscheinen." -msgid "Choose a template" -msgstr "" - msgid "Click here" msgstr "" @@ -414,6 +428,10 @@ msgid "Contact Email" msgstr "Kontakt Email" +#, fuzzy +msgid "Contact Us" +msgstr "Kontakt" + msgid "Contact us" msgstr "Kontakt" @@ -567,6 +585,9 @@ msgid "File Name" msgstr "Dateiname" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "Filter Pläne" @@ -579,15 +600,19 @@ msgid "Forgot your password?" msgstr "Passwort vergessen?" +msgid "Format" +msgstr "" + msgid "Funder" msgstr "Funder" -msgid "Funder name" -msgstr "Name des Geldgebers" - msgid "Funders templates" msgstr "Vorlagen der Geldgeber" +#, fuzzy +msgid "Funding organisation" +msgstr "Organisation" + msgid "Future plans" msgstr "" @@ -656,12 +681,13 @@ msgid "ID" msgstr "ID" -msgid "If applying for funding, select your research funder." -msgstr "Falls Sie Fördermittel beantragen, wählen Sie bitte den Förderer aus." - msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "Falls Sie einen Förderantrag stellen, geben Sie bitte den Namen exakt genau so an, wie im Förderantrag." +#, fuzzy +msgid "If applying for funding, state the title exactly as in the proposal." +msgstr "Falls Sie einen Förderantrag stellen, geben Sie bitte den Namen exakt genau so an, wie im Förderantrag." + msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." msgstr "Falls die Hilfestellung nur für eine bestimmte Nutzergruppe, wie z.B. eine bestimmte Fakultät oder ein Institut, bestimmt ist, wählen Sie diese Option aus. Die Nutzer können die Anzeige von Hilfestellungen dieser Untergruppe im 'Plan erstellen'-Assistenten auswählen." @@ -728,9 +754,6 @@ msgid "Left" msgstr "Links" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "Link your DMP Builder account to your institutional credentials" - msgid "List of users" msgstr "Liste der Nutzer" @@ -755,18 +778,27 @@ msgid "Me" msgstr "Ich" +#, fuzzy +msgid "Message" +msgstr "Ich" + msgid "Multi select box" msgstr "Mehrfachauswahlliste" +#, fuzzy +msgid "My Plan" +msgstr "Mein Plan" + msgid "My organisation isn't listed." msgstr "Meine Organisation ist nicht in der Auflistung." -msgid "My plan" -msgstr "Mein Plan" - msgid "My plans" msgstr "Meine Pläne" +#, fuzzy +msgid "My research organisation is not on the list" +msgstr "Organisation" + msgid "Name" msgstr "Name" @@ -776,9 +808,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "Name des Principal Investigators oder der Leitung des Projektes." -msgid "Name of funder, if applicable." -msgstr "Name des Geldgebers, falls anwendbar." - msgid "New guidance" msgstr "Neue Hilfestellung" @@ -800,6 +829,13 @@ msgid "No additional comment area will be displayed." msgstr "" +#, fuzzy +msgid "No funder associated with this plan" +msgstr "plans" + +msgid "No items available." +msgstr "" + msgid "No matches" msgstr "Kein Plan erfüllt '%{filter}'" @@ -809,9 +845,6 @@ msgid "Not answered yet" msgstr "Noch nicht beantwortet" -msgid "Not applicable/not listed." -msgstr "Nicht anwendbar / nicht gelistet." - msgid "Note" msgstr "Kommentar" @@ -876,9 +909,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "Falls nicht, lassen Sie dieses Feld bitte unberührt." - msgid "Own templates" msgstr "Eigene Vorlagen" @@ -925,9 +955,6 @@ msgid "Plan name" msgstr "Name des Plans" -msgid "Plan was successfully created." -msgstr "Plan wurde erfolgreich angelegt." - #, fuzzy msgid "Plan was successfully deleted." msgstr "Plan wurde erfolgreich angelegt." @@ -953,6 +980,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "Bitte geben Sie ihren Vornamen ein." @@ -965,18 +995,32 @@ msgid "Please enter your surname or family name." msgstr "Bitte geben Sie ihren Familien- bzw. Nachnamen ein." +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "Bitte geben Sie im Folgenden die Projektdetails an und wählen 'Aktualisieren' aus, um die Änderungen zu speichern." +#, fuzzy +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "Bitte beachten Sie, dass Ihre Email-Adresse als Nutzername verwendet wird. Vergessen Sie nicht, Ihre neue E-Mail-Adresse beim der nächsten Anmeldung zu verwenden, falls Sie diese geändert haben.
" + msgid "Please only enter up to 165 characters, you have used" msgstr "Please only enter up to 165 characters, you have used" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "Policy Expectations" msgid "Preview" msgstr "Vorschau" +#, fuzzy +msgid "Primary research organisation" +msgstr "Organisation" + msgid "Principal Investigator / Researcher" msgstr "Principal Investigator / Forscher" @@ -995,6 +1039,9 @@ msgid "Privileges" msgstr "" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "Öffentlichkeit" @@ -1079,24 +1126,27 @@ msgid "Sections" msgstr "Abschnitte" -msgid "Select Funder" -msgstr "Funder" - -msgid "Select Organisation" -msgstr "Organisation" +#, fuzzy +msgid "Select a template" +msgstr "templates" msgid "Select an action" msgstr "Wählen Sie eine Aktion" +#, fuzzy +msgid "Select the funding organisation" +msgstr "Organisation" + +#, fuzzy +msgid "Select the primary research organisation responsible" +msgstr "Organisation" + msgid "Select which group this guidance relates to." msgstr "Wählen Sie die Gruppe aus, für die diese Hilfestellung relevant ist." msgid "Select which theme(s) this guidance relates to." msgstr "Wählen Sie die Themen aus, für die diese Hilfestellung relevant ist." -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1137,6 +1187,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1190,6 +1243,9 @@ msgid "That template is not currently published." msgstr "templates" +msgid "The" +msgstr "" + msgid "The " msgstr "" @@ -1205,9 +1261,6 @@ msgid "Themes" msgstr "Themen" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "Es stehen verschiedene mögliche Vorlagen zur Auswahl. Bitte wählen Sie eine aus." - msgid "There are no public DMPs." msgstr "Es wurden noch keine DMPs veröffentlicht." @@ -1238,21 +1291,19 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "Diese Seite bietet Ihnen einen Überblick über Ihren Plan. Sie gibt an, worauf dieser Plan basiert und gibt eine Übersicht über die Fragen, die gestellt werden." +#, fuzzy +msgid "This plan is based on the default template." +msgstr "templates" + msgid "This plan is based on:" msgstr "Dieser Plan basiert auf:" msgid "This section is locked for editing by " msgstr "Dieser Abschnitt ist gespert wegen Bearbeitung durch " -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "Wählen Sie jede beliebige andere Quelle für Hilfestellungen." - msgid "Title" msgstr "Titel" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "Um Fragen und Hilfestellung einer bestimmten Organisation zu integrieren, wählen Sie diese bitte aus." - msgid "Top" msgstr "Oben" @@ -1284,9 +1335,6 @@ msgid "Unlink institutional credentials alert" msgstr "Unlink institutional credentials alert" -msgid "Unlink your institutional credentials" -msgstr "Unlink your institutional credentials" - msgid "Unlock my account" msgstr "Unlock my account" @@ -1315,6 +1363,9 @@ msgid "Users" msgstr "Nutzer" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "Version" @@ -1336,6 +1387,18 @@ msgid "Visibility" msgstr "Sichtweite" +#, fuzzy +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "templates" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "Organisation" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "templates" + msgid "Website" msgstr "Web-Seite" @@ -1349,9 +1412,17 @@ msgid "Welcome." msgstr "Willkommen." +#, fuzzy +msgid "What research project are you planning?" +msgstr "plans" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "Wenn Sie eine neue Phase in einer Vorlage anlegen, wird automatische eine Version erzeugt. Nachdem Sie das folgende Formular ausgefüllt haben, werden Ihnen Optionen zum erstellen von Abschnitten und Fragen angezeigt." +#, fuzzy +msgid "Which DMP template would you like to use?" +msgstr "templates" + msgid "While you were editing " msgstr "" @@ -1395,6 +1466,9 @@ msgid "You can edit any of the details below." msgstr "Alle folgenden Angaben können bearbeitet werden." +msgid "You can not continue until you have filled in all of the required information." +msgstr "" + #, fuzzy msgid "You can not edit a historical version of this template." msgstr "templates" @@ -1425,9 +1499,6 @@ msgstr "" "You have unsaved answers in the following sections:\n" -msgid "You may leave blank or select a different organisation to your own." -msgstr "Sie können eine beliebige Organisation wählen, oder das Feld leer lassen." - msgid "You must accept the terms and conditions to register." msgstr "" @@ -1455,9 +1526,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "Your " -msgid "Your account is linked to your institutional credentials." -msgstr "Your account is linked to your institutional credentials." - #, fuzzy msgid "Your account won't be created until you access the link above and set your password." msgstr "Your " @@ -1553,12 +1621,13 @@ msgid "e.g. School/ Department" msgstr "z.B. Fakultät / Einrichtung" -msgid "format" -msgstr "" - msgid "from now" msgstr "" +#, fuzzy +msgid "generic template" +msgstr "templates" + msgid "guidance" msgstr "" @@ -1606,6 +1675,10 @@ msgstr "guidances" #, fuzzy +msgid "no research organisation is associated with this plan" +msgstr "Organisation" + +#, fuzzy msgid "note" msgstr "Kommentar" diff --git a/config/locale/en_GB/app.po b/config/locale/en_GB/app.po index 26f3a5d..3a2db97 100644 --- a/config/locale/en_GB/app.po +++ b/config/locale/en_GB/app.po @@ -22,21 +22,13 @@ msgid " - " msgstr " - " -msgid " - choosing default template for your institution" -msgstr " - choosing default template for your institution" - -msgid " - no funder or institution template, choosing default template" -msgstr " - no funder or institution template, choosing default template" - -msgid " - there are more than one to choose from" -msgstr " - there are more than one to choose from" - -msgid " - using template customised by your institution" -msgstr " - using template customised by your institution" - msgid " I accept the terms and conditions *" msgstr " I accept the terms and conditions *" +#, fuzzy +msgid " Plan" +msgstr "plan" + msgid " access to" msgstr " access to" @@ -44,6 +36,10 @@ msgid " access. " msgstr " access to" +#, fuzzy +msgid " and " +msgstr " on " + msgid " by" msgstr " by" @@ -66,15 +62,27 @@ msgid " once you click save!" msgstr " once you click save!" +#, fuzzy +msgid " or " +msgstr " on " + msgid " password. You can do this through the link below." msgstr " password. You can do this through the link below." +#, fuzzy +msgid " provided by " +msgstr " by " + msgid " saved the following answer:" msgstr " saved the following answer:" msgid " team" msgstr " team" +#, fuzzy +msgid " that has been customised by " +msgstr " by " + msgid " to accept the invitation, (or copy " msgstr " to accept the invitation, (or copy " @@ -108,6 +116,10 @@ msgid "%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" @@ -204,6 +207,19 @@ msgid "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" msgstr "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" +#, fuzzy +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "%{application_name}" + msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "A colleague has invited you to contribute to their Data Management Plan at " @@ -213,6 +229,9 @@ msgid "A required setting has not been provided" msgstr "A required setting has not been provided" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "API Information" @@ -327,6 +346,10 @@ msgid "Before submitting, please consider:" msgstr "Before submitting, please consider:" +#, fuzzy +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "questions" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "Below is a list of users registered for your organisation. You can sort the data by each field." @@ -351,9 +374,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "Check this box when you are ready for this guidance to appear on user's plans." -msgid "Choose a template" -msgstr "Choose a template" - msgid "Click here" msgstr "" @@ -390,6 +410,10 @@ msgid "Contact Email" msgstr "Contact Email" +#, fuzzy +msgid "Contact Us" +msgstr "Contact us" + msgid "Contact us" msgstr "Contact us" @@ -540,6 +564,9 @@ msgid "File Name" msgstr "File Name" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "Filter plans" @@ -552,15 +579,20 @@ msgid "Forgot your password?" msgstr "Forgot your password?" +#, fuzzy +msgid "Format" +msgstr "format" + msgid "Funder" msgstr "Funder" -msgid "Funder name" -msgstr "Funder name" - msgid "Funders templates" msgstr "Funders templates" +#, fuzzy +msgid "Funding organisation" +msgstr "organisation" + msgid "Future plans" msgstr "Future plans" @@ -627,12 +659,13 @@ msgid "ID" msgstr "ID" -msgid "If applying for funding, select your research funder." -msgstr "If applying for funding, select your research funder." - msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "If applying for funding, state the name exactly as in the grant proposal." +#, fuzzy +msgid "If applying for funding, state the title exactly as in the proposal." +msgstr "If applying for funding, state the name exactly as in the grant proposal." + msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." msgstr "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." @@ -699,9 +732,6 @@ msgid "Left" msgstr "Left" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "Link your %{application_name} account to your institutional credentials (UK users only)" - msgid "List of users" msgstr "List of users" @@ -726,18 +756,27 @@ msgid "Me" msgstr "Me" +#, fuzzy +msgid "Message" +msgstr "Me" + msgid "Multi select box" msgstr "Multi select box" +#, fuzzy +msgid "My Plan" +msgstr "My plan" + msgid "My organisation isn't listed." msgstr "My organisation isn't listed." -msgid "My plan" -msgstr "My plan" - msgid "My plans" msgstr "My plans" +#, fuzzy +msgid "My research organisation is not on the list" +msgstr "organisation" + msgid "Name" msgstr "Name" @@ -747,9 +786,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "Name of Principal Investigator(s) or main researcher(s) on the project." -msgid "Name of funder, if applicable." -msgstr "Name of funder, if applicable." - msgid "New guidance" msgstr "New guidance" @@ -771,6 +807,14 @@ msgid "No additional comment area will be displayed." msgstr "No additional comment area will be displayed." +#, fuzzy +msgid "No funder associated with this plan" +msgstr "plan" + +#, fuzzy +msgid "No items available." +msgstr "No" + msgid "No matches" msgstr "No matches" @@ -780,9 +824,6 @@ msgid "Not answered yet" msgstr "Not answered yet" -msgid "Not applicable/not listed." -msgstr "Not applicable/not listed." - msgid "Note" msgstr "Note" @@ -846,9 +887,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "Otherwise leave blank." - msgid "Own templates" msgstr "Own templates" @@ -894,9 +932,6 @@ msgid "Plan name" msgstr "Plan name" -msgid "Plan was successfully created." -msgstr "Plan was successfully created." - msgid "Plan was successfully deleted." msgstr "Plan was successfully deleted." @@ -921,6 +956,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "Please enter your first name." @@ -933,18 +971,32 @@ msgid "Please enter your surname or family name." msgstr "Please enter your surname or family name." +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "Please fill in the basic project details below and click 'Update' to save" +#, fuzzy +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" + msgid "Please only enter up to 165 characters, you have used" msgstr "Please only enter up to 165 characters, you have used" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "Policy Expectations" msgid "Preview" msgstr "Preview" +#, fuzzy +msgid "Primary research organisation" +msgstr "organisation" + msgid "Principal Investigator / Researcher" msgstr "Principal Investigator / Researcher" @@ -963,6 +1015,9 @@ msgid "Privileges" msgstr "Privileges" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "Public" @@ -1047,24 +1102,27 @@ msgid "Sections" msgstr "Sections" -msgid "Select Funder" -msgstr "Select Funder" - -msgid "Select Organisation" -msgstr "Select Organisation" +#, fuzzy +msgid "Select a template" +msgstr "template" msgid "Select an action" msgstr "Select an action" +#, fuzzy +msgid "Select the funding organisation" +msgstr "organisation" + +#, fuzzy +msgid "Select the primary research organisation responsible" +msgstr "organisation" + msgid "Select which group this guidance relates to." msgstr "Select which group this guidance relates to." msgid "Select which theme(s) this guidance relates to." msgstr "Select which theme(s) this guidance relates to." -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1104,6 +1162,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1155,6 +1216,10 @@ msgid "That template is not currently published." msgstr "That template is not currently published." +#, fuzzy +msgid "The" +msgstr "The " + msgid "The " msgstr "The " @@ -1170,9 +1235,6 @@ msgid "Themes" msgstr "Themes" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "There are a number of possible templates you could use. Please choose one." - msgid "There are no public DMPs." msgstr "There are no public DMPs." @@ -1203,21 +1265,19 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." +#, fuzzy +msgid "This plan is based on the default template." +msgstr "template" + msgid "This plan is based on:" msgstr "This plan is based on:" msgid "This section is locked for editing by " msgstr "This section is locked for editing by " -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "Tick to select any other sources of guidance you wish to see." - msgid "Title" msgstr "Title" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "To see institutional questions and/or guidance, select your organisation." - msgid "Top" msgstr "Top" @@ -1248,9 +1308,6 @@ msgid "Unlink institutional credentials alert" msgstr "Unlink institutional credentials alert" -msgid "Unlink your institutional credentials" -msgstr "Unlink your institutional credentials" - msgid "Unlock my account" msgstr "Unlock my account" @@ -1278,6 +1335,9 @@ msgid "Users" msgstr "Users" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "Version" @@ -1299,6 +1359,18 @@ msgid "Visibility" msgstr "Visibility" +#, fuzzy +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "template" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "organisation" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "template" + msgid "Website" msgstr "Website" @@ -1311,9 +1383,17 @@ msgid "Welcome." msgstr "Welcome." +#, fuzzy +msgid "What research project are you planning?" +msgstr "plan" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." +#, fuzzy +msgid "Which DMP template would you like to use?" +msgstr "template" + msgid "While you were editing " msgstr "" @@ -1356,6 +1436,10 @@ msgid "You can edit any of the details below." msgstr "You can edit any of the details below." +#, fuzzy +msgid "You can not continue until you have filled in all of the required information." +msgstr "format" + msgid "You can not edit a historical version of this template." msgstr "" @@ -1380,9 +1464,6 @@ msgid "You have unsaved answers in the following sections:" msgstr "" -msgid "You may leave blank or select a different organisation to your own." -msgstr "You may leave blank or select a different organisation to your own." - msgid "You must accept the terms and conditions to register." msgstr "You must accept the terms and conditions to register." @@ -1407,9 +1488,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "Your account has been successfully linked to %{scheme}." -msgid "Your account is linked to your institutional credentials." -msgstr "Your account is linked to your institutional credentials." - msgid "Your account won't be created until you access the link above and set your password." msgstr "Your account won't be created until you access the link above and set your password." @@ -1494,12 +1572,13 @@ msgid "e.g. School/ Department" msgstr "e.g. School/ Department" -msgid "format" -msgstr "format" - msgid "from now" msgstr "from now" +#, fuzzy +msgid "generic template" +msgstr "template" + msgid "guidance" msgstr "guidance" @@ -1542,6 +1621,10 @@ msgid "must have access to guidances api" msgstr "must have access to guidances api" +#, fuzzy +msgid "no research organisation is associated with this plan" +msgstr "organisation" + msgid "note" msgstr "note" diff --git a/config/locale/en_US/app.po b/config/locale/en_US/app.po index 078709c..dd2eafe 100644 --- a/config/locale/en_US/app.po +++ b/config/locale/en_US/app.po @@ -22,21 +22,13 @@ msgid " - " msgstr " - " -msgid " - choosing default template for your institution" -msgstr " - choosing default template for your institution" - -msgid " - no funder or institution template, choosing default template" -msgstr " - no funder or institution template, choosing default template" - -msgid " - there are more than one to choose from" -msgstr " - there are more than one to choose from" - -msgid " - using template customised by your institution" -msgstr " - using template customized by your institution" - msgid " I accept the terms and conditions *" msgstr " I accept the terms and conditions *" +#, fuzzy +msgid " Plan" +msgstr "plan" + msgid " access to" msgstr " access to" @@ -44,6 +36,10 @@ msgid " access. " msgstr " access to" +#, fuzzy +msgid " and " +msgstr " on " + msgid " by" msgstr " by" @@ -66,15 +62,27 @@ msgid " once you click save!" msgstr " once you click save!" +#, fuzzy +msgid " or " +msgstr " on " + msgid " password. You can do this through the link below." msgstr " password. You can do this through the link below." +#, fuzzy +msgid " provided by " +msgstr " by " + msgid " saved the following answer:" msgstr " saved the following answer:" msgid " team" msgstr " team" +#, fuzzy +msgid " that has been customised by " +msgstr " by " + msgid " to accept the invitation, (or copy " msgstr " to accept the invitation, (or copy " @@ -108,6 +116,10 @@ msgid "%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" @@ -204,6 +207,19 @@ msgid "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" msgstr "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" +#, fuzzy +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "%{application_name}" + msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "A colleague has invited you to contribute to their Data Management Plan at " @@ -213,6 +229,9 @@ msgid "A required setting has not been provided" msgstr "A required setting has not been provided" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "API Information" @@ -327,6 +346,10 @@ msgid "Before submitting, please consider:" msgstr "Before submitting, please consider:" +#, fuzzy +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "questions" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "Below is a list of users registered for your organization. You can sort the data by each field." @@ -351,9 +374,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "Check this box when you are ready for this guidance to appear on user's plans." -msgid "Choose a template" -msgstr "Choose a template" - msgid "Click here" msgstr "" @@ -390,6 +410,10 @@ msgid "Contact Email" msgstr "Contact Email" +#, fuzzy +msgid "Contact Us" +msgstr "Contact us" + msgid "Contact us" msgstr "Contact us" @@ -540,6 +564,9 @@ msgid "File Name" msgstr "File Name" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "Filter plans" @@ -552,15 +579,20 @@ msgid "Forgot your password?" msgstr "Forgot your password?" +#, fuzzy +msgid "Format" +msgstr "format" + msgid "Funder" msgstr "Funder" -msgid "Funder name" -msgstr "Funder name" - msgid "Funders templates" msgstr "Funders templates" +#, fuzzy +msgid "Funding organisation" +msgstr "organization" + msgid "Future plans" msgstr "Future plans" @@ -627,12 +659,13 @@ msgid "ID" msgstr "ID" -msgid "If applying for funding, select your research funder." -msgstr "If applying for funding, select your research funder." - msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "If applying for funding, state the name exactly as in the grant proposal." +#, fuzzy +msgid "If applying for funding, state the title exactly as in the proposal." +msgstr "If applying for funding, state the name exactly as in the grant proposal." + msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." msgstr "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." @@ -699,9 +732,6 @@ msgid "Left" msgstr "Left" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "Link your %{application_name} account to your institutional credentials (UK users only)" - msgid "List of users" msgstr "List of users" @@ -726,18 +756,27 @@ msgid "Me" msgstr "Me" +#, fuzzy +msgid "Message" +msgstr "Me" + msgid "Multi select box" msgstr "Multi select box" +#, fuzzy +msgid "My Plan" +msgstr "My plan" + msgid "My organisation isn't listed." msgstr "My organization isn't listed." -msgid "My plan" -msgstr "My plan" - msgid "My plans" msgstr "My plans" +#, fuzzy +msgid "My research organisation is not on the list" +msgstr "organization" + msgid "Name" msgstr "Name" @@ -747,9 +786,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "Name of Principal Investigator(s) or main researcher(s) on the project." -msgid "Name of funder, if applicable." -msgstr "Name of funder, if applicable." - msgid "New guidance" msgstr "New guidance" @@ -771,6 +807,14 @@ msgid "No additional comment area will be displayed." msgstr "No additional comment area will be displayed." +#, fuzzy +msgid "No funder associated with this plan" +msgstr "plan" + +#, fuzzy +msgid "No items available." +msgstr "No" + msgid "No matches" msgstr "No matches" @@ -780,9 +824,6 @@ msgid "Not answered yet" msgstr "Not answered yet" -msgid "Not applicable/not listed." -msgstr "Not applicable/not listed." - msgid "Note" msgstr "Note" @@ -846,9 +887,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "Otherwise leave blank." - msgid "Own templates" msgstr "Own templates" @@ -894,9 +932,6 @@ msgid "Plan name" msgstr "Plan name" -msgid "Plan was successfully created." -msgstr "Plan was successfully created." - msgid "Plan was successfully deleted." msgstr "Plan was successfully deleted." @@ -921,6 +956,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "Please enter your first name." @@ -933,18 +971,32 @@ msgid "Please enter your surname or family name." msgstr "Please enter your surname or family name." +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "Please fill in the basic project details below and click 'Update' to save" +#, fuzzy +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" + msgid "Please only enter up to 165 characters, you have used" msgstr "Please only enter up to 165 characters, you have used" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "Policy Expectations" msgid "Preview" msgstr "Preview" +#, fuzzy +msgid "Primary research organisation" +msgstr "organization" + msgid "Principal Investigator / Researcher" msgstr "Principal Investigator / Researcher" @@ -963,6 +1015,9 @@ msgid "Privileges" msgstr "Permissions" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "Public" @@ -1047,24 +1102,27 @@ msgid "Sections" msgstr "Sections" -msgid "Select Funder" -msgstr "Select Funder" - -msgid "Select Organisation" -msgstr "Select Organization" +#, fuzzy +msgid "Select a template" +msgstr "template" msgid "Select an action" msgstr "Select an action" +#, fuzzy +msgid "Select the funding organisation" +msgstr "organization" + +#, fuzzy +msgid "Select the primary research organisation responsible" +msgstr "organization" + msgid "Select which group this guidance relates to." msgstr "Select which group this guidance relates to." msgid "Select which theme(s) this guidance relates to." msgstr "Select which theme(s) this guidance relates to." -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1104,6 +1162,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1155,6 +1216,10 @@ msgid "That template is not currently published." msgstr "That template is not currently published." +#, fuzzy +msgid "The" +msgstr "The " + msgid "The " msgstr "The " @@ -1170,9 +1235,6 @@ msgid "Themes" msgstr "Themes" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "There are a number of possible templates you could use. Please choose one." - msgid "There are no public DMPs." msgstr "There are no public DMPs." @@ -1203,21 +1265,19 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." +#, fuzzy +msgid "This plan is based on the default template." +msgstr "template" + msgid "This plan is based on:" msgstr "This plan is based on:" msgid "This section is locked for editing by " msgstr "This section is locked for editing by " -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "Tick to select any other sources of guidance you wish to see." - msgid "Title" msgstr "Title" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "To see institutional questions and/or guidance, select your organization." - msgid "Top" msgstr "Top" @@ -1248,9 +1308,6 @@ msgid "Unlink institutional credentials alert" msgstr "Unlink institutional credentials alert" -msgid "Unlink your institutional credentials" -msgstr "Unlink your institutional credentials" - msgid "Unlock my account" msgstr "Unlock my account" @@ -1278,6 +1335,9 @@ msgid "Users" msgstr "Users" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "Version" @@ -1299,6 +1359,18 @@ msgid "Visibility" msgstr "Visibility" +#, fuzzy +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "template" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "organization" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "template" + msgid "Website" msgstr "Website" @@ -1311,9 +1383,17 @@ msgid "Welcome." msgstr "Welcome." +#, fuzzy +msgid "What research project are you planning?" +msgstr "plan" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." +#, fuzzy +msgid "Which DMP template would you like to use?" +msgstr "template" + msgid "While you were editing " msgstr "" @@ -1356,6 +1436,10 @@ msgid "You can edit any of the details below." msgstr "You can edit any of the details below." +#, fuzzy +msgid "You can not continue until you have filled in all of the required information." +msgstr "format" + msgid "You can not edit a historical version of this template." msgstr "" @@ -1380,9 +1464,6 @@ msgid "You have unsaved answers in the following sections:" msgstr "" -msgid "You may leave blank or select a different organisation to your own." -msgstr "You may leave blank or select a different organization to your own." - msgid "You must accept the terms and conditions to register." msgstr "You must accept the terms and conditions to register." @@ -1407,9 +1488,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "Your account has been successfully linked to %{scheme}." -msgid "Your account is linked to your institutional credentials." -msgstr "Your account is linked to your institutional credentials." - msgid "Your account won't be created until you access the link above and set your password." msgstr "Your account won't be created until you access the link above and set your password." @@ -1494,12 +1572,13 @@ msgid "e.g. School/ Department" msgstr "e.g. School/ Department" -msgid "format" -msgstr "format" - msgid "from now" msgstr "from now" +#, fuzzy +msgid "generic template" +msgstr "template" + msgid "guidance" msgstr "guidance" @@ -1542,6 +1621,10 @@ msgid "must have access to guidances api" msgstr "must have access to guidances api" +#, fuzzy +msgid "no research organisation is associated with this plan" +msgstr "organization" + msgid "note" msgstr "note" diff --git a/config/locale/es/app.po b/config/locale/es/app.po index debb763..4909cb5 100644 --- a/config/locale/es/app.po +++ b/config/locale/es/app.po @@ -22,29 +22,23 @@ msgid " - " msgstr "" -msgid " - choosing default template for your institution" -msgstr "" - -msgid " - no funder or institution template, choosing default template" -msgstr "" - -msgid " - there are more than one to choose from" -msgstr "" - -#, fuzzy -msgid " - using template customised by your institution" -msgstr " por " - #, fuzzy msgid " I accept the terms and conditions *" msgstr " Acepto los términos y condiciones *" +#, fuzzy +msgid " Plan" +msgstr "plans" + msgid " access to" msgstr "" msgid " access. " msgstr "" +msgid " and " +msgstr "" + #, fuzzy msgid " by" msgstr " por " @@ -69,9 +63,16 @@ msgid " once you click save!" msgstr "" +msgid " or " +msgstr "" + msgid " password. You can do this through the link below." msgstr "" +#, fuzzy +msgid " provided by " +msgstr " por " + msgid " saved the following answer:" msgstr "" @@ -79,6 +80,10 @@ msgid " team" msgstr "am" +#, fuzzy +msgid " that has been customised by " +msgstr " por " + msgid " to accept the invitation, (or copy " msgstr "" @@ -114,6 +119,10 @@ msgid "%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "Si desea añadir una plantilla institucional para un Plan de Gestión de Datos, use el botón 'crear plantilla'. Podrá crear más de una plantilla si lo cree conveniente. Ej: para investigadores y otro para estudiantes de postgrado.
Su plantilla se presentará a los usuarios de su institución cuando no sean aplicables plantillas de agencias de financiación. Si quiere aññadir preguntas a las plantillas de las agencias de financiación, use las siguientes opciones de 'personalizar plantilla'
" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "Por favor, tenga en cuenta que su dirección de correo electrónico se usa como su nombre de usuario. Si cambia esto, recuerde usar su nueva dirección de correo electrónico al conectar.
" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "Por favor, seleccione la información de los siguientes desplegables, de forma que podamos determinar qué preguntas y orientación han de ser mostrados en su plan.
Si no responde a los requisitos específicos de un financiador o institución, seleccione aquí para crear un PGD genérico basado en los temas más comunes.
" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "Seleccione los temas relevantes para esta pregunta.
Le permite crear guías genéricas a nivel de institución o de otras fuentes. Ej. para el DCC o cualquier escuela o departamento a la que se dirija la guía.
Puede seleccionar varios temas usando el botón CTRL.
" @@ -213,6 +213,19 @@ msgid "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" msgstr "templates" +#, fuzzy +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "DMPonline" + msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "" @@ -222,6 +235,9 @@ msgid "A required setting has not been provided" msgstr "No se ha indicado un valor obligatorio" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "" @@ -341,6 +357,10 @@ msgid "Before submitting, please consider:" msgstr "" +#, fuzzy +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "Preguntas" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "Debajo tiene la lista de usuarios registrados en su entidad. Puede ordenar los datos por campo." @@ -366,9 +386,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "" -msgid "Choose a template" -msgstr "" - msgid "Click here" msgstr "" @@ -407,6 +424,10 @@ msgid "Contact Email" msgstr "" +#, fuzzy +msgid "Contact Us" +msgstr "Contacto" + msgid "Contact us" msgstr "Contacto" @@ -560,6 +581,9 @@ msgid "File Name" msgstr "Título del plan" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "Filtro de planes" @@ -572,15 +596,19 @@ msgid "Forgot your password?" msgstr "¿Olvidó su clave?" +msgid "Format" +msgstr "" + msgid "Funder" msgstr "Financiador" -msgid "Funder name" -msgstr "Nombre del financiador del proyecto" - msgid "Funders templates" msgstr "Plantillas de financiador" +#, fuzzy +msgid "Funding organisation" +msgstr "Organización" + msgid "Future plans" msgstr "Hoja de ruta" @@ -648,12 +676,13 @@ msgid "ID" msgstr "ID" -msgid "If applying for funding, select your research funder." -msgstr "Si se solicita financiación, seleccione el organismo financiador de su investigación." - msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "Si se solicita financiación, indique el nombre exactamente como en la propuesta de subvención." +#, fuzzy +msgid "If applying for funding, state the title exactly as in the proposal." +msgstr "Si se solicita financiación, indique el nombre exactamente como en la propuesta de subvención." + msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." msgstr "Si la guía está dirigida a un subconjunto de los usuarios (ej: los pertenecientes a un colegio o instituto), seleccione esta opción. Los usuarios serán capaces de seleccionar esta guía cuando respondan sus preguntas durante la creación del plan." @@ -720,9 +749,6 @@ msgid "Left" msgstr "Izquierdo" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "Vincule su cuenta de DMPonline con las credenciales de su institución (Sólo para usuarios del Reino Unido)" - msgid "List of users" msgstr "Listado de usuarios" @@ -747,18 +773,27 @@ msgid "Me" msgstr "Yo" +#, fuzzy +msgid "Message" +msgstr "Yo" + msgid "Multi select box" msgstr "Multi select box" +#, fuzzy +msgid "My Plan" +msgstr "Mi proyecto" + msgid "My organisation isn't listed." msgstr "No se muestra mi organización." -msgid "My plan" -msgstr "Mi proyecto" - msgid "My plans" msgstr "Mis planes" +#, fuzzy +msgid "My research organisation is not on the list" +msgstr "Organización" + msgid "Name" msgstr "Nombre" @@ -768,9 +803,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "Nombre del/de los Investigador/es Principal/es o investigador/es principal/es del proyecto." -msgid "Name of funder, if applicable." -msgstr "Nombre del financiador, si corresponde." - msgid "New guidance" msgstr "Nueva orientación" @@ -792,6 +824,13 @@ msgid "No additional comment area will be displayed." msgstr "No se mostrará un área adicional para comentarios." +#, fuzzy +msgid "No funder associated with this plan" +msgstr "plans" + +msgid "No items available." +msgstr "" + msgid "No matches" msgstr "Ningún plan coincide con '%{filter}'" @@ -801,9 +840,6 @@ msgid "Not answered yet" msgstr "Aún no respondido/a" -msgid "Not applicable/not listed." -msgstr "No aplicable / no listado/a." - msgid "Note" msgstr "Nota" @@ -868,9 +904,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "Si no, déjelo en blanco." - msgid "Own templates" msgstr "Sus plantillas" @@ -917,9 +950,6 @@ msgid "Plan name" msgstr "Nombre de proyecto" -msgid "Plan was successfully created." -msgstr "Plan creado con éxito" - #, fuzzy msgid "Plan was successfully deleted." msgstr "Plan creado con éxito" @@ -945,6 +975,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "Por favor, introduzca su nombre." @@ -957,18 +990,32 @@ msgid "Please enter your surname or family name." msgstr "Por favor, introduzca sus apellidos." +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "Por favor, rellene los detalles básicos del proyecto y haga clic en 'Actualizar' para guardarlos" +#, fuzzy +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "Por favor, tenga en cuenta que su dirección de correo electrónico se usa como su nombre de usuario. Si cambia esto, recuerde usar su nueva dirección de correo electrónico al conectar.
" + msgid "Please only enter up to 165 characters, you have used" msgstr "" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "Política esperada" msgid "Preview" msgstr "Previsualización" +#, fuzzy +msgid "Primary research organisation" +msgstr "Organización" + msgid "Principal Investigator / Researcher" msgstr "Principal Investigador / Científico" @@ -987,6 +1034,9 @@ msgid "Privileges" msgstr "" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "Público" @@ -1071,24 +1121,27 @@ msgid "Sections" msgstr "Secciones" -msgid "Select Funder" -msgstr "Financiador" - -msgid "Select Organisation" -msgstr "Organización" +#, fuzzy +msgid "Select a template" +msgstr "templates" msgid "Select an action" msgstr "Seleccionar una acción" +#, fuzzy +msgid "Select the funding organisation" +msgstr "Organización" + +#, fuzzy +msgid "Select the primary research organisation responsible" +msgstr "Organización" + msgid "Select which group this guidance relates to." msgstr "Seleccione a que grupo pertenece esta guía." msgid "Select which theme(s) this guidance relates to." msgstr "Seleccione a el/los tema(s) relacionados con esta orientación." -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1128,6 +1181,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1180,6 +1236,9 @@ msgid "That template is not currently published." msgstr "templates" +msgid "The" +msgstr "" + msgid "The " msgstr "" @@ -1195,9 +1254,6 @@ msgid "Themes" msgstr "Temas" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "Hay varias plantillas que podría usar. Por favor, elija una." - msgid "There are no public DMPs." msgstr "" @@ -1228,21 +1284,19 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "Esta página le proporciona una visión general de su plan. Le dice en qué está basado su plan y le da una visión general de las preguntas que se le harán." +#, fuzzy +msgid "This plan is based on the default template." +msgstr "templates" + msgid "This plan is based on:" msgstr "Este plan está basado en:" msgid "This section is locked for editing by " msgstr "Esta sección está bloqueda para su edición por " -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "Marque para seleccionar cualquier otra fuente de orientación que quiera ver." - msgid "Title" msgstr "Título" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "Para ver preguntas y/u orientación relativas a su institución, seleccione su entidad." - msgid "Top" msgstr "Superior" @@ -1274,9 +1328,6 @@ msgid "Unlink institutional credentials alert" msgstr "Desvincule las alertas relacionadas con las credenciales de su institución" -msgid "Unlink your institutional credentials" -msgstr "Desvincule las credenciales de su institución" - msgid "Unlock my account" msgstr "" @@ -1305,6 +1356,9 @@ msgid "Users" msgstr "Usuarios" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "Versión" @@ -1326,6 +1380,18 @@ msgid "Visibility" msgstr "Visibilidad" +#, fuzzy +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "templates" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "Organización" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "templates" + msgid "Website" msgstr "Sitio web" @@ -1339,9 +1405,17 @@ msgid "Welcome." msgstr "Bienvenido/a." +#, fuzzy +msgid "What research project are you planning?" +msgstr "plans" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "Cuando crea una fase nueva para su plantilla, se creará automáticamente una versión. Una vez complete el siguiente formulario se le darán las opciones para crear secciones y preguntas." +#, fuzzy +msgid "Which DMP template would you like to use?" +msgstr "templates" + msgid "While you were editing " msgstr "" @@ -1385,6 +1459,9 @@ msgid "You can edit any of the details below." msgstr "Puede editar cualquiera de los siguientes datos." +msgid "You can not continue until you have filled in all of the required information." +msgstr "" + #, fuzzy msgid "You can not edit a historical version of this template." msgstr "templates" @@ -1413,9 +1490,6 @@ msgid "You have unsaved answers in the following sections:" msgstr "" -msgid "You may leave blank or select a different organisation to your own." -msgstr "Puede dejar en blanco o seleccionar una entidad distinta a la suya." - msgid "You must accept the terms and conditions to register." msgstr "" @@ -1440,9 +1514,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "" -msgid "Your account is linked to your institutional credentials." -msgstr "Su cuenta enstá vinculada con las credenciales de su institución." - msgid "Your account won't be created until you access the link above and set your password." msgstr "" @@ -1535,12 +1606,13 @@ msgid "e.g. School/ Department" msgstr "ej: Escuela / Departmento" -msgid "format" -msgstr "" - msgid "from now" msgstr "" +#, fuzzy +msgid "generic template" +msgstr "templates" + msgid "guidance" msgstr "" @@ -1587,6 +1659,10 @@ msgstr "guidances" #, fuzzy +msgid "no research organisation is associated with this plan" +msgstr "Organización" + +#, fuzzy msgid "note" msgstr "Nota" diff --git a/config/locale/fr/app.po b/config/locale/fr/app.po index c41d966..e582167 100644 --- a/config/locale/fr/app.po +++ b/config/locale/fr/app.po @@ -22,29 +22,23 @@ msgid " - " msgstr "" -msgid " - choosing default template for your institution" -msgstr "" - -msgid " - no funder or institution template, choosing default template" -msgstr "" - -msgid " - there are more than one to choose from" -msgstr "" - -#, fuzzy -msgid " - using template customised by your institution" -msgstr " par " - #, fuzzy msgid " I accept the terms and conditions *" msgstr " Jaccepte les Conditions générales dutilisation. *" +#, fuzzy +msgid " Plan" +msgstr "plans" + msgid " access to" msgstr "" msgid " access. " msgstr "" +msgid " and " +msgstr "" + #, fuzzy msgid " by" msgstr " par " @@ -69,9 +63,16 @@ msgid " once you click save!" msgstr "" +msgid " or " +msgstr "" + msgid " password. You can do this through the link below." msgstr "" +#, fuzzy +msgid " provided by " +msgstr " par " + msgid " saved the following answer:" msgstr "" @@ -79,6 +80,10 @@ msgid " team" msgstr "am" +#, fuzzy +msgid " that has been customised by " +msgstr " par " + msgid " to accept the invitation, (or copy " msgstr "" @@ -114,6 +119,10 @@ msgid "%{application_name} doesn't recognise your institutional credentials - either you haven't created an account with us or you haven't linked these details to your existing account.If you wish to add an institutional template for a Data Management Plan, use the 'create template' button. You can create more than one template if desired e.g. one for researchers and one for PhD students.
Your template will be presented to users within your institution when no funder templates apply. If you want to add questions to funder templates use the 'customise template' options below.
" msgstr "Si vous souhaitez ajouter un modèle institutionnel propre à un plan de gestion de données, utilisez le bouton créer un modèle. Vous pouvez au besoin créer plusieurs modèles, par ex. : un pour des chercheurs et un pour des thésards.
Votre modèle apparaîtra aux utilisateurs de votre établissement quand aucun modèle propre à un bailleur de subvention ne sapplique. Si vous souhaitez ajouter des questions dans un modèle de bailleur de subventions, utilisez les options de personalisation de modèle ci-après.
" -msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.
" -msgstr "À noter que votre courriel est à utiliser comme nom dutilisateur. Si vous modifiez ces informations, rappelez-vous dutiliser votre courriel en vous connectant.
" - -msgid "Please select from the following drop-down so we can determine what questions and guidance should be displayed in your plan.
" -msgstr "" - -msgid "Please select from the following drop-downs so we can determine what questions and guidance should be displayed in your plan.
If you aren't responding to specific requirements from a funder or an institution, select here to write a generic DMP based on the most common themes.
" -msgstr "Veuillez sélectionner des éléments dans les menus déroulants ci-après pour pouvoir identifier les questions et conseils à afficher dans votre plan.
Si votre soumission doit répondre à des prescriptions propres à un organisme financeur ou un établissement, sélectionnez ici la rédaction dun DMP à partir des thèmes les plus courants.
" - msgid "Select themes that are relevant to this question.
This allows your generic institution-level guidance to be drawn in, as well as that from other sources e.g. the %{organisation_abbreviation} or any Schools/Departments that you provide guidance for.
You can select multiple themes by using the CTRL button.
" msgstr "Sélectionnez les thèmes relatifs à cette question.
Cette fonction permet dintégrer une documentation générale dassistance de votre établissement, comme encore issue dautres sources comme le DCC et des facultés ou départements auxquels vous fournissez des conseils.
Vous pouvez sélectionner plusieurs thèmes avec la touche CTRL.
" @@ -212,6 +212,19 @@ msgid "You can write pieces of guidance to be displayed by theme (e.g. generic guidance on storage and backup that should present across the board). Writing generic guidance by theme saves you time and effort as your advice will be automatically displayed across all templates rather than having to write guidance to accompany each.
If you do have a need to provide guidance for specific funders that would not be useful to a wider audience (e.g. if you have specific instructions for applicants to BBSRC for example), you can do so by adding guidance to a specific question when you edit your template.
" msgstr "templates" +#, fuzzy +msgid "" +"Helpline: %{organisation_telephone}
\n" +"Email %{organisation_email}
" +msgstr "DMPonline" + msgid "A colleague has invited you to contribute to their Data Management Plan at " msgstr "" @@ -221,6 +234,9 @@ msgid "A required setting has not been provided" msgstr "Vous navez pas précisé un réglage obligatoire" +msgid "A version of " +msgstr "" + msgid "API Information" msgstr "" @@ -340,6 +356,10 @@ msgid "Before submitting, please consider:" msgstr "" +#, fuzzy +msgid "Before you get started, we need to ask a few questions to set you up with the best DMP template for your needs." +msgstr "Questions" + msgid "Below is a list of users registered for your organisation. You can sort the data by each field." msgstr "La liste ci-dessous indique les utilisateurs de votre organisme. Ces informations peuvent être triées par champ." @@ -364,9 +384,6 @@ msgid "Check this box when you are ready for this guidance to appear on user's plans." msgstr "" -msgid "Choose a template" -msgstr "" - msgid "Click here" msgstr "" @@ -405,6 +422,10 @@ msgid "Contact Email" msgstr "" +#, fuzzy +msgid "Contact Us" +msgstr "Communiquez avec nous" + msgid "Contact us" msgstr "Communiquez avec nous" @@ -558,6 +579,9 @@ msgid "File Name" msgstr "Titre du plan" +msgid "Fill in the required fields" +msgstr "" + msgid "Filter plans" msgstr "Filtrer les plans" @@ -570,15 +594,19 @@ msgid "Forgot your password?" msgstr "" +msgid "Format" +msgstr "" + msgid "Funder" msgstr "Funder" -msgid "Funder name" -msgstr "Nom de lorganisme financeur" - msgid "Funders templates" msgstr "Modèles des bailleurs de subventions" +#, fuzzy +msgid "Funding organisation" +msgstr "Organisation" + msgid "Future plans" msgstr "" @@ -646,12 +674,13 @@ msgid "ID" msgstr "Identifiant" -msgid "If applying for funding, select your research funder." -msgstr "Si vous soumettez une demande de subvention, sélectionnez lorganisme financeur." - msgid "If applying for funding, state the name exactly as in the grant proposal." msgstr "En cas de demande de financement, indiquer le nom exactement comme dans la demande de subvention." +#, fuzzy +msgid "If applying for funding, state the title exactly as in the proposal." +msgstr "En cas de demande de financement, indiquer le nom exactement comme dans la demande de subvention." + msgid "If the guidance is only meant for a subset of users e.g. those in a specific college or institute, check this box. Users will be able to select to display this subset guidance when answering questions in the 'create plan' wizard." msgstr "Si les conseils ne sont destinés quà un sous-ensemble dutilisateurs (par ex. : faisant partie dune faculté ou dun institut), cochez cette case. Les utilisateurs pourront sélectionner ce sous-groupe de conseils lorquils répondront aux questions dans lassistant de création de plan." @@ -718,9 +747,6 @@ msgid "Left" msgstr "Gauche" -msgid "Link your %{application_name} account to your institutional credentials (UK users only)" -msgstr "Reliez votre compte DMPonline à votre authentifiant détablissement" - msgid "List of users" msgstr "Liste des utilisateurs" @@ -745,18 +771,27 @@ msgid "Me" msgstr "Moi" +#, fuzzy +msgid "Message" +msgstr "Moi" + msgid "Multi select box" msgstr "Boîte de sélections multiples" +#, fuzzy +msgid "My Plan" +msgstr "Mon plan" + msgid "My organisation isn't listed." msgstr "Mon établissement nest pas listé." -msgid "My plan" -msgstr "Mon plan" - msgid "My plans" msgstr "Mes plans" +#, fuzzy +msgid "My research organisation is not on the list" +msgstr "Organisation" + msgid "Name" msgstr "Prénom" @@ -766,9 +801,6 @@ msgid "Name of Principal Investigator(s) or main researcher(s) on the project." msgstr "Nom du ou des directeurs de recherche ou du ou des principaux chercheurs du projet." -msgid "Name of funder, if applicable." -msgstr "Nom de lorganisme financeur, le cas échéant." - msgid "New guidance" msgstr "Nouveaux conseils" @@ -790,6 +822,13 @@ msgid "No additional comment area will be displayed." msgstr "" +#, fuzzy +msgid "No funder associated with this plan" +msgstr "plans" + +msgid "No items available." +msgstr "" + msgid "No matches" msgstr "Pas de plans pour %{filter}" @@ -799,9 +838,6 @@ msgid "Not answered yet" msgstr "Pas encore de réponse" -msgid "Not applicable/not listed." -msgstr "Non pertinent/non répertorié." - msgid "Note" msgstr "Note" @@ -866,9 +902,6 @@ msgid "Other institutions" msgstr "" -msgid "Otherwise leave blank." -msgstr "Sinon laissez ce champ vide." - msgid "Own templates" msgstr "Modèles propres" @@ -914,9 +947,6 @@ msgid "Plan name" msgstr "Nom du plan" -msgid "Plan was successfully created." -msgstr "Création du plan effectuée." - #, fuzzy msgid "Plan was successfully deleted." msgstr "Création du plan effectuée." @@ -942,6 +972,9 @@ msgid "Please enter your current password" msgstr "" +msgid "Please enter your current password below when changing your email address." +msgstr "" + msgid "Please enter your first name." msgstr "Entrez votre prénom, svp." @@ -954,18 +987,32 @@ msgid "Please enter your surname or family name." msgstr "Entrez votre nom dusage ou de famille, svp." +msgid "Please fill in the basic project details below" +msgstr "" + msgid "Please fill in the basic project details below and click 'Update' to save" msgstr "Veuillez renseigner les premiers détails ci-après et cliquez sur 'Mettre à jour' pour enregistrer" +#, fuzzy +msgid "Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in." +msgstr "À noter que votre courriel est à utiliser comme nom dutilisateur. Si vous modifiez ces informations, rappelez-vous dutiliser votre courriel en vous connectant.
" + msgid "Please only enter up to 165 characters, you have used" msgstr "" +msgid "Please select one" +msgstr "" + msgid "Policy Expectations" msgstr "Résultats attendus du plan" msgid "Preview" msgstr "Aperçu" +#, fuzzy +msgid "Primary research organisation" +msgstr "Organisation" + msgid "Principal Investigator / Researcher" msgstr "Directeur de recherche / chercheur" @@ -984,6 +1031,9 @@ msgid "Privileges" msgstr "" +msgid "Project title" +msgstr "" + msgid "Public" msgstr "Public" @@ -1068,24 +1118,27 @@ msgid "Sections" msgstr "Sections" -msgid "Select Funder" -msgstr "Funder" - -msgid "Select Organisation" -msgstr "Organisation" +#, fuzzy +msgid "Select a template" +msgstr "templates" msgid "Select an action" msgstr "Sélectionnez une action" +#, fuzzy +msgid "Select the funding organisation" +msgstr "Organisation" + +#, fuzzy +msgid "Select the primary research organisation responsible" +msgstr "Organisation" + msgid "Select which group this guidance relates to." msgstr "Sélectionnez le groupe auxquel ces conseils sont liés." msgid "Select which theme(s) this guidance relates to." msgstr "Sélectionnez le ou les thèmes liés à ces conseils." -msgid "Select your research funder or no funder, as appropariate." -msgstr "" - msgid "Selected option(s)" msgstr "" @@ -1125,6 +1178,9 @@ msgid "Status" msgstr "" +msgid "Subject" +msgstr "" + msgid "Successfully unlinked your account from %{is}." msgstr "" @@ -1177,6 +1233,9 @@ msgid "That template is not currently published." msgstr "templates" +msgid "The" +msgstr "" + msgid "The " msgstr "" @@ -1192,9 +1251,6 @@ msgid "Themes" msgstr "Thèmes" -msgid "There are a number of possible templates you could use. Please choose one." -msgstr "Un certain nombre de modèle vous sont proposés. Choisissez." - msgid "There are no public DMPs." msgstr "Aucun DMP n'a été rendu public." @@ -1225,21 +1281,19 @@ msgid "This page gives you an overview of your plan. It tells what your plan is based on and gives an overview of the questions that you will be asked." msgstr "Cette page vous donne un aperçu de votre plan. Elle indique de quoi il s'inspire et donne une idée générale des questions auxquelles vous devrez répondre." +#, fuzzy +msgid "This plan is based on the default template." +msgstr "templates" + msgid "This plan is based on:" msgstr "Ce plan sinspire de :" msgid "This section is locked for editing by " msgstr "La modification de cette section a été verrouillée par " -msgid "Tick to select any other sources of guidance you wish to see." -msgstr "Cochez une ou plusieurs des sources de conseils que vous voulez voir." - msgid "Title" msgstr "Titre" -msgid "To see institutional questions and/or guidance, select your organisation." -msgstr "Sélectionnez votre organisme pour voir les questions et conseils de votre établissement." - msgid "Top" msgstr "Haut" @@ -1271,9 +1325,6 @@ msgid "Unlink institutional credentials alert" msgstr "Alerte de détachement dauthentifiant détablissement" -msgid "Unlink your institutional credentials" -msgstr "Détachez votre authentifiant détablissement" - msgid "Unlock my account" msgstr "" @@ -1302,6 +1353,9 @@ msgid "Users" msgstr "Utilisateurs" +msgid "Using the generic Data Management Plan" +msgstr "" + msgid "Version" msgstr "Version" @@ -1323,6 +1377,18 @@ msgid "Visibility" msgstr "Visibilité" +#, fuzzy +msgid "We found multiple DMP templates corresponding to the funder." +msgstr "templates" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to the research organisation." +msgstr "Organisation" + +#, fuzzy +msgid "We found multiple DMP templates corresponding to your funder." +msgstr "templates" + msgid "Website" msgstr "Site web" @@ -1336,9 +1402,17 @@ msgid "Welcome." msgstr "Bienvenue !" +#, fuzzy +msgid "What research project are you planning?" +msgstr "plans" + msgid "When you create a new phase for your template, a version will automatically be created. Once you complete the form below you will be provided with options to create sections and questions." msgstr "Quand vous créez une nouvelle phase dans votre modèle, une version sera créée automatiquement. Quand vous remplirez la grille ci-dessous, le système affichera des options pour créer des sections et des questions." +#, fuzzy +msgid "Which DMP template would you like to use?" +msgstr "templates" + msgid "While you were editing " msgstr "" @@ -1382,6 +1456,9 @@ msgid "You can edit any of the details below." msgstr "Vous pouvez modifiez les informations ci-dessous." +msgid "You can not continue until you have filled in all of the required information." +msgstr "" + #, fuzzy msgid "You can not edit a historical version of this template." msgstr "templates" @@ -1410,9 +1487,6 @@ msgid "You have unsaved answers in the following sections:" msgstr "" -msgid "You may leave blank or select a different organisation to your own." -msgstr "Ce champ peut rester vide, ou vous pouvez sélectionner un autre organisme que le vôtre." - msgid "You must accept the terms and conditions to register." msgstr "" @@ -1437,9 +1511,6 @@ msgid "Your account has been successfully linked to %{scheme}." msgstr "" -msgid "Your account is linked to your institutional credentials." -msgstr "Votre compte est lié à votre authentifiant détablissement." - msgid "Your account won't be created until you access the link above and set your password." msgstr "" @@ -1532,12 +1603,13 @@ msgid "e.g. School/ Department" msgstr "par ex. : Faculté/Département" -msgid "format" -msgstr "" - msgid "from now" msgstr "" +#, fuzzy +msgid "generic template" +msgstr "templates" + msgid "guidance" msgstr "" @@ -1584,6 +1656,10 @@ msgstr "guidances" #, fuzzy +msgid "no research organisation is associated with this plan" +msgstr "Organisation" + +#, fuzzy msgid "note" msgstr "Note" diff --git a/config/routes.rb b/config/routes.rb index 1f4d9a1..27c1d67 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,14 +12,14 @@ resources :questions resources :question_formats resources :question_options - resources :suggested_answers + resources :annotations resources :answers resources :guidances resources :guidance_groups resources :themes resources :notes resources :plans - resources :plans_guidance_groups + # resources :plans_guidance_groups resources :identifier_schemes resources :exported_plans resources :regions @@ -161,7 +161,7 @@ end end - resources :suggested_answers, path: 'org/admin/templates/suggested_answers', only: [] do + resources :annotations, path: 'org/admin/templates/annotations', only: [] do member do post 'admin_create' put 'admin_update' diff --git a/db/schema.rb b/db/schema.rb index fe00e7b..f0bfbd2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,6 +16,15 @@ # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "annotations", force: :cascade do |t| + t.integer "question_id" + t.integer "org_id" + t.text "text" + t.integer "type", default: 0, null: false + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "answers", force: :cascade do |t| t.text "text" t.integer "plan_id" @@ -271,15 +280,6 @@ t.datetime "updated_at", null: false end - create_table "suggested_answers", force: :cascade do |t| - t.integer "question_id" - t.integer "org_id" - t.text "text" - t.boolean "is_example" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "templates", force: :cascade do |t| t.string "title" t.text "description" @@ -330,8 +330,8 @@ t.string "email", default: "", null: false t.string "orcid_id" t.string "shibboleth_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at" + t.datetime "updated_at" t.string "encrypted_password", default: "" t.string "reset_password_token" t.datetime "reset_password_sent_at" @@ -370,6 +370,8 @@ add_index "users_perms", ["user_id", "perm_id"], name: "index_users_perms_on_user_id_and_perm_id", using: :btree + add_foreign_key "annotations", "orgs" + add_foreign_key "annotations", "questions" add_foreign_key "answers", "plans" add_foreign_key "answers", "questions" add_foreign_key "answers", "users" @@ -395,8 +397,6 @@ add_foreign_key "roles", "plans" add_foreign_key "roles", "users" add_foreign_key "sections", "phases" - add_foreign_key "suggested_answers", "orgs" - add_foreign_key "suggested_answers", "questions" add_foreign_key "templates", "orgs" add_foreign_key "themes_in_guidance", "guidances" add_foreign_key "themes_in_guidance", "themes" diff --git a/db/seeds.rb b/db/seeds.rb index 9277a5a..7da10a5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -671,17 +671,17 @@ # Create suggested answers for a few questions # ------------------------------------------------------- -suggested_answers = [ +annotations = [ {text: "We will preserve it in Dryad or a similar data repository service.", - is_example: true, + type: Annotation.types[:example_answer], org: Org.find_by(abbreviation: 'GA'), question: Question.find_by(text: "What is your policy for long term access to your dataset?")}, {text: "We recommend that you identify the type(s) of content as well as the type of file(s) involved", - is_example: false, + type: Annotation.types[:example_answer], org: Org.find_by(abbreviation: 'GA'), question: Question.find_by(text: "What types of data will you collect and how will it be stored?")}, ] -suggested_answers.map{ |s| SuggestedAnswer.create!(s) if SuggestedAnswer.find_by(text: s[:text]).nil? } +annotations.map{ |s| Annotation.create!(s) if Annotation.find_by(text: s[:text]).nil? } # Create options for the dropdown, multi-select and radio buttons # ------------------------------------------------------- diff --git a/lib/assets/stylesheets/roadmap-form.scss b/lib/assets/stylesheets/roadmap-form.scss index 9abd90a..72345a1 100644 --- a/lib/assets/stylesheets/roadmap-form.scss +++ b/lib/assets/stylesheets/roadmap-form.scss @@ -150,13 +150,12 @@ input.form-submit { background-color: $primary-color; color: $reverse-text; - padding: 10px 30px; - font-size: 12pt; - margin-top: 15px; - - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; + font-size: 14px; + padding: 4px 12px; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; } /* Override the button color for the Org Admin sections */ input[type="submit"].admin{ @@ -171,13 +170,12 @@ button.form-cancel { background-color: $cancel-button-color; color: $reverse-text; - padding: 10px 30px; - font-size: 12pt; - margin-top: 15px; + font-size: 14px; + padding: 4px 12px; - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; } .submit-tooltip { display: none; diff --git a/lib/tasks/migrate.rake b/lib/tasks/migrate.rake index cc9e87e..0bd54fd 100644 --- a/lib/tasks/migrate.rake +++ b/lib/tasks/migrate.rake @@ -248,5 +248,22 @@ end end end + + desc "enforce single published version for templates" + task single_published_template: :environment do + # for each group of versions of a template + Template.all.pluck(:dmptemplate_id).uniq.each do |dmptemplate_id| + published = false + Template.where(dmptemplate_id: dmptemplate_id).order(version: :desc).each do |template| + # leave the first published template we find alone + if !published && template.published + published = true + elsif published && template.published + template.published = false + template.save! + end + end + end + end end diff --git a/test/functional/annotations_controller_test.rb b/test/functional/annotations_controller_test.rb new file mode 100644 index 0000000..8615d16 --- /dev/null +++ b/test/functional/annotations_controller_test.rb @@ -0,0 +1,116 @@ +require 'test_helper' + +class AnnotationsControllerTest < ActionDispatch::IntegrationTest + + include Devise::Test::IntegrationHelpers + + setup do + @question = Annotation.first.question + + # Get the first Org Admin + scaffold_org_admin(@question.section.phase.template.org) + end + +# TODO: The following methods SHOULD replace the old 'admin_' prefixed methods. The routes file already has +# these defined. They are defined multiple times though and we need to clean this up! In particular +# look at the unnamed routes after 'new_plan_phase' below. They are not named because they are duplicates. +# We should just have: +# +# SHOULD BE: +# -------------------------------------------------- +# suggested_answers GET /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:id sections#index +# POST /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:id sections#create +# suggested_answer GET /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:question_id/suggested_answer/:id sections#show +# PATCH /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#update +# PUT /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#update +# DELETE /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#destroy +# +# CURRENT RESULTS OF `rake routes` +# -------------------------------------------------- +# admin_create_suggested_answer POST /org/admin/templates/suggested_answers/:id/admin_create suggested_answers#admin_create +# admin_update_suggested_answer PUT /org/admin/templates/suggested_answers/:id/admin_update suggested_answers#admin_update +# admin_destroy_suggested_answer DELETE /org/admin/templates/suggested_answers/:id/admin_destroy suggested_answers#admin_destroy + + + + # POST /org/admin/templates/suggested_answers/:id/admin_create (admin_create_annotation_path) + # ---------------------------------------------------------- + test "create a new annotation" do + params = {org_id: @user.org.id, question_id: @question.id, text: "Here's a suggestion"} + + # Should redirect user to the root path if they are not logged in! + post admin_create_annotation_path(@question.id), {annotation: params} + assert_unauthorized_redirect_to_root_path + + sign_in @user + + post admin_create_annotation_path(@question.id), {annotation: params} + assert_response :redirect + assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true&question_id=#{@question.id}§ion_id=#{@question.section.id}" + assert_equal _('Information was successfully created.'), flash[:notice] + assert_equal "Here's a suggestion", Annotation.last.text, "expected the record to have been created!" + assert assigns(:example_answer) + + # Invalid object + post admin_create_annotation_path(@question.id), {annotation: {question_id: @question.id}} + assert flash[:notice].starts_with?(_('Could not create your')) + assert_response :success + assert assigns(:example_answer) + end + + # PUT /org/admin/templates/suggested_answers/:id/admin_update (admin_update_suggested_answer_path) + # ---------------------------------------------------------- + test "update the annotation" do + params = {text: 'UPDATE'} + + # Should redirect user to the root path if they are not logged in! + put admin_update_annotation_path(Annotation.first), {annotation: params} + assert_unauthorized_redirect_to_root_path + + sign_in @user + + # Valid save + put admin_update_annotation_path(Annotation.first), {annotation: params} + assert_equal _('Information was successfully updated.'), flash[:notice] + assert_response :redirect + assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true&question_id=#{@question.id}§ion_id=#{@question.section.id}" + assert assigns(:example_answer) + assert assigns(:question) + assert assigns(:section) + assert assigns(:phase) + assert_equal 'UPDATE', Annotation.first.text, "expected the record to have been updated" + +# TODO: We need to add in validation checks on the model and reactivate this test + # Invalid save +# put admin_update_suggested_answer_path(SuggestedAnswer.first), {suggested_answer: {text: nil}} +# assert flash[:notice].starts_with?(_('Could not update your')) +# assert_response :success +# assert assigns(:suggested_answer) +# assert assigns(:question) +# assert assigns(:section) +# assert assigns(:phase) + end + + # DELETE /org/admin/templates/suggested_answers/:id/admin_destroy (admin_destroy_suggested_answer_path) + # ---------------------------------------------------------- + test "delete the section" do + id = Annotation.first.id + # Should redirect user to the root path if they are not logged in! + delete admin_destroy_annotation_path(id: id) + assert_unauthorized_redirect_to_root_path + + sign_in @user + + delete admin_destroy_annotation_path(id: id) + assert_equal _('Information was successfully deleted.'), flash[:notice] + assert_response :redirect + assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true§ion_id=#{@question.section.id}" + assert assigns(:question) + assert assigns(:section) + assert assigns(:phase) + assert_raise ActiveRecord::RecordNotFound do + Annotation.find(id).nil? + end + end + +end \ No newline at end of file diff --git a/test/functional/questions_controller_test.rb b/test/functional/questions_controller_test.rb index 2a9cbcf..9a156f5 100644 --- a/test/functional/questions_controller_test.rb +++ b/test/functional/questions_controller_test.rb @@ -38,7 +38,7 @@ # POST /org/admin/templates/questions/:id/admin_create (admin_create_question_path) # ---------------------------------------------------------- test "create a new question" do - params = {section_id: @section.id, text: 'Test Question', number: 9, question_format_id: @question_format.id} + params = {section_id: @section.id, text: 'Test Question', number: 9, question_format_id: @question_format.id, annotations_attributes: {0 => {text: "some text", org_id: Org.first.id}}} @section.phase.template.dirty = false @section.phase.template.save! @@ -48,7 +48,11 @@ assert_unauthorized_redirect_to_root_path sign_in @user - + @new_question = Question.new + @new_question.number = @section.questions.count + 1 + example_answer = @new_question.annotations.build + example_answer.type = :example_answer + example_answer.save post admin_create_question_path(@section), {question: params} assert_response :redirect assert assigns(:question) diff --git a/test/functional/suggested_answers_controller_test.rb b/test/functional/suggested_answers_controller_test.rb deleted file mode 100644 index dcdd2ce..0000000 --- a/test/functional/suggested_answers_controller_test.rb +++ /dev/null @@ -1,116 +0,0 @@ -require 'test_helper' - -class SuggestedAnswersControllerTest < ActionDispatch::IntegrationTest - - include Devise::Test::IntegrationHelpers - - setup do - @question = SuggestedAnswer.first.question - - # Get the first Org Admin - scaffold_org_admin(@question.section.phase.template.org) - end - -# TODO: The following methods SHOULD replace the old 'admin_' prefixed methods. The routes file already has -# these defined. They are defined multiple times though and we need to clean this up! In particular -# look at the unnamed routes after 'new_plan_phase' below. They are not named because they are duplicates. -# We should just have: -# -# SHOULD BE: -# -------------------------------------------------- -# suggested_answers GET /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:id sections#index -# POST /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:id sections#create -# suggested_answer GET /templates/:template_id/phases/:phase_id/sections/:section_id/questions/:question_id/suggested_answer/:id sections#show -# PATCH /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#update -# PUT /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#update -# DELETE /templates/:template_id/phases/:phase_id/section/:section_id/questions/:question_id/suggested_answer/:id sections#destroy -# -# CURRENT RESULTS OF `rake routes` -# -------------------------------------------------- -# admin_create_suggested_answer POST /org/admin/templates/suggested_answers/:id/admin_create suggested_answers#admin_create -# admin_update_suggested_answer PUT /org/admin/templates/suggested_answers/:id/admin_update suggested_answers#admin_update -# admin_destroy_suggested_answer DELETE /org/admin/templates/suggested_answers/:id/admin_destroy suggested_answers#admin_destroy - - - - # POST /org/admin/templates/suggested_answers/:id/admin_create (admin_create_suggested_answer_path) - # ---------------------------------------------------------- - test "create a new section" do - params = {org_id: @user.org.id, question_id: @question.id, text: "Here's a suggestion"} - - # Should redirect user to the root path if they are not logged in! - post admin_create_suggested_answer_path(@question.id), {suggested_answer: params} - assert_unauthorized_redirect_to_root_path - - sign_in @user - - post admin_create_suggested_answer_path(@question.id), {suggested_answer: params} - assert_response :redirect - assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true&question_id=#{@question.id}§ion_id=#{@question.section.id}" - assert_equal _('Information was successfully created.'), flash[:notice] - assert_equal "Here's a suggestion", SuggestedAnswer.last.text, "expected the record to have been created!" - assert assigns(:suggested_answer) - - # Invalid object - post admin_create_suggested_answer_path(@question.id), {suggested_answer: {question_id: @question.id}} - assert flash[:notice].starts_with?(_('Could not create your')) - assert_response :success - assert assigns(:suggested_answer) - end - - # PUT /org/admin/templates/suggested_answers/:id/admin_update (admin_update_suggested_answer_path) - # ---------------------------------------------------------- - test "update the section" do - params = {text: 'UPDATE'} - - # Should redirect user to the root path if they are not logged in! - put admin_update_suggested_answer_path(SuggestedAnswer.first), {suggested_answer: params} - assert_unauthorized_redirect_to_root_path - - sign_in @user - - # Valid save - put admin_update_suggested_answer_path(SuggestedAnswer.first), {suggested_answer: params} - assert_equal _('Information was successfully updated.'), flash[:notice] - assert_response :redirect - assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true&question_id=#{@question.id}§ion_id=#{@question.section.id}" - assert assigns(:suggested_answer) - assert assigns(:question) - assert assigns(:section) - assert assigns(:phase) - assert_equal 'UPDATE', SuggestedAnswer.first.text, "expected the record to have been updated" - -# TODO: We need to add in validation checks on the model and reactivate this test - # Invalid save -# put admin_update_suggested_answer_path(SuggestedAnswer.first), {suggested_answer: {text: nil}} -# assert flash[:notice].starts_with?(_('Could not update your')) -# assert_response :success -# assert assigns(:suggested_answer) -# assert assigns(:question) -# assert assigns(:section) -# assert assigns(:phase) - end - - # DELETE /org/admin/templates/suggested_answers/:id/admin_destroy (admin_destroy_suggested_answer_path) - # ---------------------------------------------------------- - test "delete the section" do - id = SuggestedAnswer.first.id - # Should redirect user to the root path if they are not logged in! - delete admin_destroy_suggested_answer_path(id: id) - assert_unauthorized_redirect_to_root_path - - sign_in @user - - delete admin_destroy_suggested_answer_path(id: id) - assert_equal _('Information was successfully deleted.'), flash[:notice] - assert_response :redirect - assert_redirected_to "#{admin_show_phase_path(@question.section.phase.id)}?edit=true§ion_id=#{@question.section.id}" - assert assigns(:question) - assert assigns(:section) - assert assigns(:phase) - assert_raise ActiveRecord::RecordNotFound do - SuggestedAnswer.find(id).nil? - end - end - -end \ No newline at end of file diff --git a/test/unit/annotation_test.rb b/test/unit/annotation_test.rb new file mode 100644 index 0000000..9734c10 --- /dev/null +++ b/test/unit/annotation_test.rb @@ -0,0 +1,63 @@ +require 'test_helper' + +class AnnotationTest < ActiveSupport::TestCase + + setup do + scaffold_template + + @org = Org.last + @question = @template.phases.first.sections.first.questions.first + + @annotation = Annotation.create(org: @org, question: @question, text: 'Test', + type: Annotation.types[:example_answer]) + end + + # --------------------------------------------------- + test "required fields are required" do + assert_not Annotation.new.valid? + assert_not Annotation.new(org: @org, text: 'Tester').valid?, "expected the 'question' field to be required" + assert_not Annotation.new(question: @question, text: 'Tester').valid?, "expected the 'org' field to be required" + + # TODO: introduce validation on the model that requires text to be provided. + #assert_not Annotation.new(org: @org, question: @question).valid?, "expected the 'text' field to be required" + + # Ensure the bare minimum and complete versions are valid + a = Annotation.new(org: @org, question: @question, text: 'Tester') + assert a.valid?, "expected the 'org', 'question' and 'text' fields to be enough to create an Annotation! - #{a.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" + end + + # --------------------------------------------------- + test "to_s returns the text" do + assert_equal @annotation.text, @annotation.to_s + end + + # --------------------------------------------------- + test "deep_copy" do + verify_deep_copy(@annotation, ['id', 'created_at', 'updated_at']) + end + + # --------------------------------------------------- + test "can CRUD Annotation" do + obj = Annotation.create(org: @org, question: @question, text: 'Tester') + assert_not obj.id.nil?, "was expecting to be able to create a new Annotation: #{obj.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" + + obj.text = 'my tester' + obj.save! + obj.reload + assert_equal 'my tester', obj.text, "Was expecting to be able to update the text of the Annotation!" + + assert obj.destroy!, "Was unable to delete the Annotation!" + end + + # --------------------------------------------------- + test "can manage belongs_to relationship with Org" do + annotation = Annotation.new(question: @question, text: 'Testing') + verify_belongs_to_relationship(annotation, @org) + end + + # --------------------------------------------------- + test "can manage belongs_to relationship with Question" do + annotation = Annotation.new(org: @org, text: 'Testing') + verify_belongs_to_relationship(annotation, @question) + end +end \ No newline at end of file diff --git a/test/unit/org_test.rb b/test/unit/org_test.rb index c2c497d..3e7fd34 100644 --- a/test/unit/org_test.rb +++ b/test/unit/org_test.rb @@ -181,9 +181,9 @@ end # --------------------------------------------------- - test "can manage has_many relationship with SuggestedAnswers" do - sa = SuggestedAnswer.new(question: Question.first, text: 'Test Suggested Answer') - verify_has_many_relationship(@org, sa, @org.suggested_answers.count) + test "can manage has_many relationship with Annotations" do + a = Annotation.new(question: Question.first, text: 'Test Annotation') + verify_has_many_relationship(@org, a, @org.annotations.count) end # --------------------------------------------------- diff --git a/test/unit/question_test.rb b/test/unit/question_test.rb index be8981e..a5bb6c3 100644 --- a/test/unit/question_test.rb +++ b/test/unit/question_test.rb @@ -4,18 +4,18 @@ setup do @user = User.last - + scaffold_template - + @section = @template.phases.first.sections.first - + @question = Question.create(text: 'Test question', default_value: 'ABCD', guidance: 'Hello', - number: 999, section: @section, - question_format: QuestionFormat.where(option_based: false).first, + number: 999, section: @section, + question_format: QuestionFormat.where(option_based: false).first, option_comment_display: true, modifiable: true, - themes: [Theme.first], - suggested_answers: [SuggestedAnswer.new(org: @user.org, - text: "just a suggestion")]) + themes: [Theme.first], + annotations: [Annotation.new(org: @user.org, + text: "just a suggestion")]) end # --------------------------------------------------- @@ -24,21 +24,21 @@ assert_not Question.new(section: @section, number: 7).valid?, "expected the 'text' field to be required" assert_not Question.new(number: 7, text: 'Testing').valid?, "expected the 'section' field to be required" assert_not Question.new(section: @section, text: 'Testing').valid?, "expected the 'number' field to be required" - + # Ensure the bar minimum and complete versions are valid a = Question.new(section: @section, text: 'Testing', number: 7) assert a.valid?, "expected the 'text', 'section' and 'number' fields to be enough to create an Question! - #{a.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" end - + # --------------------------------------------------- test "to_s returns the Question text" do assert_equal @question.text, @question.to_s end - + # --------------------------------------------------- test "returns the correct themed guidance for the org" do all = Theme.first.guidances + Theme.last.guidances - + # Attach 2 themes to the question @question.themes = [Theme.first, Theme.last] @question.save! @@ -53,25 +53,25 @@ assert @question.guidance_for_org(@user.org).first.first.include?(Theme.first.guidances.first.guidance_group.name), "expected the guidance_group.name" assert_equal Theme.first.guidances.first, @question.guidance_for_org(@user.org).first.last, "expected the guidance object to be returned" end - + # --------------------------------------------------- - test "returns the correct suggested answer for the org" do - @question.suggested_answers = [SuggestedAnswer.new(org: @user.org, text: 'Test 1', is_example: false), - SuggestedAnswer.new(org: Org.first, text: 'Test 2', is_example: false)] + test "returns the correct annotation for the org" do + @question.annotations = [Annotation.create(org: @user.org, text: 'Test 1', type: Annotation.types[:example_answer]), + Annotation.create(org: Org.first, text: 'Test 2', type: Annotation.types[:example_answer])] @question.save! - - assert_equal 'Test 1', @question.get_suggested_answer(@user.org.id).text, "expected the correct suggested answer" - assert_equal 'Test 2', @question.get_suggested_answer(Org.first.id).text, "expected the correct suggested answer" - + + assert_equal 'Test 1', @question.annotations.where(org_id: @user.org.id).first.text, "expected the correct annotation" + assert_equal 'Test 2', @question.annotations.where(org_id: Org.first.id).first.text, "expected the correct annotation" + org = Org.create(name: 'New One') - assert_equal nil, @question.get_suggested_answer(org.id), "expected no suggested answer for a new org" + assert_equal nil, @question.get_example_answer(org.id), "expected no annotation for a new org" end - + # --------------------------------------------------- test "deep copy" do verify_deep_copy(@question, ['id', 'created_at', 'updated_at']) end - + # --------------------------------------------------- test "can CRUD Question" do obj = Question.create(section: @section, text: 'Test ABC', number: 7) @@ -81,39 +81,39 @@ obj.save! obj.reload assert_equal 'Testing an update', obj.text, "Was expecting to be able to update the text of the Question!" - + assert obj.destroy!, "Was unable to delete the Question!" end - + # --------------------------------------------------- test "can manage belongs_to relationship with Section" do verify_belongs_to_relationship(@question, @template.phases.first.sections.last) end - + # --------------------------------------------------- test "can manage belongs_to relationship with QuestionFormat" do verify_belongs_to_relationship(@question, QuestionFormat.where(option_based: false).last) end - + # --------------------------------------------------- test "can manage has_many relationship with Answer" do scaffold_plan a = Answer.new(user: @user, plan: @plan, text: 'Test Answer') verify_has_many_relationship(@question, a, @question.answers.count) end - + # --------------------------------------------------- test "can manage has_many relationship with QuestionOption" do qo = QuestionOption.new(text: 'Test', number: 9) verify_has_many_relationship(@question, qo, @question.question_options.count) end - + # --------------------------------------------------- - test "can manage has_many relationship with SuggestedAnswer" do - sa = SuggestedAnswer.new(text: 'Suggested Answer', org: @user.org) - verify_has_many_relationship(@question, sa, @question.suggested_answers.count) + test "can manage has_many relationship with Annotation" do + sa = Annotation.new(text: 'Suggested Answer', org: @user.org) + verify_has_many_relationship(@question, sa, @question.annotations.count) end - + # --------------------------------------------------- test "can manage has_many relationship with Themes" do t = Theme.new(title: 'Test Theme') diff --git a/test/unit/suggested_answer_test.rb b/test/unit/suggested_answer_test.rb deleted file mode 100644 index 31be604..0000000 --- a/test/unit/suggested_answer_test.rb +++ /dev/null @@ -1,63 +0,0 @@ -require 'test_helper' - -class SuggestedAnswerTest < ActiveSupport::TestCase - - setup do - scaffold_template - - @org = Org.last - @question = @template.phases.first.sections.first.questions.first - - @suggested_answer = SuggestedAnswer.create(org: @org, question: @question, text: 'Test', - is_example: true) - end - - # --------------------------------------------------- - test "required fields are required" do - assert_not SuggestedAnswer.new.valid? - assert_not SuggestedAnswer.new(org: @org, text: 'Tester').valid?, "expected the 'question' field to be required" - assert_not SuggestedAnswer.new(question: @question, text: 'Tester').valid?, "expected the 'org' field to be required" - - # TODO: introduce validation on the model that requires text to be provided. - #assert_not SuggestedAnswer.new(org: @org, question: @question).valid?, "expected the 'text' field to be required" - - # Ensure the bare minimum and complete versions are valid - a = SuggestedAnswer.new(org: @org, question: @question, text: 'Tester') - assert a.valid?, "expected the 'org', 'question' and 'text' fields to be enough to create an SuggestedAnswer! - #{a.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" - end - - # --------------------------------------------------- - test "to_s returns the text" do - assert_equal @suggested_answer.text, @suggested_answer.to_s - end - - # --------------------------------------------------- - test "deep_copy" do - verify_deep_copy(@suggested_answer, ['id', 'created_at', 'updated_at']) - end - - # --------------------------------------------------- - test "can CRUD SuggestedAnswer" do - obj = SuggestedAnswer.create(org: @org, question: @question, text: 'Tester') - assert_not obj.id.nil?, "was expecting to be able to create a new SuggestedAnswer: #{obj.errors.map{|f, m| f.to_s + ' ' + m}.join(', ')}" - - obj.text = 'my tester' - obj.save! - obj.reload - assert_equal 'my tester', obj.text, "Was expecting to be able to update the text of the SuggestedAnswer!" - - assert obj.destroy!, "Was unable to delete the SuggestedAnswer!" - end - - # --------------------------------------------------- - test "can manage belongs_to relationship with Org" do - suggested_answer = SuggestedAnswer.new(question: @question, text: 'Testing') - verify_belongs_to_relationship(suggested_answer, @org) - end - - # --------------------------------------------------- - test "can manage belongs_to relationship with Question" do - suggested_answer = SuggestedAnswer.new(org: @org, text: 'Testing') - verify_belongs_to_relationship(suggested_answer, @question) - end -end \ No newline at end of file