Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bed26db3b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 58c24ea165)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Katrin Fischer 2023-07-03 16:19:28 +00:00 committed by Matt Blenkinsop
parent d23c69d5f3
commit 0e821acf2a
2 changed files with 81 additions and 15 deletions

View File

@ -1061,6 +1061,63 @@
</span>
</xsl:if>
<!-- 530 -->
<xsl:if test="marc:datafield[@tag=530]">
<span class="results_summary additionalforms">
<span class="label">Available additional physical forms:</span>
<xsl:for-each select="marc:datafield[@tag=530]">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcd</xsl:with-param>
</xsl:call-template>
<xsl:if test="marc:subfield[@code='u']">
<xsl:for-each select="marc:subfield[@code='u']">
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
<xsl:value-of select="text()"/>
</a>
</xsl:for-each>
</xsl:if>
<xsl:if test="position()!=last()"><span class="separator"><xsl:text> | </xsl:text></span></xsl:if>
</xsl:for-each>
</span>
</xsl:if>
<!-- 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>
<!-- 866 textual holdings -->
<xsl:if test="marc:datafield[@tag=866]">
<span class="results_summary holdings_note basic_bibliographic_unit"><span class="label">Holdings: </span>

View File

@ -1138,21 +1138,30 @@
<!-- 530 -->
<xsl:if test="marc:datafield[@tag=530]">
<xsl:for-each select="marc:datafield[@tag=530]">
<span class="results_summary additionalforms">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcd</xsl:with-param>
</xsl:call-template>
<xsl:for-each select="marc:subfield[@code='u']">
<a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
<xsl:if test="$OPACURLOpenInNewWindow='1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="text()"/>
</a>
</xsl:for-each>
</span>
</xsl:for-each>
<span class="results_summary additionalforms">
<span class="label">Available additional physical forms:</span>
<ul class="resource_list">
<xsl:for-each select="marc:datafield[@tag=530]">
<li>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">abcd</xsl:with-param>
</xsl:call-template>
<xsl:if test="marc:subfield[@code='u']">
<xsl:for-each select="marc:subfield[@code='u']">
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
<xsl:if test="$OPACURLOpenInNewWindow='1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:value-of select="text()"/>
</a>
</xsl:for-each>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</span>
</xsl:if>
<!-- 505 - Formatted contents note -->