Newer
Older
dmpopidor / app / views / public_pages / template_export.docx.erb
<div style="text-align:center;">
  <h1><%= @template.title %></h1>
  <p><em><%= _("A Data Management Plan created using ") + Rails.configuration.branding[:application][:name] + "." %></em></p>
</div>
<p><%= _("Organisation: ") + @template.org.name %></p> <br>
<% if @template.description.present? %>
  <p><%= _("Description: ")%><%= raw(@template.description)  %></p> <br>
<% end %>
<br style="page-break-before: always">

<% @template.phases.each do |phase| %>
  <!-- page break before each phase -->
  <br style="page-break-before: always">
  <h2><%= phase.title %></h2>
  <% phase.sections.each do |section| %>
    <h3><%= section.title %></h3>
    <% section.questions.each do |question|%>
      <p><%= raw question.text %></p>
      <% q_format = question.question_format %>
      <% if q_format.option_based? %>
        <ul>
          <% question.question_options.each do |option| %>
            <li><%= option.text %></li>
          <% end %>
        </ul>
      <% end %>
      <br>
    <% end %>
  <% end %>
<% end %>