From 8dfd733ca07a24f40e4a38d31eb7f3868fb41212 Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:24:33 +0300 Subject: [PATCH 1/2] Credit Roles --- dbscripts/xml/upgrade.xml | 1 + pages/preprint/PreprintHandler.php | 5 +++++ .../default/styles/objects/preprint_details.less | 6 ++++++ templates/frontend/objects/preprint_details.tpl | 16 ++++++++++++++++ 4 files changed, 28 insertions(+) diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 8e338aaa9f..a8bae64193 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -168,6 +168,7 @@ + diff --git a/pages/preprint/PreprintHandler.php b/pages/preprint/PreprintHandler.php index 422c5eed53..a52e555b85 100644 --- a/pages/preprint/PreprintHandler.php +++ b/pages/preprint/PreprintHandler.php @@ -271,6 +271,11 @@ public function view($args, $request) 'parsedCitations' => $publication->getData('citations'), ]); + // Credit Role Terms + $templateMgr->assign([ + 'creditRoleTerms' => Repo::CreditRole()->getTerms(), + ]); + // Assign deprecated values to the template manager for // compatibility with older themes $templateMgr->assign([ diff --git a/plugins/themes/default/styles/objects/preprint_details.less b/plugins/themes/default/styles/objects/preprint_details.less index ae1533d13a..83e0f0da3b 100755 --- a/plugins/themes/default/styles/objects/preprint_details.less +++ b/plugins/themes/default/styles/objects/preprint_details.less @@ -107,6 +107,12 @@ vertical-align: middle; } } + + .credit_roles { + display: block; + font-size: @font-sml; + line-height: @double; + } } .author_bios { diff --git a/templates/frontend/objects/preprint_details.tpl b/templates/frontend/objects/preprint_details.tpl index 706f560c58..d0dbb359ff 100644 --- a/templates/frontend/objects/preprint_details.tpl +++ b/templates/frontend/objects/preprint_details.tpl @@ -64,6 +64,7 @@ * @uses $licenseUrl string URL to license. Only assigned if license should be * included with published submissions. * @uses $ccLicenseBadge string An image and text with details about the license + * @uses $creditRoleTerms Array of translated credit role terms: roles and degrees *}
@@ -151,6 +152,21 @@ {/if} + {if $author->getData('creditRoles')} + + {strip} + {foreach $author->getData('creditRoles') as $credit} + + {$creditRoleTerms.roles[$credit.role]|escape} + {if $creditRoleTerms.degrees[$credit.degree]} +  ({$creditRoleTerms.degrees[$credit.degree]|escape}) + {/if} + + {if !$credit@last}{translate key="common.commaListSeparator"}{/if} + {/foreach} + {/strip} + + {/if} {/foreach} From 1e155b82857b4e8046a078f8e679527a601d9916 Mon Sep 17 00:00:00 2001 From: jyhein <124268211+jyhein@users.noreply.github.com> Date: Tue, 8 Jul 2025 14:26:06 +0300 Subject: [PATCH 2/2] Submodule update ##jyhein/f857_credit## --- lib/pkp | 2 +- lib/ui-library | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pkp b/lib/pkp index d40ab58d3b..2be77f2f00 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit d40ab58d3bb25240acbac0d7c3dd058e705fa5fb +Subproject commit 2be77f2f00c066ffc96e8d45f394f79535da334d diff --git a/lib/ui-library b/lib/ui-library index 77c0c66190..6179eefb98 160000 --- a/lib/ui-library +++ b/lib/ui-library @@ -1 +1 @@ -Subproject commit 77c0c661905ec978972390022b9c195fd958899b +Subproject commit 6179eefb98bddd827db5aa604ac46bbd01f00892