[Koha-patches] [PATCH] Bug 9169 - Wrap relator code in <span> to allow for CSS customization

Owen Leonard oleonard at myacpl.org
Thu Nov 29 17:59:05 CET 2012


This patch adds <span class="relatorcode"> around the display of
relator codes in the OPAC and the staff client, and adds a space
before the bracket (" [relatorcode]") for readability.

To test, add custom CSS to OPACUserCSS and IntranetUserCSS and
view a record which includes relator code data. Suggested:

.relatorcode {
    background-color: rgb(230, 240, 242);
    border-radius: 3px 3px 3px 3px;
    color: rgb(51, 51, 51);
    display: inline-block;
    font-size: 75%;
    font-weight: normal;
    margin-left: 0.4em;
    padding: 0.1em 0.4em;
}
---
 .../prog/en/xslt/MARC21slim2intranetDetail.xsl     |    4 +++-
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
index ea36118..cee6bd8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
@@ -916,12 +916,14 @@
 	</xsl:choose>
 	<!-- add relator code too between brackets-->
 	<xsl:if test="marc:subfield[@code='4' or @code='e']">
-	  <xsl:text>[</xsl:text>
+      <span class="relatorcode">
+      <xsl:text> [</xsl:text>
 	  <xsl:choose>
 	    <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
 	    <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
 	  </xsl:choose>
 	  <xsl:text>]</xsl:text>
+      </span>
 	</xsl:if>
 	</a>
         <xsl:choose>
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
index 64afc0b..0f12ade 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
@@ -910,12 +910,14 @@
                 </xsl:choose>
                 <!-- add relator code too between brackets-->
                 <xsl:if test="marc:subfield[@code='4' or @code='e']">
-                    <xsl:text>[</xsl:text>
+                    <span class="relatorcode">
+                    <xsl:text> [</xsl:text>
                     <xsl:choose>
                         <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
                         <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
                     </xsl:choose>
                     <xsl:text>]</xsl:text>
+                    </span>
                 </xsl:if>
             </a>
             <xsl:if test="marc:subfield[@code=9]">
-- 
1.7.9.5


More information about the Koha-patches mailing list