Bug 6617: Improve MARC21 enhanced contents display
The display of "Enhanced" 505 (contents) fields in the MARC21 XSLT is very poor, resulting in large, unreadable blocks of text, and -- for some series -- so much unnecessary duplication in the Notes tab that important information is entirely obscured. This patch reformats "enhanced" contents fields (MARC21 505 fields with $t and $r) so as to be more readable by breaking up entries on separate lines and making titles bold (to make them stand out more). This patch does not address duplication of information in the Notes tab, per discussion on the #koha IRC channel. To test: 1) View record with enhanced 505 field before applying patch. Observe it is very unfriendly. 2) Apply patch. 3) View same record, note that display is much improved. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> This first patch works as advertised. It formats the table of contents on the opac detail display in a cleaner format. I recommend that future follow ups fix the staff client to match and update the title notes tabs on the opac and staff client to also match the cleaner format for table of contents. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
parent
f79b0bf480
commit
9f4df0d786
|
|
@ -2540,3 +2540,30 @@ span.sep {
|
|||
}
|
||||
|
||||
*/
|
||||
|
||||
.contents {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.contentblock {
|
||||
position: relative;
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
.contents .t:first-child:before {
|
||||
content: "→ ";
|
||||
}
|
||||
|
||||
.contents .t:before {
|
||||
content: "\A→ ";
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.contents .t {
|
||||
font-weight: bold;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.contents .r {
|
||||
display: inline;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -569,33 +569,37 @@
|
|||
|
||||
<!-- 505 -->
|
||||
<xsl:if test="marc:datafield[@tag=505]">
|
||||
<div class="results_summary contents">
|
||||
<xsl:for-each select="marc:datafield[@tag=505]">
|
||||
<span class="results_summary contents">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@ind1=1">
|
||||
<span class="label">Incomplete contents:</span>
|
||||
</xsl:when>
|
||||
<xsl:when test="@ind1=1">
|
||||
<span class="label">Partial contents:</span>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="label">Contents:</span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="position()=1">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@ind1=1">
|
||||
<span class="label">Incomplete contents:</span>
|
||||
</xsl:when>
|
||||
<xsl:when test="@ind1=1">
|
||||
<span class="label">Partial contents:</span>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span class="label">Contents:</span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
<div class='contentblock'>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@ind2=0">
|
||||
<xsl:call-template name="subfieldSelect">
|
||||
<xsl:call-template name="subfieldSelectSpan">
|
||||
<xsl:with-param name="codes">tru</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="subfieldSelect">
|
||||
<xsl:with-param name="codes">au</xsl:with-param>
|
||||
<xsl:call-template name="subfieldSelectSpan">
|
||||
<xsl:with-param name="codes">atru</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<!-- 583 -->
|
||||
|
|
|
|||
|
|
@ -40,6 +40,26 @@
|
|||
<xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="subfieldSelectSpan">
|
||||
<xsl:param name="codes"/>
|
||||
<xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param>
|
||||
<xsl:param name="subdivCodes"/>
|
||||
<xsl:param name="subdivDelimiter"/>
|
||||
<xsl:param name="prefix"/>
|
||||
<xsl:param name="suffix"/>
|
||||
<xsl:for-each select="marc:subfield">
|
||||
<xsl:if test="contains($codes, @code)">
|
||||
<span>
|
||||
<xsl:attribute name="class"><xsl:value-of select="@code"/></xsl:attribute>
|
||||
<xsl:if test="contains($subdivCodes, @code)">
|
||||
<xsl:value-of select="$subdivDelimiter"/>
|
||||
</xsl:if>
|
||||
<xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:if test="position()!=last()"><xsl:value-of select="$delimeter"/></xsl:if>
|
||||
</span>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="buildSpaces">
|
||||
<xsl:param name="spaces"/>
|
||||
<xsl:param name="char"><xsl:text> </xsl:text></xsl:param>
|
||||
|
|
|
|||
Loading…
Reference in New Issue