Skip to content

Commit

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

## Changelog

### 1.22.0

- Improved Authors of DMP

### 1.21.0

- Adjusted to template metamodel version 16 (released in DSW 4.13.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
45 changes: 38 additions & 7 deletions src/header.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,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 @@ -60,14 +64,41 @@
<dd>{{ km.entities.phases[ctx.phaseUuid].title }}</dd>
{%- endif -%}

{%- if ctx.questionnaire.createdBy -%}
{%- set nCreators = creators|length -%}
<dt>Created by</dt>
<dd>
<span class="contact-name">{{ ctx.questionnaire.createdBy.firstName }} {{ ctx.questionnaire.createdBy.lastName }}</span>
({{ macros.formatEmail(ctx.questionnaire.createdBy.email) }})
{% if ctx.questionnaire.createdBy.affiliation %}<br>{{ ctx.questionnaire.createdBy.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 ctx.questionnaire.versions if version.uuid == ctx.questionnaire.versionUuid %}
<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 @@
{
"organizationId": "dsw",
"templateId": "science-europe",
"version": "1.21.0",
"version": "1.22.0",
"name": "Science Europe DMP Template",
"description": "Default DCC DMP Template recommended by Science Europe",
"license": "Apache-2.0",
Expand Down

0 comments on commit 9aef253

Please sign in to comment.