Skip to content

Commit

Permalink
Issue DMPRoadmap#2972 - Add project Start and End Dates, ID and Grant…
Browse files Browse the repository at this point in the history
… Numberto the Export Plan coversheet.

Changes proposed in this PR:

    The Start and End Dates, ID and Grant Number was added the Project
    Details section of the Export Plans.
  • Loading branch information
John Pinto committed Jul 26, 2021
1 parent 701c3a1 commit 16b8c5f
Showing 1 changed file with 38 additions and 19 deletions.
57 changes: 38 additions & 19 deletions app/views/shared/export/_plan_coversheet.erb
Original file line number Diff line number Diff line change
@@ -1,38 +1,57 @@
<hr />
<h1><%= @plan.title %></h1>
<p><em>
<%= _("A Data Management Plan created using ") + Rails.configuration.branding[:application][:name] %>
</em></p>
<p><em><%= _("A Data Management Plan created using %{application_name}") % { application_name: ApplicationService.application_name } %></em></p>
<br/>
<div class="cover-page">
<p><%= @hash[:attribution].length > 1 ? _("Creators: ") : _('Creator:') %> <%= @hash[:attribution].join(', ') %></p><br>
<%# 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><%= _("Affiliation: ") + @hash[:affiliation] %></p><br>
<p><b><%= _("Affiliation: ") %></b><%= @hash[:affiliation] %></p><br>

<% if @hash[:funder].present? %>
<p><%= _("Template: ") + @hash[:funder] %></p><br>
<% else %>
<p><%= _("Template: ") + @hash[:template] + @hash[:customizer] %></p><br>
<p><b><%= _("Funder: ") %></b><%= @hash[:funder] %></p><br>
<% end %>

<% if @plan.principal_investigator_identifier.present? %>
<p><%= _("ORCID iD: ") + @plan.principal_investigator_identifier %></p> <br>
<% end %>
<p><b><%= _("Template: ") %></b><%= @hash[:template] + @hash[:customizer] %></p><br>

<% if @plan.grant_number.present? %>
<p><%= _("Grant number: ") + @plan.grant_number %></p> <br>
<% @plan.contributors.investigation.each do |contributor| %>
<% orcid = contributor.identifier_for_scheme(scheme: "orcid") %>
<% next unless orcid.present? && orcid.value.present? %>

<p><b><%= _("ORCID iD: ") %></b><%= orcid.value_without_scheme_prefix %></p> <br>
<% end %>

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

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

<% if @plan.start_date.present? %>
<p><b><%= _("Start date: ") %></b><%= l(@plan.start_date.to_date, formats: :short) %></p> <br>
<% end %>

<% if @plan.end_date.present? %>
<p><b><%= _("End date: ") %></b><%= l(@plan.end_date.to_date, formats: :short) %></p> <br>
<% end %>

<p><%= _("Last modified: ") + l(@plan.updated_at.to_date, formats: :short) %></p> <br>
<p><b><%= _("Last modified: ") %></b><%= l(@plan.updated_at.to_date, formats: :short) %></p> <br>

<% if @plan.grant_number.present? %>
<p><b><%= _("Grant number / URL: ") %></b><%= @plan.grant_number %></p> <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>
<p><b><%= _("Copyright information:") %></b></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" />
<hr class="bottom" />

0 comments on commit 16b8c5f

Please # to comment.