From 50a4f9834c83c2511b4b051593880782a6d6c4d6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 19 Apr 2021 11:37:55 +0200 Subject: [PATCH] Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds the ability to display the cover images of a bibliographic record in a gallery. Cover images attached to items can also be displayed in separated galleries. Test plan: All the cover images are affected, all the different sources will be tested. All the steps will be done on the same bibliographic record. 1. Local cover images a. Turn on LocalCoverImages and AllowMultipleCovers b. Add several local cover images to a bibliographic record c. Add several local cover images to an item d. Click on an image and confirm that it is displayed in a gallery and you can navigate see all the images attached to the bibliographic record e. Same for items 2. Adlibris a. Turn on AdlibrisCoversEnabled b. Edit the biliographic record and add an ISBN that will return a cover image for this service (9780670026623 for instance) c. Display the cover images in the gallery d. Note the link to the adlibris.com website at the bottom 3. Amazon a. Turn on AmazonCoverImages b. Display the cover images in the gallery 4. Coce a. Turn on IntranetCoce, set CoceHost to "http://coce.tamil.fr:8080" and select some values for CoceProviders. b. Display the cover images in the gallery 5. Custom cover images a. Turn on CustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg of anything else meaningful b. Display the cover images in the gallery Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) Signed-off-by: Owen Leonard Signed-off-by: Rasmus Leißner Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/js/coce.js | 3 +- .../prog/en/modules/catalogue/detail.tt | 55 +++++++++++++------ 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/js/coce.js b/koha-tmpl/intranet-tmpl/js/coce.js index 1fc2796ca9..a56ca61fef 100644 --- a/koha-tmpl/intranet-tmpl/js/coce.js +++ b/koha-tmpl/intranet-tmpl/js/coce.js @@ -39,7 +39,8 @@ KOHA.coce = { $(this).closest(".coce-coverimg").remove(); } }; - $(this).html(img); + $(this).attr('href', url); + $(this).append(img); }); } }, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index f20b08235b..f48febbe01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -43,6 +43,7 @@ [% END %] › Catalog › Koha [% INCLUDE 'doc-head-close.inc' %] +[% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %] @@ -196,8 +197,8 @@ [% IF localimages.count %] [% FOREACH image IN localimages %]
- - Local cover image + + Local cover image
Local cover image
@@ -207,8 +208,8 @@ [% IF ( AdlibrisEnabled && normalized_isbn ) %]
- - Adlibris cover image + + Adlibris cover image
Image from Adlibris
@@ -216,8 +217,8 @@ [% IF ( AmazonCoverImages && normalized_isbn) %]
- - Amazon cover image + + Amazon cover image
Image from Amazon.com
@@ -227,7 +228,7 @@ [% coce_id = normalized_ean || normalized_isbn %]
[% IF ( coce_id ) %] - + [% ELSE %] No cover image available [% END %] @@ -239,7 +240,7 @@ [% SET custom_cover_image_url = biblio.custom_cover_image_url %] [% IF custom_cover_image_url %]
- + Custom cover image
Custom cover image
@@ -353,7 +354,7 @@
[% FOREACH image IN item.cover_images %] @@ -1014,6 +1015,7 @@ Note that permanent location is a code, and location may be an authval. [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] [% Asset.js("js/coce.js") | $raw %] + [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]