From 9aef25380a7e70539ed218f067416fec4ab68746 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jana=20Mart=C3=ADnkov=C3=A1?=
<83722371+jmartinkova@users.noreply.github.com>
Date: Mon, 27 Jan 2025 19:08:22 +0100
Subject: [PATCH] Improved Authors of the DMP (#12)
---
README.md | 4 ++++
src/contributors.html.j2 | 2 +-
src/header.html.j2 | 45 +++++++++++++++++++++++++++++++++-------
src/macros.html.j2 | 2 +-
src/style.css | 12 +++++++++++
src/uuids.j2 | 1 +
template.json | 2 +-
7 files changed, 58 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 1d2a0c5..d2c35db 100644
--- a/README.md
+++ b/README.md
@@ -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)
diff --git a/src/contributors.html.j2 b/src/contributors.html.j2
index 1fd71d9..1f3ec60 100644
--- a/src/contributors.html.j2
+++ b/src/contributors.html.j2
@@ -34,7 +34,7 @@
{% for contributor in contributors %}
-
- {{ contributor.name }}
+ {{ contributor.name }}
{%- if contributor.email and contributor.orcid %}
{{ macros.formatEmail(contributor.email) }}, {{ macros.formatOrcid(contributor.orcid) }}
{%- elif contributor.email %}
diff --git a/src/header.html.j2 b/src/header.html.j2
index 2463384..02b7b0d 100644
--- a/src/header.html.j2
+++ b/src/header.html.j2
@@ -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 -%}
- Contact {{ "people" if (nContacts > 1) else "person" }}
@@ -60,14 +64,41 @@
- {{ km.entities.phases[ctx.phaseUuid].title }}
{%- endif -%}
- {%- if ctx.questionnaire.createdBy -%}
+ {%- set nCreators = creators|length -%}
- Created by
- -
- {{ ctx.questionnaire.createdBy.firstName }} {{ ctx.questionnaire.createdBy.lastName }}
- ({{ macros.formatEmail(ctx.questionnaire.createdBy.email) }})
- {% if ctx.questionnaire.createdBy.affiliation %}
{{ ctx.questionnaire.createdBy.affiliation }}{% endif %}
-
- {%- endif -%}
+ -
+ {%- if nCreators > 0 -%}
+
+ {%- for pathPrefix in creators -%}
+ -
+ {%- 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 -%}
+ {{ creatorName }}
+ {%- else -%}
+ (name not given)
+ {%- endif -%}
+ {%- if creatorEmail and creatorOrcid -%}
+
{{ macros.formatEmail(creatorEmail) }}, {{ macros.formatOrcid(creatorOrcid) }}
+ {%- elif creatorEmail -%}
+
{{ macros.formatEmail(creatorEmail) }}
+ {%- elif creatorOrcid -%}
+
{{ macros.formatOrcid(creatorOrcid) }}
+ {%- endif -%}
+ {%- if creatorAffiliationReply -%}
+
{{ macros.integrationValue(creatorAffiliationReply) }}
+ {%- endif -%}
+
+ {%- endfor -%}
+
+ {%- else -%}
+ There is no creator specified yet
+ {%- endif -%}
+
+
{% for version in ctx.questionnaire.versions if version.uuid == ctx.questionnaire.versionUuid %}
- Version
diff --git a/src/macros.html.j2 b/src/macros.html.j2
index d43fb1c..9a6545d 100644
--- a/src/macros.html.j2
+++ b/src/macros.html.j2
@@ -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("", "")|replace("
", "") }}
{%- elif reply -%}
{{ reply.value.value.value }}
{%- endif -%}
diff --git a/src/style.css b/src/style.css
index 4dcc0a1..e7befe1 100644
--- a/src/style.css
+++ b/src/style.css
@@ -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 {
diff --git a/src/uuids.j2 b/src/uuids.j2
index 3e4f743..a45806a 100644
--- a/src/uuids.j2
+++ b/src/uuids.j2
@@ -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" -%}
diff --git a/template.json b/template.json
index afa92e0..a2fbc88 100644
--- a/template.json
+++ b/template.json
@@ -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",