From 76c5960d7fc8689d581f689e635956610a2cc041 Mon Sep 17 00:00:00 2001 From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Date: Mon, 2 May 2022 11:23:05 +0200 Subject: [PATCH] Bug 29897: Move the identifier list to an include file Sponsored-by: Orex Digital --- .../en/includes/authority-identifiers.inc | 18 ++++++++++++++ .../bootstrap/en/modules/opac-auth-detail.tt | 19 +-------------- .../bootstrap/en/modules/opac-detail.tt | 24 +------------------ 3 files changed, 20 insertions(+), 41 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-identifiers.inc diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-identifiers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-identifiers.inc new file mode 100644 index 00000000000..726e736c50b --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authority-identifiers.inc @@ -0,0 +1,18 @@ +[% SWITCH identifier.source.lower %] +[% CASE 'orcid' %] + <span>ORCID: </span> + <a href="https://orcid.org/[% identifier.number | url %]">[% identifier.number | html %]</a> +[% CASE 'scopus' %] + <span>ScopusID: </span> + <a href="https://www.scopus.com/authid/detail.uri?authorId=[% identifier.number | url %]">[% identifier.number | html %]</a> +[% CASE 'loop' %] + <span>loop: </span> + <a href="https://loop.frontiersin.org/people/[% identifier.number | url %]">[% identifier.number | html %]</a> +[% CASE 'rid' %] + <span>Publons: </span> + <a href="https://publons.com/researcher/[% identifier.number | url %]">[% identifier.number | html %]</a> +[% CASE 'viaf' %] + <span>VIAF: </span> + <a href="https://viaf.org/viaf/[% identifier.number | url %]">[% identifier.number | html %]</a> +[% CASE %][% identifier.source | html %]: [% identifier.number | html %] +[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt index 6d38f7ce3d8..36a53eeda29 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt @@ -187,24 +187,7 @@ <ul> [% FOR identifier IN author_identifiers %] <li> - [% SWITCH identifier.source.lower %] - [% CASE 'orcid' %] - ORCID: - <a href="https://orcid.org/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'scopus' %] - ScopusID: - <a href="https://www.scopus.com/authid/detail.uri?authorId=[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'loop' %] - loop: - <a href="https://loop.frontiersin.org/people/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'rid' %] - Publons: - <a href="https://publons.com/researcher/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'viaf' %] - VIAF: - <a href="https://viaf.org/viaf/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE %][% identifier.source | html %]: [% identifier.number | html %] - [% END %] + [% PROCESS "authority-identifiers.inc" identifier => identifier %] </li> [% END %] </ul> diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 5d658721477..8fd8edd6a3d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -966,29 +966,7 @@ <ul> [% FOR identifier IN author.identifiers %] <li> - [% SWITCH identifier.source.lower %] - [% CASE 'orcid' %] - ORCID: - <a href="https://orcid.org/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'scopus' %] - ScopusID: - <a href="https://www.scopus.com/authid/detail.uri?authorId=[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'loop' %] - loop: - <a href="https://loop.frontiersin.org/people/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'rid' %] - Publons: - <a href="https://publons.com/researcher/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE 'viaf' %] - VIAF: - <a href="https://viaf.org/viaf/[% identifier.number | url %]">[% identifier.number | html %]</a> - [% CASE %][% identifier.source | html %]: [% identifier.number | html %] - [% END %] - [% IF identifier.linkage %] - <a href="[% identifier.linkage | url %]">[% identifier.number | html %]</a> - [% ELSE %] - [% identifier.number | html %] - [% END %] + [% PROCESS "authority-identifiers.inc" identifier => identifier %] </li> [% END %] </ul> -- 2.25.1