Skip to content

Commit

Permalink
Improved Authors of the DMP (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinkova authored Jan 27, 2025
1 parent 86cc8a5 commit ffed534
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ This document template for DSW is available as open-source via GitHub Repository

## Changelog

### 1.19.0

- Improved Authors of the DMP

### 1.18.0

- Adjusted to template metamodel version 16 (released in DSW 4.12.0)
Expand Down
2 changes: 1 addition & 1 deletion src/contributors.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<ul>
{% for contributor in contributors %}
<li class="contributor">
<span class="name">{{ contributor.name }}</span>
<span class="name"><strong>{{ contributor.name }}</strong></span>
{%- if contributor.email and contributor.orcid %}
<br>{{ macros.formatEmail(contributor.email) }}, {{ macros.formatOrcid(contributor.orcid) }}
{%- elif contributor.email %}
Expand Down
40 changes: 37 additions & 3 deletions src/frontpage.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
{%- set contributorsItems = repliesMap[contributorsPath]|reply_items -%}
{%- if contributorsItems|length > 0 -%}
{%- set contacts = [] -%}
{%- set creators = [] -%}
{%- for i in contributorsItems -%}
{%- set pathPrefix = [contributorsPath, i]|join(".") ~ "." -%}
{%- set contributorRoles = repliesMap[pathPrefix ~ uuids.contributorRoleQUuid]|reply_items -%}
{%- if uuids.contributorRoleContactPersonAUuid in contributorRoles -%}
{% do contacts.append(pathPrefix) %}
{%- endif -%}
{%- if uuids.contributorRoleCreatorOfDMP in contributorRoles -%}
{% do creators.append(pathPrefix) %}
{%- endif -%}
{%- endfor -%}
{%- set nContacts = contacts|length -%}
<dt>Contact {{ "people" if (nContacts > 1) else "person" }}</dt>
Expand Down Expand Up @@ -63,10 +67,40 @@
<dd>{{ dc.current_phase.title }}</dd>
{%- endif -%}

{%- if dc.qtn.created_by -%}
{%- set nCreators = creators|length -%}
<dt>Created by</dt>
<dd><span class="contact-name">{{ dc.qtn.created_by.first_name }} {{ dc.qtn.created_by.last_name }}</span> ({{ macros.formatEmail(dc.qtn.created_by.email) }}){% if dc.qtn.created_by.affiliation %}<br>{{ dc.qtn.created_by.affiliation }}{% endif %}</dd>
{%- endif -%}
<dd>
{%- if nCreators > 0 -%}
<ul>
{%- for pathPrefix in creators -%}
<li>
{%- set creatorName = repliesMap[pathPrefix ~ uuids.contributorNameQUuid]|reply_str_value -%}
{%- set creatorEmail = repliesMap[pathPrefix ~ uuids.contributorEmailQUuid]|reply_str_value -%}
{%- set creatorOrcid = repliesMap[pathPrefix ~ uuids.contributorOrcidQUuid]|reply_str_value -%}
{%- set creatorAffiliationReply = repliesMap[pathPrefix ~ uuids.contributorAffiliationQUuid] -%}

{%- if creatorName -%}
<span class="contact-name">{{ creatorName }}</span>
{%- else -%}
<span class="contact-name missing">(name not given)</span>
{%- endif -%}
{%- if creatorEmail and creatorOrcid -%}
<br>{{ macros.formatEmail(creatorEmail) }}, {{ macros.formatOrcid(creatorOrcid) }}
{%- elif creatorEmail -%}
<br>{{ macros.formatEmail(creatorEmail) }}
{%- elif creatorOrcid -%}
<br>{{ macros.formatOrcid(creatorOrcid) }}
{%- endif -%}
{%- if creatorAffiliationReply -%}
<br>{{ macros.integrationValue(creatorAffiliationReply) }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- else -%}
<span class="empty-value">There is no creator specified yet</span>
{%- endif -%}
</dd>

{% for version in dc.qtn.versions if version.uuid == dc.qtn.version %}
<dt>Version</dt>
Expand Down
2 changes: 1 addition & 1 deletion src/macros.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{%- macro integrationValue(reply) -%}
{%- if reply and reply.value.value.type == "IntegrationType" -%}
{{ reply.value.value.value.rsplit(" ![]")[0]|markdown }}
{{ reply.value.value.value.rsplit(" ![]")[0]|markdown|replace("<p>", "")|replace("</p>", "") }}
{%- elif reply %}
{{ reply.value.value.value }}
{%- endif -%}
Expand Down
12 changes: 12 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ dl .contact-name {
font-weight: bold;
}

/* Contributors */

.contributor .name {
font-weight: bold;
}

.contributor .role,
.contributor .affiliation {
font-style: italic;
display: inline-block;
}

/* Abstract */

.abstract {
Expand Down
1 change: 1 addition & 0 deletions src/uuids.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
{%- set contributorRoleDataStewardAUuid = "3022098b-0e2c-4fad-9f28-cf2e1325521d" -%}
{%- set contributorRoleDistributorAUuid = "27dccf06-3b67-4c75-8888-6549e4da2d31" -%}
{%- set contributorRoleDataProtectorAUuid = "bc82b138-9816-46dd-8ff8-cea2826a3ad4" -%}
{%- set contributorRoleCreatorOfDMP = "21047dec-71ee-40e4-868a-3ed75a027ff6" -%}
{%- set additionalExpertiseQUuid = "83c0d09d-e74c-4c81-a52c-aaa2e18415ac" -%}
{%- set additionalExpertiseNoAUuid = "ccdadd45-8aa9-44ed-a669-1827c7813b0a" -%}
{%- set additionalExpertiseYesAvailableAUuid = "8993a53e-f7e0-4a16-a240-b8e0835e86b2" -%}
Expand Down
2 changes: 1 addition & 1 deletion template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"templateId": "h2020-dmp",
"organizationId": "dsw",
"version": "1.18.0",
"version": "1.19.0",
"name": "Horizon 2020 DMP",
"description": "Data Management Plan according to the H2020 template",
"license": "Apache-2.0",
Expand Down

0 comments on commit ffed534

Please sign in to comment.