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.
Signed-off-by: Hannah Prince <hannah.prince@uhb.nhs.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit e086d2f81d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
671a8b4534
commit
26e3f78225
|
|
@ -1112,38 +1112,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]">
|
||||
|
|
|
|||
|
|
@ -1022,38 +1022,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">
|
||||
|
|
|
|||
|
|
@ -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"/>
|
||||
|
|
|
|||
|
|
@ -1320,38 +1320,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]">
|
||||
|
|
|
|||
|
|
@ -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]">
|
||||
<div class="results_summary online_resources">
|
||||
|
|
|
|||
|
|
@ -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"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue