Bugzilla – Attachment 11316 Details for
Bug 6617
table of contents not printing right if entered right
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6617: Improve MARC21 enhanced contents display
Bug-6617-Improve-MARC21-enhanced-contents-display.patch (text/plain), 5.57 KB, created by
Jared Camins-Esakov
on 2012-08-02 19:10:21 UTC
(
hide
)
Description:
Bug 6617: Improve MARC21 enhanced contents display
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-08-02 19:10:21 UTC
Size:
5.57 KB
patch
obsolete
>From edf5c4a36e8a452a1539a70a5996028b4c63b88d Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sat, 28 Jul 2012 22:58:31 -0400 >Subject: [PATCH] Bug 6617: Improve MARC21 enhanced contents display >Content-Type: text/plain; charset="UTF-8" > >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. >--- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 25 ++++++++++++++ > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 34 +++++++++++--------- > .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 20 +++++++++++ > 3 files changed, 64 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index 1e259fb..97bc296 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2620,3 +2620,28 @@ ul.ui-tabs-nav li { > box-shadow: 1px 1px 3px 0 #666; > } > >+.contents { >+ width: 75%; >+} >+ >+.contentblock { >+ display: inline-block; >+} >+ >+.contents .t:first-child { >+ white-space: normal; >+} >+ >+.contents .t:before { >+ content: "\AĆ¢ "; >+ white-space: pre; >+} >+ >+.contents .t { >+ font-weight: bold; >+ display: inline; >+} >+ >+.contents .r { >+ display: inline; >+} >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index b6db8b4..f612989 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -570,33 +570,37 @@ > > <!-- 505 --> > <xsl:if test="marc:datafield[@tag=505]"> >- <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:for-each select="marc:datafield[@tag=505]"> >+ <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> >+ <span 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> > </xsl:for-each> >+ </span> > </xsl:if> > > <!-- 583 --> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index c39ca39..806f8a8 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -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> >-- >1.7.2.5
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 6617
:
4682
|
4683
|
4684
|
4685
|
11211
|
11308
|
11309
|
11310
|
11311
|
11313
|
11314
|
11315
|
11316
|
11317
|
11318
|
11326
|
11356
|
11357
|
11368
|
11614
|
11615
|
11796
|
11964