Bug 36837: Simplify XSLT and aid translatability
This patch makes the XSLT contain HTML tags instead of building them
from scratch with static attribute values. This made it awkward for
translators as CSS classes ended up being extracted for translation
purposes. Plus, there's no need to spend CPU cycles on static content
generation.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 48e39c1e5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
5e405a29a8
commit
22ff328708
|
|
@ -10,188 +10,114 @@
|
|||
<xsl:variable name="authid" select="marc:controlfield[@tag='001']" />
|
||||
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
|
||||
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authority-summary</xsl:text>
|
||||
</xsl:attribute>
|
||||
|
||||
<div class="authority-summary">
|
||||
<!-- *********** Personal Name 100 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='100']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="data-authid"><xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='100']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
</span>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag='400']">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>seefrom</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
used for/see from:
|
||||
</xsl:element>
|
||||
|
||||
<div class="seefrom">
|
||||
<span>used for/see from:</span>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</xsl:element>
|
||||
</div> <!-- /div.seefrom -->
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag='500'] or marc:datafield[@tag='550']">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>seealso</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
see also:
|
||||
</xsl:element>
|
||||
|
||||
<div class="seealso">
|
||||
<span>see also:</span>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="marc:datafield[@tag=550]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</div> <!-- /div.seealso -->
|
||||
</xsl:if> <!-- test="marc:datafield[@tag='500'] or marc:datafield[@tag='550']" -->
|
||||
</xsl:if> <!-- test="marc:datafield[@tag='100']" -->
|
||||
<!-- *** End Personal Name **-->
|
||||
|
||||
<!-- *********** Corporate Name 110 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='110']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='110']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
|
||||
</span>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag='410']">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>seefrom</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
used for/see from:
|
||||
</xsl:element>
|
||||
<div class="seefrom">
|
||||
<span>used for/see from:</span>
|
||||
|
||||
<xsl:for-each select="marc:datafield[@tag=410]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
</xsl:element>
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag='500'] or marc:datafield[@tag='550']">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>seealso</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
see also:
|
||||
</xsl:element>
|
||||
<div class="seealso">
|
||||
<span>see also:</span>
|
||||
|
||||
<xsl:for-each select="marc:datafield[@tag=500]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
|
||||
<xsl:for-each select="marc:datafield[@tag=550]">
|
||||
<xsl:element name="div">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authref</xsl:text>
|
||||
</xsl:attribute>
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>heading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<div class="authref">
|
||||
<span class="heading">
|
||||
<xsl:if test="marc:subfield[@code='a']"><xsl:value-of select="marc:subfield[@code='a']"/> </xsl:if>
|
||||
<xsl:if test="marc:subfield[@code='b']"><xsl:value-of select="marc:subfield[@code='b']"/></xsl:if>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
</span>
|
||||
</div>
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:element>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:if>
|
||||
</div>
|
||||
</xsl:if> <!-- test="marc:datafield[@tag='500'] or marc:datafield[@tag='550']" -->
|
||||
</xsl:if> <!-- test="marc:datafield[@tag='110']" -->
|
||||
<!-- *** End Corporate Name **-->
|
||||
|
||||
<!-- *********** Meeting Name 111 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='111']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='111']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
</span>
|
||||
|
||||
<ul>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
|
|
@ -205,15 +131,12 @@
|
|||
|
||||
<!-- *********** Uniform Title 130 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='130']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='130']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
</span>
|
||||
<ul>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
<li class="heading">
|
||||
|
|
@ -226,15 +149,12 @@
|
|||
|
||||
<!-- *********** Topical Term 150 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='150']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='150']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
</span>
|
||||
<ul>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
<li class="heading">
|
||||
|
|
@ -247,15 +167,12 @@
|
|||
|
||||
<!-- *********** Geographic Name 151 ********* -->
|
||||
<xsl:if test="marc:datafield[@tag='151']">
|
||||
<xsl:element name="span">
|
||||
<xsl:attribute name="class">
|
||||
<xsl:text>authorizedheading</xsl:text>
|
||||
</xsl:attribute>
|
||||
<span class="authorizedheading">
|
||||
<a>
|
||||
<xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="$authid"/></xsl:attribute>
|
||||
<xsl:value-of select="marc:datafield[@tag='151']/marc:subfield[@code='a']"/>
|
||||
</a>
|
||||
</xsl:element>
|
||||
</span>
|
||||
<ul>
|
||||
<xsl:for-each select="marc:datafield[@tag=400]">
|
||||
<li class="heading">
|
||||
|
|
@ -265,7 +182,6 @@
|
|||
</ul>
|
||||
</xsl:if>
|
||||
<!-- *** End Geographic Name **-->
|
||||
|
||||
</xsl:element>
|
||||
</div> <!-- /.authority-summary -->
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
|
|
|||
Loading…
Reference in New Issue