From 2d73ceb9134d99fbc47288c7f6584f64eb5366d8 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 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) --- 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 90000082c5..ffe22bc574 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -40,6 +40,7 @@ [% END %] [% INCLUDE 'doc-head-close.inc' %] +[% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %] @@ -193,8 +194,8 @@ [% IF localimages.count %] [% FOREACH image IN localimages %]
- - Local cover image + + Local cover image
Local cover image
@@ -204,8 +205,8 @@ [% IF ( AdlibrisEnabled && normalized_isbn ) %]
- - Adlibris cover image + + Adlibris cover image
Image from Adlibris
@@ -213,8 +214,8 @@ [% IF ( AmazonCoverImages && normalized_isbn) %]
- - Amazon cover image + + Amazon cover image
Image from Amazon.com
@@ -224,7 +225,7 @@ [% coce_id = normalized_ean || normalized_isbn %]
[% IF ( coce_id ) %] - + [% ELSE %] No cover image available [% END %] @@ -236,7 +237,7 @@ [% SET custom_cover_image_url = biblio.custom_cover_image_url %] [% IF custom_cover_image_url %]
- + Custom cover image
Custom cover image
@@ -350,7 +351,7 @@
[% FOREACH image IN item.cover_images %] @@ -1011,6 +1012,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 %]