Bug 25846

Summary: Improve handling of multiple covers on catalog search results in the staff client
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, david, dcook, fridolin.somers, jonathan.druart+koha
Version: masterKeywords: Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Text to go in the release notes:
This enhancement updates the staff interface catalog search results to improve the display of multiple covers associated with each search result: - Adlibris - Amazon - Google - OpenLibrary - Local cover images (including multiple local cover images) - Coce (serving up Amazon, Google, and OpenLibrary images) - Images from the CustomCoverImages preference A single cover is now displayed for each result, with controls for scrolling through any other available cover.
Version(s) released in:
21.05.00
Bug Depends on: 25031    
Bug Blocks:    
Attachments: Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client
Bug 25846: (follow-up) Show "No cover image available" message

Description Owen Leonard 2020-06-22 19:41:57 UTC
Similar to Bug 25031, I'd like to add better handling of multiple cover images to catalog search results in the staff client.
Comment 1 Owen Leonard 2020-07-07 19:17:20 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2020-09-29 14:18:43 UTC
Ah nice.

Sorry patch does not apply :

error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss).
error: could not build fake ancestor
Comment 3 Owen Leonard 2020-10-06 11:40:31 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2020-11-04 17:05:22 UTC Comment hidden (obsolete)
Comment 5 David Nind 2020-11-05 00:45:45 UTC
Created attachment 113027 [details] [review]
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client

This patch modifies the template, JS, and CSS for the staff
interface catalog search results in order to gracefully handle multiple
cover images.

The changed version loops through any cover images which might be
embedded and checks that they are successfully loaded. Only
successfully-loaded images are shown. Only the first image is shown, and
the others can be "paged through" using generated navigation controls.

To test, apply the page and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Enable multiple cover image services. The patch was developed with these
services available:

 - Amazon
 - Local cover images (including multiple local cover images)
 - Coce (serving up Amazon, Google, and OpenLibrary images)
 - Images from the CustomCoverImages preference

Perform a variet of searches and confirm that cover images are
displaying correctly, whether there be 0, 1, 2, or more covers
available for each.

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2020-11-05 00:52:47 UTC
NOTE: I was only able to test with AmazonCoverImages and LocalCoverImages. Feel free to change back to Needs Signoff if it needs to be tested with the other services.
Comment 7 Owen Leonard 2021-01-29 16:04:29 UTC
Created attachment 116065 [details] [review]
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client

This patch modifies the template, JS, and CSS for the staff
interface catalog search results in order to gracefully handle multiple
cover images.

The changed version loops through any cover images which might be
embedded and checks that they are successfully loaded. Only
successfully-loaded images are shown. Only the first image is shown, and
the others can be "paged through" using generated navigation controls.

To test, apply the page and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Enable multiple cover image services. The patch was developed with these
services available:

 - Amazon
 - Local cover images (including multiple local cover images)
 - Coce (serving up Amazon, Google, and OpenLibrary images)
 - Images from the CustomCoverImages preference

Perform a variet of searches and confirm that cover images are
displaying correctly, whether there be 0, 1, 2, or more covers
available for each.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Katrin Fischer 2021-02-17 21:38:29 UTC
Created attachment 116967 [details] [review]
Bug 25846: Improve handling of multiple covers on catalog search results in the staff client

This patch modifies the template, JS, and CSS for the staff
interface catalog search results in order to gracefully handle multiple
cover images.

The changed version loops through any cover images which might be
embedded and checks that they are successfully loaded. Only
successfully-loaded images are shown. Only the first image is shown, and
the others can be "paged through" using generated navigation controls.

To test, apply the page and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Enable multiple cover image services. The patch was developed with these
services available:

 - Amazon
 - Local cover images (including multiple local cover images)
 - Coce (serving up Amazon, Google, and OpenLibrary images)
 - Images from the CustomCoverImages preference

Perform a variet of searches and confirm that cover images are
displaying correctly, whether there be 0, 1, 2, or more covers
available for each.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2021-03-01 14:24:05 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 10 Jonathan Druart 2021-03-01 14:40:47 UTC
> - Local cover images (including multiple local cover images)

Hum, this does not work actually. Only the first image is displayed.
Comment 11 Jonathan Druart 2021-03-01 14:42:35 UTC
(In reply to Jonathan Druart from comment #10)
> > - Local cover images (including multiple local cover images)
> 
> Hum, this does not work actually. Only the first image is displayed.

Nevermind, it's already how it works.
Comment 12 Jonathan Druart 2021-03-03 16:22:27 UTC
We lost the "No cover image available" thumbnails. Owen, can you have a look at it please?
You can attach a follow-up fix here.
Comment 13 Owen Leonard 2021-03-03 17:35:34 UTC
Created attachment 117621 [details] [review]
Bug 25846: (follow-up) Show "No cover image available" message

This patch restores the use of a "No cover image available" message in
staff interface search results when no cover image was found by any
image service.

The patch also corrects markup in the search results template which was
preventing the "Adlibris cover image" text from being correctly hidden.
Comment 14 Jonathan Druart 2021-03-04 07:44:12 UTC
Before: https://snipboard.io/38blZ0.jpg
After : https://snipboard.io/u0JDBm.jpg

It was a bit nicer before as it was centered.
Comment 15 Jonathan Druart 2021-03-04 08:52:17 UTC
follow-up pushed to master.
Comment 16 Fridolin Somers 2021-03-04 10:40:52 UTC
Do you think it can be backported to 20.11.x ?
Since Bug 25031 is in it.
Comment 17 Owen Leonard 2021-03-04 13:08:26 UTC
(In reply to Fridolin Somers from comment #16)
> Do you think it can be backported to 20.11.x ?

My instinct is to say that this isn't the kind of thing which should be backported, but if you disagree I'd be happy to work to make it apply.
Comment 18 Owen Leonard 2021-03-04 13:10:03 UTC
(In reply to Jonathan Druart from comment #14)
> It was a bit nicer before as it was centered.

It looks like the SCSS changes weren't compiled.
Comment 19 Jonathan Druart 2021-03-04 14:45:28 UTC
(In reply to Owen Leonard from comment #18)
> (In reply to Jonathan Druart from comment #14)
> > It was a bit nicer before as it was centered.
> 
> It looks like the SCSS changes weren't compiled.

Indeed, will push it soon!
Comment 20 Fridolin Somers 2021-03-08 08:54:25 UTC
(In reply to Owen Leonard from comment #17)
> (In reply to Fridolin Somers from comment #16)
> > Do you think it can be backported to 20.11.x ?
> 
> My instinct is to say that this isn't the kind of thing which should be
> backported, but if you disagree I'd be happy to work to make it apply.

OK sure, I prefer not backport when there is not easy.
And new releases need new features ;)

Enhancement not pushed to 20.11.x
Comment 21 Fridolin Somers 2021-04-22 13:30:05 UTC
Just backported the fix on staff.scss :

Bug 25846: (20.11.x) fix cover-slides CSS
Comment 22 Andrew Fuerste-Henry 2021-04-25 15:28:14 UTC
Enhancement, not backported to 20.05