Bugzilla – Attachment 5521 Details for
Bug 6901
Add CSS classes/ids to OPAC and staff XSLT views
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6901: Add classes to XSLT detail view in OPAC
Bug-6901-Add-classes-to-XSLT-detail-view-in-OPAC.patch (text/plain), 15.92 KB, created by
Katrin Fischer
on 2011-09-21 20:43:14 UTC
(
hide
)
Description:
Bug 6901: Add classes to XSLT detail view in OPAC
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-09-21 20:43:14 UTC
Size:
15.92 KB
patch
obsolete
>From 57338faae2050b7c2930f1eb30ec7ff32f19d3b0 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Wed, 21 Sep 2011 22:39:51 +0200 >Subject: [PATCH] Bug 6901: Add classes to XSLT detail view in OPAC >Content-Type: text/plain; charset="utf-8" > >This patch adds css classes to the fields in XSLT OPAC view so >you can use OpacUserCss system preference for formatting >and hiding fields. > >The css classes are named like the labels with additional underscores >where necessary. > >Example: >.publisher { >display:none; >} > >.other_title { >font-weight: bold; >} > >Note: Patch also moves some hard-coded CSS from Utils into the CSS file (only >apples for 880 fields) >--- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 10 +++- > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 54 ++++++++++---------- > .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 22 ++++---- > 3 files changed, 47 insertions(+), 39 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index 60afea7..09ed022 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -1275,6 +1275,14 @@ padding-left : .4em; > padding : 0 0 .5em 0; > } > >+.m880 { >+ display:block; >+ text-align:right; >+ float:right; >+ width:50%; >+ padding-left:20px >+} >+ > .searchresults .tagstatus { > display: block; > color: #707070; >@@ -2038,4 +2046,4 @@ div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; > > #renewall_link { > background-image : url(../../images/checks.png); >-} >\ No newline at end of file >+} >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index d4f763f..404293f 100755 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -187,7 +187,7 @@ > > <xsl:if test="$DisplayOPACiconsXSLT!='0'"> > <xsl:if test="$materialTypeCode!=''"> >- <span class="results_summary"><span class="label">Type: </span> >+ <span class="results_summary type"><span class="label">Type: </span> > <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element> > <xsl:value-of select="$materialTypeLabel"/> > </span> >@@ -199,7 +199,7 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">440,490</xsl:with-param> > <xsl:with-param name="codes">av</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >+ <xsl:with-param name="class">results_summary series</xsl:with-param> > <xsl:with-param name="label">Series: </xsl:with-param> > <xsl:with-param name="index">se</xsl:with-param> > </xsl:call-template> >@@ -207,7 +207,7 @@ > > <!-- Series --> > <xsl:if test="marc:datafield[@tag=440 or @tag=490]"> >- <span class="results_summary"><span class="label">Series: </span> >+ <span class="results_summary series"><span class="label">Series: </span> > <!-- 440 --> > <xsl:for-each select="marc:datafield[@tag=440]"> > <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}"> >@@ -275,7 +275,7 @@ > > <!-- Analytics --> > <xsl:if test="$leader7='s'"> >- <span class="results_summary"><span class="label">Analytics: </span> >+ <span class="results_summary analytics"><span class="label">Analytics: </span> > <a> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >@@ -292,7 +292,7 @@ > > <!-- Volumes of sets and traced series --> > <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'"> >- <span class="results_summary"><span class="label">Volumes: </span> >+ <span class="results_summary volumes"><span class="label">Volumes: </span> > <a> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >@@ -309,7 +309,7 @@ > > <!-- Set --> > <xsl:if test="$leader19='c'"> >- <span class="results_summary"><span class="label">Set: </span> >+ <span class="results_summary set"><span class="label">Set: </span> > <xsl:for-each select="marc:datafield[@tag=773]"> > <a> > <xsl:choose> >@@ -335,13 +335,13 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">260</xsl:with-param> > <xsl:with-param name="codes">abcg</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >+ <xsl:with-param name="class">results_summary publisher</xsl:with-param> > <xsl:with-param name="label">Publisher: </xsl:with-param> > </xsl:call-template> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=260]"> >- <span class="results_summary"><span class="label">Publisher: </span> >+ <span class="results_summary publisher"><span class="label">Publisher: </span> > <xsl:for-each select="marc:datafield[@tag=260]"> > <xsl:if test="marc:subfield[@code='a']"> > <xsl:call-template name="subfieldSelect"> >@@ -373,13 +373,13 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">250</xsl:with-param> > <xsl:with-param name="codes">ab</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >+ <xsl:with-param name="class">results_summary edition</xsl:with-param> > <xsl:with-param name="label">Edition: </xsl:with-param> > </xsl:call-template> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=250]"> >- <span class="results_summary"><span class="label">Edition: </span> >+ <span class="results_summary edition"><span class="label">Edition: </span> > <xsl:for-each select="marc:datafield[@tag=250]"> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >@@ -398,13 +398,13 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">300</xsl:with-param> > <xsl:with-param name="codes">abceg</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >+ <xsl:with-param name="class">results_summary description</xsl:with-param> > <xsl:with-param name="label">Description: </xsl:with-param> > </xsl:call-template> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=300]"> >- <span class="results_summary"><span class="label">Description: </span> >+ <span class="results_summary description"><span class="label">Description: </span> > <xsl:for-each select="marc:datafield[@tag=300]"> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >@@ -419,7 +419,7 @@ > </xsl:if> > > <xsl:if test="marc:datafield[@tag=020]"> >- <span class="results_summary"><span class="label">ISBN: </span> >+ <span class="results_summary isbn"><span class="label">ISBN: </span> > <xsl:for-each select="marc:datafield[@tag=020]"> > <xsl:variable name="isbn" select="marc:subfield[@code='a']"/> > <xsl:value-of select="marc:subfield[@code='a']"/> >@@ -429,7 +429,7 @@ > </xsl:if> > > <xsl:if test="marc:datafield[@tag=022]"> >- <span class="results_summary"><span class="label">ISSN: </span> >+ <span class="results_summary issn"><span class="label">ISSN: </span> > <xsl:for-each select="marc:datafield[@tag=022]"> > <xsl:value-of select="marc:subfield[@code='a']"/> > <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >@@ -442,13 +442,13 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">246</xsl:with-param> > <xsl:with-param name="codes">abhfgnp</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >+ <xsl:with-param name="class">results_summary other_title</xsl:with-param> > <xsl:with-param name="label">Other Title: </xsl:with-param> > </xsl:call-template> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=246]"> >- <span class="results_summary"><span class="label">Other Title: </span> >+ <span class="results_summary other_title"><span class="label">Other Title: </span> > <xsl:for-each select="marc:datafield[@tag=246]"> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >@@ -467,13 +467,13 @@ > <xsl:call-template name="m880Select"> > <xsl:with-param name="basetags">130,240</xsl:with-param> > <xsl:with-param name="codes">adfklmor</xsl:with-param> >- <xsl:with-param name="class">results_summary</xsl:with-param> >- <xsl:with-param name="label">Uniform Title: </xsl:with-param> >+ <xsl:with-param name="class">results_summary uniform_title</xsl:with-param> >+ <xsl:with-param name="label">Uniform titles: </xsl:with-param> > </xsl:call-template> > </xsl:if> > > <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> >- <span class="results_summary"><span class="label">Uniform titles: </span> >+ <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span> > <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> >@@ -495,7 +495,7 @@ > </xsl:if> > > <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']"> >- <span class="results_summary"><span class="label">Subject(s): </span> >+ <span class="results_summary subjects"><span class="label">Subject(s): </span> > <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']"> > <a> > <xsl:choose> >@@ -536,7 +536,7 @@ > > <!-- Image processing code added here, takes precedence over text links including y3z text --> > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary"><span class="label">Online Resources: </span> >+ <span class="results_summary online_resources"><span class="label">Online Resources: </span> > <xsl:for-each select="marc:datafield[@tag=856]"> > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> > <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >@@ -654,7 +654,7 @@ > <xsl:if test="marc:datafield[@tag=773]"> > <xsl:for-each select="marc:datafield[@tag=773]"> > <xsl:if test="@ind1=0"> >- <span class="results_summary"><span class="label"> >+ <span class="results_summary in"><span class="label"> > <xsl:choose> > <xsl:when test="@ind2=' '"> > In: >@@ -696,7 +696,7 @@ > </xsl:if> > > <xsl:for-each select="marc:datafield[@tag=520]"> >- <span class="results_summary"><span class="label"> >+ <span class="results_summary summary"><span class="label"> > <xsl:choose> > <xsl:when test="@ind1=0"><xsl:text>Subject: </xsl:text></xsl:when> > <xsl:when test="@ind1=1"><xsl:text>Review: </xsl:text></xsl:when> >@@ -714,7 +714,7 @@ > > <!-- 866 holdings public note --> > <xsl:if test="marc:datafield[@tag=866]"> >- <span class="results_summary"><span class="label">Holdings Note: </span> >+ <span class="results_summary holdings_note"><span class="label">Holdings Note: </span> > <xsl:for-each select="marc:datafield[@tag=866]"> > <xsl:value-of select="marc:subfield[@code='z']"/> > <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> >@@ -724,7 +724,7 @@ > > <!-- 775 Other Edition --> > <xsl:if test="marc:datafield[@tag=775]"> >- <span class="results_summary"><span class="label">Other Editions: </span> >+ <span class="results_summary other_editions"><span class="label">Other Editions: </span> > <xsl:for-each select="marc:datafield[@tag=775]"> > <xsl:if test="marc:subfield[@code='i']"> > <xsl:call-template name="subfieldSelect"> >@@ -757,7 +757,7 @@ > <xsl:if test="marc:datafield[@tag=780]"> > <xsl:for-each select="marc:datafield[@tag=780]"> > <xsl:if test="@ind1=0"> >- <span class="results_summary"> >+ <span class="results_summary preceeding_entry"> > <xsl:choose> > <xsl:when test="@ind2=0"> > <span class="label">Continues:</span> >@@ -815,7 +815,7 @@ > <xsl:if test="marc:datafield[@tag=785]"> > <xsl:for-each select="marc:datafield[@tag=785]"> > <xsl:if test="@ind1=0"> >- <span class="results_summary"> >+ <span class="results_summary succeeding_entry"> > <xsl:choose> > <xsl:when test="@ind2=0"> > <span class="label">Continued by:</span> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 4ffc031..27d0891 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -114,18 +114,18 @@ > <xsl:variable name="code6" select="marc:subfield[@code=6]"/> > <xsl:if test="contains(string($basetags), substring($code6,1,3))"> > <span> >- <xsl:if test="boolean($class)"> >- <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute> >- </xsl:if> > <xsl:choose> >- <!-- display right-to-left tags floating right of their left-to-right counterparts --> >- <xsl:when test="substring($code6,string-length($code6)-1,2) ='/r'"> >- <xsl:attribute name="style">display:block; text-align:right; float:right; width:50%; padding-left:20px</xsl:attribute> >- <xsl:attribute name="dir">rtl</xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="style">display:block; </xsl:attribute> >- </xsl:otherwise> >+ <xsl:when test="boolean($class) and substring($code6,string-length($code6)-1,2) ='/r'"> >+ <xsl:attribute name="class"><xsl:value-of select="$class"/> m880</xsl:attribute> >+ <xsl:attribute name="dir">rtl</xsl:attribute> >+ </xsl:when> >+ <xsl:when test="boolean($class)"> >+ <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute> >+ <xsl:attribute name="style">display:block; </xsl:attribute> >+ </xsl:when> >+ <xsl:when test="substring($code6,string-length($code6)-1,2) ='/r'"> >+ <xsl:attribute name="class"><xsl:value-of select="$class"/> m880</xsl:attribute> >+ </xsl:when> > </xsl:choose> > <xsl:if test="boolean($label)"> > <span class="label"> >-- >1.7.4.1
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 6901
:
5519
|
5520
|
5521
|
5522
|
5523