Bugzilla – Attachment 127542 Details for
Bug 27613
Pipe separated contents are hard to customize (OPAC)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27613: Change pipe seperated online resource links to psuedo elements
Bug-27613-Change-pipe-seperated-online-resource-li.patch (text/plain), 11.99 KB, created by
Martin Renvoize (ashimema)
on 2021-11-11 15:07:03 UTC
(
hide
)
Description:
Bug 27613: Change pipe seperated online resource links to psuedo elements
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-11-11 15:07:03 UTC
Size:
11.99 KB
patch
obsolete
>From 9f27c9eb0409aecec6ea99837966e29922056ffb Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 4 Feb 2021 00:27:11 +0000 >Subject: [PATCH] Bug 27613: Change pipe seperated online resource links to > psuedo elements > >To test: >1. Have a record with many 856 links >2. Look at the links on both the results and detail pages. >3. Look at the '|' and notice it is outside any HTML element, making it > hard to remove. >4. Apply the patch and regenerate the CSS >5. Look at both the pages again and notice that the '|' is now a psuedo > element. >6. It should look identical to the way it did without the patch >7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure > the the links look and function right still. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../opac-tmpl/bootstrap/css/src/opac.scss | 25 +++++ > .../en/xslt/MARC21slim2OPACDetail.xsl | 102 +++++++++--------- > .../en/xslt/MARC21slim2OPACResults.xsl | 14 ++- > 3 files changed, 81 insertions(+), 60 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 2f48d69f60..c505ad8749 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -1148,6 +1148,31 @@ div { > } > } > >+.online_resources { >+ ul { >+ display: inline-block; >+ margin: 0 auto; >+ padding-left: 0; >+ } >+ >+ li { >+ display: inline-block; >+ white-space: nowrap; >+ >+ &::after { >+ content: " | "; >+ } >+ >+ &:last-child { >+ &::after { >+ content: ""; >+ } >+ } >+ >+ } >+ >+} >+ > #views { > margin-bottom: .5em; > padding: 0 2em .2em .2em; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index a7dd374ae5..be0f96cde1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -994,60 +994,58 @@ > <!-- Image processing code added here, takes precedence over text links including y3z text --> > <xsl:if test="marc:datafield[@tag=856]"> > <span class="results_summary online_resources"><span class="label">Online resources: </span> >- <xsl:for-each select="marc:datafield[@tag=856]"> >- <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <a property="url"> >- <xsl:choose> >- <xsl:when test="$OPACTrackClicks='track'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:when test="$OPACTrackClicks='anonymous'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="href"> >- <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >- <xsl:choose> >- <xsl:when test="@ind1=7"> >- <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> >- </xsl:when> >- <xsl:when test="@ind1=1"> >- <xsl:text>ftp://</xsl:text> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text>http://</xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:if> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:if test="$OPACURLOpenInNewWindow='1'"> >- <xsl:attribute name="target">_blank</xsl:attribute> >- </xsl:if> >+ <ul> >+ <xsl:for-each select="marc:datafield[@tag=856]"> >+ <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >+ <li><a property="url"> > <xsl:choose> >- <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >- <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text> >- </xsl:when> >- <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">y3z</xsl:with-param> >- </xsl:call-template> >- </xsl:when> >- <xsl:when test="$URLLinkText!=''"> >- <xsl:value-of select="$URLLinkText"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text>Click here to access online</xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </a> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >+ <xsl:when test="$OPACTrackClicks='track'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:when test="$OPACTrackClicks='anonymous'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:choose> >+ <xsl:when test="@ind1=7"> >+ <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=1"> >+ <xsl:text>ftp://</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>http://</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:if> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ </xsl:otherwise> > </xsl:choose> >- </xsl:for-each> >+ <xsl:if test="$OPACURLOpenInNewWindow='1'"> >+ <xsl:attribute name="target">_blank</xsl:attribute> >+ </xsl:if> >+ <xsl:choose> >+ <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="style">height:100px</xsl:attribute></xsl:element><xsl:text></xsl:text> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">y3z</xsl:with-param> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="$URLLinkText!=''"> >+ <xsl:value-of select="$URLLinkText"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a></li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 40e73b4f22..1b220dbac9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1153,10 +1153,11 @@ > <xsl:if test="marc:datafield[@tag=856]"> > <span class="results_summary online_resources"> > <span class="label">Online access: </span> >+ <ul> > <xsl:for-each select="marc:datafield[@tag=856]"> > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> > <xsl:if test="$OPACURLOpenInNewWindow='0'"> >- <a> >+ <li><a> > <xsl:choose> > <xsl:when test="$OPACTrackClicks='track'"> > <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >@@ -1203,10 +1204,10 @@ > </xsl:choose> > </xsl:when> > </xsl:choose> >- </a> >+ </a></li> > </xsl:if> > <xsl:if test="$OPACURLOpenInNewWindow='1'"> >- <a target='_blank'> >+ <li><a target='_blank'> > <xsl:choose> > <xsl:when test="$OPACTrackClicks='track'"> > <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >@@ -1238,13 +1239,10 @@ > </xsl:choose> > </xsl:when> > </xsl:choose> >- </a> >+ </a></li> > </xsl:if> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >- </xsl:choose> > </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >-- >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 27613
:
116298
|
116328
|
125742
|
127453
|
127454
|
127542
|
127543
|
128425
|
129051
|
129052
|
129053
|
130973
|
130974
|
130975
|
130977
|
130978
|
130979