<hr />
<h1><%= @plan.title %></h1>
<p><em><%= _("A Data Management Plan created using ") + Rails.configuration.branding[:application][:name] %></em></p>
<br/>
<div class="cover-page">
  <%# Using <b> tags as the htmltoword gem does not recognise css styles defined %>
  <%# Allow raw html (==) for plan_attribution as it has <b> tags %>
  <p><%== plan_attribution(@hash[:attribution]) %></p><br>

  <p><b><%= d_("dmpopidor", "Principal Investigator Affiliation: ") %></b><%= @hash[:affiliation] %></p><br>
  
  <% if @hash[:customizer].present? %>
    <p><b><%= d_("dmpopidor", "DMP Template: ") %></b><%= @hash[:template] + @hash[:customizer] %></p><br>
  <% else %>
    <p><b><%= d_("dmpopidor", "DMP Template: ") %></b><%= @hash[:template] %></p><br>
  <% end %>
  
  <p><b><%= d_("dmpopidor", "Last modified: ") %></b><%=  l(@plan.updated_at.to_date, formats: :short) %></p> <br>
  
  <% if @plan.funder_name.present? %>
    <p><b><%= d_("dmpopidor", "Funder: ") %></b><%=  @plan.funder_name %></p> <br>
  <% end %>

  <% if @plan.grant_number.present? %>
    <p><b><%= _("Grant number: ") %></b><%= @plan.grant_number %></p> <br>
  <% end %>

  <% if @plan.description.present? %>
    <p><b><%= _("Project abstract: ") %></b></p>
    <div style="margin-left: 15px;"><%= sanitize(@plan.description) %></div><br>
  <% end %>

  <% if @plan.principal_investigator.present? %>
    <p><b><%= d_("dmpopidor", "Principal Investigator: ") %></b><%= @plan.principal_investigator %></p> <br>
  <% end %>

  <% if @plan.principal_investigator_identifier.present? %>
    <p><b><%= _("ORCID iD: ") %></b><%= @plan.principal_investigator_identifier %></p> <br>
  <% end %>

  <% if @plan.data_contact.present? %>
    <p><b><%= d_("dmpopidor", "Data Contact Person: ") %></b><%= @plan.data_contact %></p> <br>
  <% elsif @plan.principal_investigator.present? %>
    <p><b><%= d_("dmpopidor", "Data Contact Person: ") %></b><%= @plan.principal_investigator %></p> <br>
  <% end %>

  <% if @hash[:research_outputs].length > 1 || !@hash[:research_outputs][0].main?%>
    <p><b><%= d_('dmpopidor', "Research outputs") %> : </b></p>
    <ol>
      <% @hash[:research_outputs].each do |research_output| %>
        <li>
        <%= research_output.fullname %> ( <%= 
          research_output.type && research_output.type.is_other  ? 
          d_('dmpopidor', 'Other: ') + research_output.other_type_label :
          research_output.type.label
        %> )</li>
      <% end %>
    </ol>
    <br>
  <% end %>


  <% if @public_plan %>
    <p><%= _("Copyright information:") %></p>
    <div style="margin-left: 15px;">
      <p>
        <%= _(" The above plan creator(s) have agreed that others may use as much of the text of this plan as they would like in their own plans, and customise it as necessary. You do not need to credit the creator(s) as the source of the language used, but using any of the plan's text does not imply that the creator(s) endorse, or have any relationship to, your project or proposal") %>
      </p>
    </div>
  <% end %>
</div>
<hr class="bottom" />
