Bugzilla – Attachment 172262 Details for
Bug 36375
Inconsistencies in ContentWarningField display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36375: Fix inconsistencies in content warning display
Bug-36375-Fix-inconsistencies-in-content-warning-d.patch (text/plain), 15.79 KB, created by
Martin Renvoize (ashimema)
on 2024-10-01 12:49:03 UTC
(
hide
)
Description:
Bug 36375: Fix inconsistencies in content warning display
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-01 12:49:03 UTC
Size:
15.79 KB
patch
obsolete
>From f84581befe7cbdbda8d9bd3647962f858cfbe054 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 1 Oct 2024 13:33:57 +0100 >Subject: [PATCH] Bug 36375: Fix inconsistencies in content warning display > >As suggested by Fridolin, we move the display into a template to improve >consistency and maintanence and whilst doing this we also pick the >suggested subfield selection. >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 35 ++---------------- > .../en/xslt/MARC21slim2intranetResults.xsl | 35 ++---------------- > .../prog/en/xslt/MARC21slimUtils.xsl | 36 +++++++++++++++++++ > .../en/xslt/MARC21slim2OPACDetail.xsl | 35 ++---------------- > .../en/xslt/MARC21slim2OPACResults.xsl | 35 ++---------------- > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 36 +++++++++++++++++++ > 6 files changed, 84 insertions(+), 128 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 1f255b10f14..7080456e095 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -1114,38 +1114,9 @@ > > <!-- Content Warning --> > <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/> >- <xsl:if test="marc:datafield[@tag=$ContentWarningField]"> >- <span class="results_summary content_warning"> >- <span class="label">Content warning: </span> >- <xsl:for-each select="marc:datafield[@tag=$ContentWarningField]"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='u']"> >- <a> >- <xsl:attribute name="href"> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:otherwise> >- </xsl:choose> >- </a> >- <xsl:text> </xsl:text> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >- </xsl:when> >- </xsl:choose> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">bcdefghijklmnopqrstvwxyz</xsl:with-param> >- </xsl:call-template> >- <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >- </xsl:for-each> >- </span> >- </xsl:if> >+ <xsl:call-template name="content-warning"> >+ <xsl:with-param name="tag" select="$ContentWarningField" /> >+ </xsl:call-template> > > <!-- 866 textual holdings --> > <xsl:if test="marc:datafield[@tag=866]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index e40e94a4358..58faae0eacb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -1024,38 +1024,9 @@ > > <!-- Content Warning --> > <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/> >- <xsl:if test="marc:datafield[@tag=$ContentWarningField]"> >- <span class="results_summary content_warning"> >- <span class="label">Content warning: </span> >- <xsl:for-each select="marc:datafield[@tag=$ContentWarningField]"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='u']"> >- <a> >- <xsl:attribute name="href"> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:otherwise> >- </xsl:choose> >- </a> >- <xsl:text> </xsl:text> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >- </xsl:when> >- </xsl:choose> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param> >- </xsl:call-template> >- <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >- </xsl:for-each> >- </span> >- </xsl:if> >+ <xsl:call-template name="content-warning"> >+ <xsl:with-param name="tag" select="$ContentWarningField" /> >+ </xsl:call-template> > > <!-- Indicate if record is suppressed in OPAC --> > <xsl:if test="$OpacSuppression = 1"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 45e0ee2252e..cbc6fc603fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -691,6 +691,42 @@ > </xsl:if> > </xsl:template> > >+ <xsl:template name="content-warning"> >+ <xsl:param name="tag" /> >+ <xsl:if test="marc:datafield[@tag=$tag]"> >+ <span class="results_summary content_warning"> >+ <span class="label">Content warning: </span> >+ <xsl:for-each select="marc:datafield[@tag=$tag]"> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='u']"> >+ <a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='a']"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a> >+ <xsl:text> </xsl:text> >+ </xsl:when> >+ <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >+ <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >+ </xsl:when> >+ </xsl:choose> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">bcdefghijklmnopqrstvwxyz</xsl:with-param> >+ </xsl:call-template> >+ <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >+ </xsl:for-each> >+ </span> >+ </xsl:if> >+ </xsl:template> >+ > <xsl:template name="AddMissingProtocol"> > <xsl:param name="resourceLocation"/> > <xsl:param name="indicator1"/> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 80886efec06..9c61e678982 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1322,38 +1322,9 @@ > > <!-- Content Warning --> > <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/> >- <xsl:if test="marc:datafield[@tag=$ContentWarningField]"> >- <span class="results_summary content_warning"> >- <span class="label">Content warning: </span> >- <xsl:for-each select="marc:datafield[@tag=$ContentWarningField]"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='u']"> >- <a> >- <xsl:attribute name="href"> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:otherwise> >- </xsl:choose> >- </a> >- <xsl:text> </xsl:text> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >- </xsl:when> >- </xsl:choose> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">bcdefghijklmnopqrstvwyz</xsl:with-param> >- </xsl:call-template> >- <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >- </xsl:for-each> >- </span> >- </xsl:if> >+ <xsl:call-template name="content-warning"> >+ <xsl:with-param name="tag" select="$ContentWarningField" /> >+ </xsl:call-template> > > <!-- 866 textual holdings --> > <xsl:if test="marc:datafield[@tag=866]"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 02e89e64733..17676f19a50 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1182,38 +1182,9 @@ > > <!-- Content Warning --> > <xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/> >- <xsl:if test="marc:datafield[@tag=$ContentWarningField]"> >- <span class="results_summary content_warning"> >- <span class="label">Content warning: </span> >- <xsl:for-each select="marc:datafield[@tag=$ContentWarningField]"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='u']"> >- <a> >- <xsl:attribute name="href"> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:otherwise> >- </xsl:choose> >- </a> >- <xsl:text> </xsl:text> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >- <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >- </xsl:when> >- </xsl:choose> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">bcdefghijklmnopqrstvwyz</xsl:with-param> >- </xsl:call-template> >- <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >- </xsl:for-each> >- </span> >- </xsl:if> >+ <xsl:call-template name="content-warning"> >+ <xsl:with-param name="tag" select="$ContentWarningField" /> >+ </xsl:call-template> > > <xsl:if test="marc:datafield[@tag=856]"> > <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index 9d35b9f94ae..eb8760d98b4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -655,6 +655,42 @@ > </xsl:if> > </xsl:template> > >+ <xsl:template name="content-warning"> >+ <xsl:param name="tag" /> >+ <xsl:if test="marc:datafield[@tag=$tag]"> >+ <span class="results_summary content_warning"> >+ <span class="label">Content warning: </span> >+ <xsl:for-each select="marc:datafield[@tag=$tag]"> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='u']"> >+ <a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='a']"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a> >+ <xsl:text> </xsl:text> >+ </xsl:when> >+ <xsl:when test="not(marc:subfield[@code='u']) and marc:subfield[@code='a']"> >+ <xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text> >+ </xsl:when> >+ </xsl:choose> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">bcdefghijklmnopqrstvwyz</xsl:with-param> >+ </xsl:call-template> >+ <xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if> >+ </xsl:for-each> >+ </span> >+ </xsl:if> >+ </xsl:template> >+ > <xsl:template name="AddMissingProtocol"> > <xsl:param name="resourceLocation"/> > <xsl:param name="indicator1"/> >-- >2.46.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36375
:
172261
|
172262
|
172284
|
172516