From 84caea12382e24fcfa6429a7e1a69e4a3043d70d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 13 Jul 2020 15:18:23 +0000 Subject: [PATCH] Bug 25984: Add minimum height and width to shelf browser covers This patch adds a class to the shelf browser cover image links and a style for these links defining a minimum height and width. This allows the browser's default tab focus outline to be visible. This patch also adds a check for an enabled cover image service before displaying the cover image links. This patch introduces whitespace changes so diff accordingly. To test, apply the patch and rebuild the OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Enable the OPACShelfBrowser system preference. - Enable at least one cover image service (Amazon, Google, Coce, etc). - Locate a title in the OPAC which has items attached. - On the bibliographic detail page, click the "Browse shelf" link in the table of holdings to display the shelf browser. - Use the tab key to move the focus to cover images in the shelf browser. - Confirm that the focus outline moves through each cover link whether or not there is a cover image available. - Diable all cover image services. - Test the shelf browser again and confirm that it's not necessary to tap through an empty row. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit e722dd1725e113acd79dcb9e8eed2cd4da35aa33) Signed-off-by: Lucas Gass --- .../opac-tmpl/bootstrap/css/src/opac.scss | 6 ++ .../bootstrap/en/includes/shelfbrowser.inc | 80 ++++++++++--------- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index c30901390e..cf255ffec3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2731,6 +2731,12 @@ button { font-size: 110%; font-weight: bold; text-decoration: none; + + &.shelfbrowser_cover { + min-height: 80px; + min-width: 80px; + display: inline-block; + } } #browser_previous { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc index 09408a5971..f7e35adc58 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc @@ -28,54 +28,56 @@ [% img_title = item.biblionumber %] [% END %] - - [% IF ( OPACLocalCoverImages ) %] -
- [% END %] - [% IF ( OPACAmazonCoverImages ) %] - [% IF ( item.browser_normalized_isbn ) %] - - [% ELSE %] - No cover image available + [% IF ( OPACLocalCoverImages || OPACAmazonCoverImages || ( SyndeticsEnabled && SyndeticsCoverImages ) || GoogleJackets || BakerTaylorEnabled || ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) || ( Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') ) ) %] +
+ [% IF ( OPACLocalCoverImages ) %] +
[% END %] - [% END %] - - [% IF ( SyndeticsEnabled ) %] - [% IF ( SyndeticsCoverImages ) %] - [% IF ( content_identifier_exists ) %] - + [% IF ( OPACAmazonCoverImages ) %] + [% IF ( item.browser_normalized_isbn ) %] + [% ELSE %] No cover image available [% END %] [% END %] - [% END %] - [% IF ( GoogleJackets ) %] - [% IF ( item.browser_normalized_isbn ) %] -
- [% ELSE %] - No cover image available + [% IF ( SyndeticsEnabled ) %] + [% IF ( SyndeticsCoverImages ) %] + [% IF ( content_identifier_exists ) %] + + [% ELSE %] + No cover image available + [% END %] + [% END %] + [% END %] + + [% IF ( GoogleJackets ) %] + [% IF ( item.browser_normalized_isbn ) %] +
+ [% ELSE %] + No cover image available + [% END %] [% END %] - [% END %] - [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] - [% coce_id = item.browser_normalized_ean || item.browser_normalized_isbn | html %] -
- [% END %] - [% IF ( BakerTaylorEnabled ) %] - [% bt_id = ( item.browser_normalized_upc || item.browser_normalized_isbn ) | html %] - [% IF ( bt_id ) %] - See Baker & Taylor - [% ELSE %] - No cover image available + [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] + [% coce_id = item.browser_normalized_ean || item.browser_normalized_isbn | html %] +
+ [% END %] + [% IF ( BakerTaylorEnabled ) %] + [% bt_id = ( item.browser_normalized_upc || item.browser_normalized_isbn ) | html %] + [% IF ( bt_id ) %] + See Baker & Taylor + [% ELSE %] + No cover image available + [% END %] + [% END %] + [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] + + Cover image + [% END %] - [% END %] - [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] - - Cover image - - [% END %] -
+ + [% END %] [% END %] -- 2.39.5