Bug 15594: (QA follow-up) Move span to publisher name, fix whitespace, only add spaces once per loop

This patch updates the whitespace for readbility
Moves the Ogranization span to the subfield b, publisher name only
Moves check for last/whitespace to the loop

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2022-03-04 16:48:19 +00:00 committed by Fridolin Somers
parent 6c189d155e
commit 681d33aa2f
2 changed files with 62 additions and 74 deletions

View File

@ -284,42 +284,36 @@
<span class="results_summary publisher"><span class="label">Publication details: </span>
<xsl:for-each select="marc:datafield[@tag=260]">
<xsl:for-each select="marc:subfield">
<xsl:if test="@code='a'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=pl:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
<xsl:if test="@code='a'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=pl:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</xsl:if>
<xsl:if test="@code='b'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</xsl:if>
<xsl:if test="@code='c'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=copydate:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</xsl:if>
<xsl:if test="@code='g'">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="current()"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='b'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Provider:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='c'">
<a>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=copydate:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='g'">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="current()"/>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:for-each>
<xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
<xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
</span>
</xsl:when>

View File

@ -326,49 +326,43 @@
<span class="results_summary publisher"><span class="label">Publication details: </span>
<xsl:for-each select="marc:datafield[@tag=260]">
<xsl:for-each select="marc:subfield">
<xsl:if test="@code='a'">
<span property="publisher" typeof="Organization">
<span class="publisher_place" property="location">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=pl:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
<xsl:if test="@code='a'">
<span class="publisher_place" property="location">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=pl:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</span>
</xsl:if>
<xsl:if test="@code='b'">
<span property="publisher" typeof="Organization">
<span property="name" class="publisher_name">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</span>
</span>
</xsl:if>
<xsl:if test="@code='c'">
<span property="datePublished" class="publisher_date">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=copydate:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</span>
</xsl:if>
<xsl:if test="@code='g'">
<span property="datePublished" class="publisher_date">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="current()"/>
</xsl:with-param>
</xsl:call-template>
</span>
</span>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='b'">
<span property="name" class="publisher_name">
<a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Provider:<xsl:value-of select="str:encode-uri(current(), true())"/></xsl:attribute>
<xsl:value-of select="current()"/>
</a>
</span>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='c'">
<span property="datePublished" class="publisher_date">
<a>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=copydate:"<xsl:value-of select="str:encode-uri(current(), true())"/>"</xsl:attribute>
<xsl:value-of select="current()"/>
</a>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
</span>
<xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="@code='g'">
<span property="datePublished" class="publisher_date">
<xsl:call-template name="chopPunctuation">
<xsl:with-param name="chopString">
<xsl:value-of select="current()"/>
</xsl:with-param>
</xsl:call-template>
</span>
</xsl:if>
</xsl:if>
<xsl:if test="position() != last()">
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>