diff --git a/app/views/projects/public_export.pdf.erb b/app/views/projects/public_export.pdf.erb new file mode 100644 index 0000000..77d68cb --- /dev/null +++ b/app/views/projects/public_export.pdf.erb @@ -0,0 +1,72 @@ + + + + + + <% 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 %> +

<%= raw 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%> + + + <% if question.option_comment_display == true then%> + <% if !answer.text.nil? then %> + <%= raw answer.text.gsub(/(\s||<\/td>| )*(<\/tr>|)/,"") %> + <%end%> + <%end%> + <%else%> + + <% if !answer.text.nil? then %> + <%= raw answer.text.gsub(/(\s||<\/td>| )*(<\/tr>|)/,"") %> + <%end%> + <% end %> + <% end %> +
+ <% end %> + <% end %> + + \ No newline at end of file