Bugzilla – Attachment 112866 Details for
Bug 26148
OpenLibrary "Preview" link target is unclear to patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26148: OpenLibrary "Preview" link target is unclear to patrons
Bug-26148-OpenLibrary-Preview-link-target-is-uncle.patch (text/plain), 7.93 KB, created by
Owen Leonard
on 2020-11-02 19:35:17 UTC
(
hide
)
Description:
Bug 26148: OpenLibrary "Preview" link target is unclear to patrons
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-11-02 19:35:17 UTC
Size:
7.93 KB
patch
obsolete
>From f7926629d6e9b803ed92211f2eb14a8c1cbf9bf7 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 2 Nov 2020 18:13:04 +0000 >Subject: [PATCH] Bug 26148: OpenLibrary "Preview" link target is unclear to > patrons > >This patch makes changes to the display of the Open Library "read" links >in the OPAC search results and detail page. The link is now grouped with >other details about the record ("Publisher," "Location(s)," etc. On the >detail page, the "Preview" link will no longer appear under the cover >image. > >The label is changed to "Found in Open Library," and the link now opens >the Open Library reader in a new window. > >The patch also changes the Open Library button image links so that they >use https and makes it so that the "Found in Open Library" information >is hidden until the availability information has loaded. > >To test, apply the patch and enable the OpenLibrarySearch system >preference. > > - Perform a search in the OPAC which will return results found in Open > Library, e.g. "poetry" in the sample data. > - Confirm that the "Read now" images from Open Library appear on some > search results. > - View the detail page for one of these titles. > - Confirm that the "Read now" button appears in the same format on the > detail page. >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 1 - > .../opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 5 +++-- > koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js | 13 +++++++------ > 5 files changed, 14 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 1641593395..03372af8d1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -207,7 +207,6 @@ $.widget.bridge('uitooltip', $.ui.tooltip); > [% END %] > [% IF OpenLibraryCovers || OpenLibrarySearch %] > var NO_OL_JACKET = _("No cover image available"); >- var OL_PREVIEW = _("Preview"); > [% END %] > [% IF (query_desc) %] > var query_desc = "[% query_desc | html %]"; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc >index d7fee6c3f6..3b4c74811e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/openlibrary-readapi.inc >@@ -1,4 +1,4 @@ > [%# Input params: bib - search result biblio record %] > [% IF OpenLibrarySearch && ( bib.normalized_isbn || bib.lccn || bib.normalized_oclc ) %] >- <div class="ol_readapi_book" isbn="[% bib.normalized_isbn | html %]" lccn="[% bib.lccn | html %]" oclc="[% bib.normalized_oclc | html %]">Open Library: </div> >+ <div class="results_summary ol_readapi_book" isbn="[% bib.normalized_isbn | html %]" lccn="[% bib.lccn | html %]" oclc="[% bib.normalized_oclc | html %]" style="display:none"><span class="label">Found in Open Library:</span> </div> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index a88a7caf0b..4e0d27de9e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -418,6 +418,9 @@ > [% END # / IF SyndeticsAwards && SyndeticsAWARDS1Exists %] > [% END # / IF SyndeticsEnabled%] > >+ [%# Following on one line due to translation issues %] >+ [% INCLUDE "openlibrary-readapi.inc" bib = { normalized_isbn => normalized_isbn,lccn => lccn, normalized_oclc => normalized_oclc } %] >+ > [% IF ( OpacStarRatings != 'disable' ) %] > <form method="post" action="/cgi-bin/koha/opac-ratings.pl"> > <div class="results_summary ratings"> >@@ -1043,9 +1046,6 @@ > </div> > [% END # / IF Babeltheque %] > >- [%# Following on one line due to translation issues %] >- [% INCLUDE "openlibrary-readapi.inc" bib = { normalized_isbn => normalized_isbn,lccn => lccn, normalized_oclc => normalized_oclc } %] >- > </div> <!-- /.col-lg-10 --> > > <div class="col-lg-3"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index b8d86ee9a7..206f360412 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -547,6 +547,8 @@ > </span> > [% END %] > >+ [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %] >+ > [% IF ( OpacStarRatings == 'all' ) %] > <div class="results_summary ratings"> > [% SET rating_avg = SEARCH_RESULT.ratings.get_avg_rating() %] >@@ -573,10 +575,9 @@ > </div> <!-- / .results_summary --> > [% END # / IF OpacStarRatings %] > >- [% INCLUDE 'title-actions-menu.inc' items=SEARCH_RESULT %] >+ [% INCLUDE 'title-actions-menu.inc' items=SEARCH_RESULT %] > > </div> >- [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %] > > </td> > </tr> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >index afd6e4c77a..9ca62cb17b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js >@@ -48,7 +48,6 @@ KOHA.OpenLibrary = new function() { > if (is_opacdetail) { > img.src = book.cover.medium; > $(this).empty().append(img); >- $(this).append('<div class="results_summary">' + '<a href="' + book.url + '">' + OL_PREVIEW + '</a></div>'); > } else { > img.src = book.cover.medium; > img.height = '110'; >@@ -150,11 +149,11 @@ function create_query() { > function make_read_button(bookdata) { > buttons = { > 'full access': >- "http://openlibrary.org/images/button-read-open-library.png", >+ "https://openlibrary.org/images/button-read-open-library.png", > 'lendable': >- "http://openlibrary.org/images/button-borrow-open-library.png", >+ "https://openlibrary.org/images/button-borrow-open-library.png", > 'checked out': >- "http://openlibrary.org/images/button-checked-out-open-library.png" >+ "https://openlibrary.org/images/button-checked-out-open-library.png" > }; > if (bookdata.items.length == 0) { > return false; >@@ -163,9 +162,10 @@ function make_read_button(bookdata) { > if (!(first.status in buttons)) { > return false; > } >- result = '<a href="' + first.itemURL + '">' + >+ result = '<a target="_blank" href="' + first.itemURL + '">' + > '<img class="' + ol_button_classname + > '" src="' + buttons[first.status] + '"/></a>'; >+ console.log( result ); > return result; > } > >@@ -179,8 +179,9 @@ function default_decorate_el_fn(el, bookdata) { > } > if (decoration) { > el.innerHTML += decoration; >+ el.style.display = 'block' > } else { >- el.style.visibility = 'hidden'; >+ el.style.display = 'none'; > } > } > >-- >2.11.0
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 26148
:
112866
|
112869
|
112952