diff --git a/app/views/dmptemplates/_edit_question.html.erb b/app/views/dmptemplates/_edit_question.html.erb index c02d104..3233d80 100644 --- a/app/views/dmptemplates/_edit_question.html.erb +++ b/app/views/dmptemplates/_edit_question.html.erb @@ -1,8 +1,8 @@ - @@ -13,11 +13,10 @@ <%= t("org_admin.questions.question_number_label")%> <%= f.number_field :number, :in => 1..50, :class => "number_field has-tooltip", "data-toggle" => "tooltip", "title" => t("org_admin.questions.number_help_text") %> -
- + <%= t("org_admin.questions.question_text_label")%> @@ -25,7 +24,7 @@
- + <%= t("org_admin.questions.answer_format_label")%> @@ -39,9 +38,9 @@
<%= link_to( image_tag("help_button.png"), "#", :class => "question_format_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_format_help_text_html"))%>
- - - + + + -
+
-
+
-
+
-
+
- + - + <%= t("org_admin.questions.suggested_or_example_answer_label")%>
<% suggested_answer = question.suggested_answers.find_by_organisation_id(current_user.organisation.id) %> - <% if question.suggested_answers == [] then %> + <% if suggested_answer.nil? then %> <% suggested_answer = question.suggested_answers.build %> <%end%> <%= f.fields_for :suggested_answers, suggested_answer do |s|%> @@ -129,11 +127,10 @@
<%= link_to( image_tag("help_button.png"), "#", :class => "suggested_answer_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.suggested_answer_help_text_html"))%>
-
+
- <%= t("org_admin.questions.guidance_label")%> @@ -143,12 +140,10 @@
<%= link_to( image_tag("help_button.png"), "#", :class => "question_guidance_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_guidance_help_text_html"))%>
-
+
- - <%= t("org_admin.questions.themes_label")%> @@ -160,12 +155,10 @@
<%= link_to( image_tag("help_button.png"), "#", :class => "question_themes_popover", :rel => "popover", "data-html" => "true", "data-content" => t("org_admin.questions.question_themes_help_text_html"))%>
- - +
-
<%= f.submit t("helpers.submit.save"), :class => "btn btn-primary" %> @@ -182,4 +175,3 @@ <%= render :partial => "guidance_display", locals: {question: question}%> <%end%> - diff --git a/app/views/plans/export.pdf.erb b/app/views/plans/export.pdf.erb index 8d27ebd..3400dcd 100644 --- a/app/views/plans/export.pdf.erb +++ b/app/views/plans/export.pdf.erb @@ -1,52 +1,52 @@ - - - <% if @plan.project.dmptemplate.phases.count > 1 then %> - <%= "#{@plan.project.title} - #{@plan.title}" %> - <% else %> - <%= @plan.project.title %> - <% end %> - - - - -

<%= @plan.title %>

- <% @exported_plan.admin_details.each do |field| - value = @exported_plan.send(field) - if value.present? - %> -

<%= t("helpers.plan.export.#{field}") -%> <%= value -%>

- <% end %> - <% end %> + + + + <% if @plan.project.dmptemplate.phases.count > 1 then %> + <%= "#{@plan.project.title} - #{@plan.title}" %> + <% else %> + <%= @plan.project.title %> + <% end %> + + + + +

<%= @plan.title %>

+ <% @exported_plan.admin_details.each do |field| + value = @exported_plan.send(field) + if value.present? + %> +

<%= t("helpers.plan.export.#{field}") -%> <%= value -%>

+ <% end %> + <% end %> - <% @exported_plan.sections.each do |section| %> -

<%= section.title %>

- <% questions = @exported_plan.questions_for_section(section.id) %> - <% questions.each_with_index do |question, idx| %> -
- <% unless idx == 0 && question.text == section.title %> -

<%= question.text %>

- <% end %> - <% answer = @plan.answer(question.id, false) %> - <% if answer.nil? then %> -

<%= t('helpers.plan.export.pdf.question_not_answered') -%>

- <% else %> + <% @exported_plan.sections.each do |section| %> +

<%= section.title %>

+ <% questions = @exported_plan.questions_for_section(section.id) %> + <% questions.each_with_index do |question, idx| %> +
+ <% unless idx == 0 && question.text == section.title %> +

<%= question.text %>

+ <% end %> + <% answer = @plan.answer(question.id, false) %> + <% if answer.nil? then %> +

<%= t('helpers.plan.export.pdf.question_not_answered') -%>

+ <% else %> <% q_format = question.question_format%> <% 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%> -
    <% answer.options.each do |option| %>
  • <%= option.text %>
  • @@ -56,19 +56,17 @@ <% if question.option_comment_display == true then%> <% if !answer.text.nil? then %> <%= raw answer.text.gsub(/(\s||<\/td>| )*(<\/tr>|)/,"") %> - <%end%> + <%end%> <%end%> <%else%> <% if !answer.text.nil? then %> <%= raw answer.text.gsub(/(\s||<\/td>| )*(<\/tr>|)/,"") %> - <%end%> + <%end%> <% end %> - - - <% end %> -
- <% end %> - <% end %> - - + <% end %> +
+ <% end %> + <% end %> + + \ No newline at end of file