diff --git a/app/controllers/settings/projects_controller.rb b/app/controllers/settings/projects_controller.rb index 6ba2cd3..8b0f800 100644 --- a/app/controllers/settings/projects_controller.rb +++ b/app/controllers/settings/projects_controller.rb @@ -36,7 +36,7 @@ @settings = current_user.settings(:plan_list) # :name column should always be present (displayed as a disabled checkbox) # so it's not necessary to include it in the list here - @all_columns -= [:name] + @all_columns -= ['name'] end def settings_json diff --git a/app/models/exported_plan.rb b/app/models/exported_plan.rb index 2ea784b..d062473 100644 --- a/app/models/exported_plan.rb +++ b/app/models/exported_plan.rb @@ -92,18 +92,18 @@ def as_txt output = "#{self.plan.project.title}\n\n#{self.plan.version.phase.title}\n" - - -puts "SETTINGS: #{self.plan.inspect}" - - output += "\nDetails:\n#{self.plan.settings[:export][:fields][:admin].collect{|f| f.to_s}.join('\n')}\n" + output += "\nDetails:\n\n" + attrs = self.plan.settings(:export)[:value]['fields'][:admin].collect{|f| f.to_s} + attrs.each do |attr| + output += attr + ": " + self.send(attr) + "\n" + end self.sections.each do |section| output += "\n#{section.title}\n" self.questions_for_section(section).each do |question| qtext = sanitize_text( question.text.gsub(/
  • /, ' * ') ) - output += "\n#{qtext}\n" + output += "\n* #{qtext}" answer = self.plan.answer(question.id, false) if answer.nil? || answer.text.nil? then diff --git a/app/views/dmptemplates/_add_question.html.erb b/app/views/dmptemplates/_add_question.html.erb index 1caf54c..b9bbfc8 100644 --- a/app/views/dmptemplates/_add_question.html.erb +++ b/app/views/dmptemplates/_add_question.html.erb @@ -38,7 +38,11 @@
    <%= f.select :question_format_id, - options_from_collection_for_select(QuestionFormat.all.order("title"), :id, :title, QuestionFormat.find_by_title(t("helpers.text_area")).id), + #options_from_collection_for_select(QuestionFormat.all.order("title"), :id, :title, QuestionFormat.find_by_title(t("helpers.text_area")).id), + # the above was the line but it doesn't work because in the DB + # the QuestionFormat title is in English (Text area) + # but the above uses the Fr translation and so gets a nil + options_from_collection_for_select(QuestionFormat.all.order("title"), :id, :title, QuestionFormat.find_by_title("Text area").id), {}, :id => "new-select-format-#{section.id}"%>
    diff --git a/app/views/dmptemplates/_admin_nav_tabs.html.erb b/app/views/dmptemplates/_admin_nav_tabs.html.erb index 49c3c20..e2237ea 100644 --- a/app/views/dmptemplates/_admin_nav_tabs.html.erb +++ b/app/views/dmptemplates/_admin_nav_tabs.html.erb @@ -10,7 +10,7 @@ <%= link_to t('org_admin.templates.template_details'), admin_template_dmptemplate_path(dmptemplate) %>
  • - <% dmptemplate.phases.each do |phase| %> + <% dmptemplate.phases.order(:number).each do |phase| %> <% if active == phase.id then %>
  • <% else %> diff --git a/app/views/layouts/_signin_signout.html.erb b/app/views/layouts/_signin_signout.html.erb index 654ed37..f4d79bb 100644 --- a/app/views/layouts/_signin_signout.html.erb +++ b/app/views/layouts/_signin_signout.html.erb @@ -9,7 +9,7 @@ - \ No newline at end of file + diff --git a/app/views/plans/_answer_form.html.erb b/app/views/plans/_answer_form.html.erb index 5f262ba..53fcbae 100644 --- a/app/views/plans/_answer_form.html.erb +++ b/app/views/plans/_answer_form.html.erb @@ -45,26 +45,30 @@ <% end %> + - <% if q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") || q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown") then%> + <% if q_format.title == "Check box" || + q_format.title == "Multi select box" || + q_format.title == "Radio buttons" || + q_format.title == "Dropdown" then%> <% options = question.options.order("number") %> - <% if q_format.title == t("helpers.checkbox") then %> + <% if q_format.title == "Check box" then %> <% if readonly then %> <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, input_html => { :disabled => true, :id => "options-#{question.id}" } %> <% else %> <%= f.input :options, :as => :check_boxes, :collection => options, :label => false, :input_html => { :id => "options-#{question.id}" } %> <% end %> - <% elsif q_format.title == t("helpers.multi_select_box") then %> + <% elsif q_format.title == "Multi select box" then %> <% if readonly then %> <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true, :disabled => true , :id => "options-#{question.id}" } %> <% else %> <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => true , :id => "options-#{question.id}" } %> <% end %> - <% elsif q_format.title == t("helpers.radio_buttons") then%> + <% elsif q_format.title == "Radio buttons" then%>
      <% options.each do |op| %>
    1. @@ -85,7 +89,7 @@ <%end%>
    - <% elsif q_format.title == t("helpers.dropdown") then%> + <% elsif q_format.title == "Dropdown" then%> <% if readonly then %> <%= f.input :options, :as => :select, :collection => options, :label => false, :input_html => { :multiple => false, :disabled => true, :id => "options-#{question.id}" } %> <% else %> @@ -108,10 +112,10 @@ <%end%> - <% elsif q_format.title == t("helpers.text_field") then %> + <% elsif q_format.title == "Text field" then %> <%= text_field_tag("answer-text-#{question.id}".to_sym, strip_tags(answer.text), class: "question_text_field") %> - <% elsif q_format.title == t("helpers.text_area") then%> + <% elsif q_format.title == "Text area" then%> <%= text_area_tag("answer-text-#{question.id}".to_sym, answer.text, class: "tinymce") %> <% end %> @@ -134,7 +138,10 @@
    >

    <%= question.text %>

    - <% if q_format.title == t("helpers.checkbox") || q_format.title == t("helpers.multi_select_box") || q_format.title == t("helpers.radio_buttons") || q_format.title == t("helpers.dropdown") %> + <% if q_format.title == "Check box" || + q_format.title == "Multi select box" || + q_format.title == "Radio buttons" || + q_format.title == "Dropdown" %>
      <% if answer.options.is_a? Option then %>
    • <%= answer.options.text %>
    • diff --git a/app/views/projects/_project_nav_tabs.html.erb b/app/views/projects/_project_nav_tabs.html.erb index 9e860f6..07200bd 100644 --- a/app/views/projects/_project_nav_tabs.html.erb +++ b/app/views/projects/_project_nav_tabs.html.erb @@ -9,8 +9,9 @@ <% end %> <%= link_to t("helpers.project.tab_plan"), project_path(project) %> - - <% project.plans.each do |plan| %> + + <% pplans = project.plans.sort { |x,y| x.version.phase.number <=> y.version.phase.number} %> + <% pplans.each do |plan| %> <% if active == plan.id then %>
    • <% else %> @@ -42,4 +43,4 @@ <%= link_to t("helpers.project.tab_export"), ["export",project] %>
    -
    \ No newline at end of file +
    diff --git a/app/views/settings/plans/_export_formatting_form.html.erb b/app/views/settings/plans/_export_formatting_form.html.erb index 632a9b1..ffa3cb2 100644 --- a/app/views/settings/plans/_export_formatting_form.html.erb +++ b/app/views/settings/plans/_export_formatting_form.html.erb @@ -10,8 +10,8 @@ <%= form_for(@export_settings, url: settings_plan_path(plan), method: :put, as: :export, remote: true) do |f| %>
    - <%= submit_tag(t("helpers.settings.plans.reset"), class: "btn btn-primary") %> - <%= submit_tag(t("helpers.save"), class: "btn btn-primary", "data-toggle" => "collapse", "data-target" => "#settings-accordion-plan-#{plan.version.phase.id}") %> + <%= submit_tag(t("helpers.settings.plans.reset"), class: "resetbutton btn btn-primary") %> + <%= submit_tag(t("helpers.save"), class: "savebutton btn btn-primary", "data-toggle" => "collapse", "data-target" => "#settings-accordion-plan-#{plan.version.phase.id}") %>
    diff --git a/app/views/static_pages/about_us.html.erb b/app/views/static_pages/about_us.html.erb index c6b2422..79309fd 100644 --- a/app/views/static_pages/about_us.html.erb +++ b/app/views/static_pages/about_us.html.erb @@ -23,7 +23,7 @@ <%= link_to t("about_page.tab_1"), "#Background", :data => { :toggle => "tab"} %>
  • <%if t("about_page.tab_2") != "" %> -
  • <%= link_to t("about_page.tab_2"), "#News", data => { :toggle => "tab"} %>
  • +
  • <%= link_to t("about_page.tab_2"), "#News", :data => { :toggle => "tab"} %>
  • <%end%> @@ -36,7 +36,8 @@ organisation_email: Rails.configuration.branding[:organisation][:email], organisation_url: Rails.configuration.branding[:organisation][:url], application_name: Rails.configuration.branding[:application][:name], - application_url: Rails.configuration.branding[:application][:url])%> + application_url: Rails.configuration.branding[:application][:url], + current_locale: I18n.locale)%>
    <%= raw t("about_page.body_text_tab_2_html", diff --git a/config/initializers/wicked_pdf.rb.example b/config/initializers/wicked_pdf.rb.example new file mode 100644 index 0000000..103b3e5 --- /dev/null +++ b/config/initializers/wicked_pdf.rb.example @@ -0,0 +1,9 @@ +module DMPRoadmap + class Application < Rails::Application + + WickedPdf.config = { + :exe_path => '/usr/local/bin/wkhtmltopdf' + } + + end +end \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5f4e0eb..9a889af 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -19,7 +19,7 @@ day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi] abbr_day_names: [DIM, LUN, MAR, MER, JEU, VEN, SAM] - # Don't forget the nil at the beginning; there's no such thing as a 0th month + # Dont forget the nil at the beginning; theres no such thing as a 0th month month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre] abbr_month_names: [~, JAN, FEV, MAR, AVR, MAI, JUN, JUL, AOU, SEP, OCT, NOV, DEC] # Used in date_select and datetime_select. @@ -42,23 +42,23 @@ dmponline3_text: "Version précédente de DMPonline" dcc_name: "Digital Curation Centre" welcome_title: "Bienvenue !" - welcome_text: "

    DMPonline est un développement du Digital Curation Centre (Centre de curation numérique britannique - DCC) pour vous aider dans la rédaction de plans de gestion de données, ou DMP.

    " - screencast_text: "Vidéo en ligne sur l'utilisation de DMPonline" - screencast_error_text: "La balise