Bug 20347: Add missing classes to search results elements
authorPasi Kallinen <pasi.kallinen@joensuu.fi>
Wed, 7 Mar 2018 07:35:19 +0000 (09:35 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 19 Mar 2018 16:55:54 +0000 (13:55 -0300)
The MARC21 XSLT doesn't add html classes to distinguish between
certain elements, and there's no way to rely on the element
positioning, making it impossible to style the elements with CSS.

Add the missing classes to distinguish the elements.

Test plan:
1) Apply patch
2) Search for any biblios
3) Check the search result page table HTML to see that the
   "Publisher", "Edition", "Source", "Other title", and "Online access"
   are wrapped in a span with class of results_summary and one
   of "publisher", "edition", "source", "other_title", and
   "online_access"
4) Check that the search results of the elements above looks correct
   when compared to the other elements

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>

Signed-off-by: Sebastian Hierl <s.hierl@aarome.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl

index 0e8ebd6..3e508c0 100644 (file)
       <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>
 
     <xsl:if test="marc:datafield[@tag=250]">
-    <span class="results_summary">
+    <span class="results_summary edition">
     <span class="label">Edition: </span>
             <xsl:for-each select="marc:datafield[@tag=250]">
                     <xsl:call-template name="subfieldSelect">
     <xsl:if test="marc:datafield[@tag=773]">
         <xsl:for-each select="marc:datafield[@tag=773]">
             <xsl:if test="marc:subfield[@code='t']">
-    <span class="results_summary">
+    <span class="results_summary source">
     <span class="label">Source: </span>
             <xsl:value-of select="marc:subfield[@code='t']"/>
     </span>
        <xsl:call-template name="m880Select">
          <xsl:with-param name="basetags">246</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 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="results_summary other_title">
     <span class="label">Other title: </span>
             <xsl:for-each select="marc:datafield[@tag=246]">
                     <xsl:call-template name="subfieldSelect">
        </span>
     </xsl:if>
     <xsl:if test="marc:datafield[@tag=856]">
-         <span class="results_summary">
+         <span class="results_summary online_access">
                           <span class="label">Online access: </span>
                             <xsl:for-each select="marc:datafield[@tag=856]">
                             <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable>