Bugzilla – Attachment 145771 Details for
Bug 26765
Make author span a clickable link on OPAC results list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26765: Make author span a clickable link on OPAC results list
Bug-26765-Make-author-span-a-clickable-link-on-OPA.patch (text/plain), 15.52 KB, created by
Owen Leonard
on 2023-01-27 19:08:39 UTC
(
hide
)
Description:
Bug 26765: Make author span a clickable link on OPAC results list
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-01-27 19:08:39 UTC
Size:
15.52 KB
patch
obsolete
>From 9bb163f311de2670cf8bd4982617678607abb51b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 27 Jan 2023 18:53:39 +0000 >Subject: [PATCH] Bug 26765: Make author span a clickable link on OPAC results > list > >This patch follows the markup of the staff interface catalog results >XSLT to make authors in OPAC search results clickable. > >The patch also makes some minor CSS changes so that title and author >links are not too crowded together. > >To test, apply the patch and rebuild the OPAC CSS. > >- Perform a catalog search in the OPAC which will return multiple > results. >- In the search results, each author in each search result should be a > separate clickable link. >- The margins around the result title and authors should be > comfortable. >- Confirm that each link takes you to the correct author search. >--- > .../opac-tmpl/bootstrap/css/src/opac.scss | 6 + > .../en/xslt/MARC21slim2OPACResults.xsl | 202 +++++++++--------- > 2 files changed, 112 insertions(+), 96 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 8af3afa2ed..a927bff544 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -87,6 +87,7 @@ a { > display: block; > font-size: 108%; > font-weight: bold; >+ margin-bottom: .3rem; > } > > &.login-link { >@@ -329,6 +330,11 @@ th { > } > } > >+.byAuthor { >+ display: inline-block; >+ margin: .2rem .2rem .2rem 0; >+} >+ > #members { > p { > color: #727272; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index bccaaeec6b..abcdffc8d0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -517,97 +517,121 @@ > <xsl:choose> > <xsl:when test="marc:datafield[@tag=100] or marc:datafield[@tag=110] or marc:datafield[@tag=111] or marc:datafield[@tag=700] or marc:datafield[@tag=710] or marc:datafield[@tag=711]"> > >- <span class="byAuthor">by </span> >+ <span class="byAuthor">by</span><xsl:text> </xsl:text> > <ul class="author resource_list"> > <!-- #13383 --> > <xsl:for-each select="marc:datafield[(@tag=100 or @tag=700 or @tag=110 or @tag=710 or @tag=111 or @tag=711) and @ind1!='z']"> > <li> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes"> >- <xsl:choose> >- <!-- #13383 include subfield e for field 111 --> >- <xsl:when test="@tag=111 or @tag=711">aeq</xsl:when> >- <xsl:when test="@tag=110 or @tag=710">ab</xsl:when> >- <xsl:otherwise>abcjq</xsl:otherwise> >- </xsl:choose> >- </xsl:with-param> >- </xsl:call-template> >- </xsl:with-param> >- <xsl:with-param name="punctuation"> >- <xsl:text>:,;/ </xsl:text> >- </xsl:with-param> >- </xsl:call-template> >- <!-- Display title portion for 110 and 710 fields --> >- <xsl:if test="(@tag=110 or @tag=710) and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])"> >- <span class="titleportion"> >- <xsl:choose> >- <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise> >- </xsl:choose> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">cdnt</xsl:with-param> >- </xsl:call-template> >- </xsl:with-param> >- </xsl:call-template> >- </span> >- </xsl:if> >- <!-- Display title portion for 111 and 711 fields --> >- <xsl:if test="(@tag=111 or @tag=711) and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])"> >- <span class="titleportion"> >+ <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ </xsl:otherwise> > </xsl:choose> >- > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">cdgnt</xsl:with-param> >- </xsl:call-template> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes"> >+ <xsl:choose> >+ <!-- #13383 include subfield e for field 111 --> >+ <xsl:when test="@tag=111 or @tag=711">aeq</xsl:when> >+ <xsl:when test="@tag=110 or @tag=710">ab</xsl:when> >+ <xsl:otherwise>abcjq</xsl:otherwise> >+ </xsl:choose> >+ </xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ <xsl:with-param name="punctuation"> >+ <xsl:text>:,;/ </xsl:text> > </xsl:with-param> > </xsl:call-template> >- </span> >- </xsl:if> >- <!-- Display dates for 100 and 700 fields --> >- <xsl:if test="(@tag=100 or @tag=700) and marc:subfield[@code='d']"> >- <span class="authordates"> >- <xsl:text>, </xsl:text> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">d</xsl:with-param> >+ <!-- Display title portion for 110 and 710 fields --> >+ <xsl:if test="(@tag=110 or @tag=710) and boolean(marc:subfield[@code='c' or @code='d' or @code='n' or @code='t'])"> >+ <span class="titleportion"> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when> >+ <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise> >+ </xsl:choose> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">cdnt</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> > </xsl:call-template> >- </xsl:with-param> >- </xsl:call-template> >- </span> >- </xsl:if> >- <!-- Display title portion for 100 and 700 fields --> >- <xsl:if test="@tag=700 and marc:subfield[@code='t']"> >- <span class="titleportion"> >- <xsl:text>. </xsl:text> >- <xsl:call-template name="chopPunctuation"> >- <xsl:with-param name="chopString"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">t</xsl:with-param> >+ </span> >+ </xsl:if> >+ <!-- Display title portion for 111 and 711 fields --> >+ <xsl:if test="(@tag=111 or @tag=711) and boolean(marc:subfield[@code='c' or @code='d' or @code='g' or @code='n' or @code='t'])"> >+ <span class="titleportion"> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='c' or @code='d' or @code='g' or @code='n'][not(marc:subfield[@code='t'])]"><xsl:text> </xsl:text></xsl:when> >+ <xsl:otherwise><xsl:text>. </xsl:text></xsl:otherwise> >+ </xsl:choose> >+ >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">cdgnt</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </span> >+ </xsl:if> >+ <!-- Display dates for 100 and 700 fields --> >+ <xsl:if test="(@tag=100 or @tag=700) and marc:subfield[@code='d']"> >+ <span class="authordates"> >+ <xsl:text>, </xsl:text> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">d</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> > </xsl:call-template> >- </xsl:with-param> >- </xsl:call-template> >- </span> >- </xsl:if> >- <!-- Display relators for 1XX and 7XX fields --> >- <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])"> >- <span class="relatorcode"> >- <xsl:text> [</xsl:text> >- <xsl:choose> >- <xsl:when test="@tag=111 or @tag=711"> >+ </span> >+ </xsl:if> >+ <!-- Display title portion for 100 and 700 fields --> >+ <xsl:if test="@tag=700 and marc:subfield[@code='t']"> >+ <span class="titleportion"> >+ <xsl:text>. </xsl:text> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </span> >+ </xsl:if> >+ <!-- Display relators for 1XX and 7XX fields --> >+ <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])"> >+ <span class="relatorcode"> >+ <xsl:text> [</xsl:text> > <xsl:choose> >- <!-- Prefer j over 4 for 111 and 711 --> >- <xsl:when test="marc:subfield[@code='j']"> >- <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:when test="@tag=111 or @tag=711"> >+ <xsl:choose> >+ <!-- Prefer j over 4 for 111 and 711 --> >+ <xsl:when test="marc:subfield[@code='j']"> >+ <xsl:for-each select="marc:subfield[@code='j']"> >+ <xsl:value-of select="."/> >+ <xsl:if test="position() != last()">, </xsl:if> >+ </xsl:for-each> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:for-each select="marc:subfield[@code=4]"> >+ <xsl:value-of select="."/> >+ <xsl:if test="position() != last()">, </xsl:if> >+ </xsl:for-each> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:when> >+ <!-- Prefer e over 4 on 100 and 110 --> >+ <xsl:when test="marc:subfield[@code='e']"> >+ <xsl:for-each select="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]"> > <xsl:value-of select="."/> > <xsl:if test="position() != last()">, </xsl:if> > </xsl:for-each> >@@ -619,24 +643,10 @@ > </xsl:for-each> > </xsl:otherwise> > </xsl:choose> >- </xsl:when> >- <!-- Prefer e over 4 on 100 and 110 --> >- <xsl:when test="marc:subfield[@code='e']"> >- <xsl:for-each select="marc:subfield[@code='e'][not(@tag=111) or not(@tag=711)]"> >- <xsl:value-of select="."/> >- <xsl:if test="position() != last()">, </xsl:if> >- </xsl:for-each> >- </xsl:when> >- <xsl:otherwise> >- <xsl:for-each select="marc:subfield[@code=4]"> >- <xsl:value-of select="."/> >- <xsl:if test="position() != last()">, </xsl:if> >- </xsl:for-each> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:text>]</xsl:text> >- </span> >- </xsl:if> >+ <xsl:text>]</xsl:text> >+ </span> >+ </xsl:if> >+ </a> > </li> > </xsl:for-each> > </ul> >-- >2.20.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 26765
:
112103
|
112579
|
145771
|
145772
|
146212