From 538ca0fb4cdfa753c279b5e6003be123241f98d6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 22 Oct 2019 14:58:29 +0100 Subject: [PATCH] Bug 22445: (follow-up) Use CSS to set a max-width for images - OPAC This patch adds some CSS and markup to OPAC templates so that custom cover images have a maximum width of 140px (to match the width of generated local cover image thumbnails). This prevents oversized images from displaying inconsistently compared to images from other services. To test, apply the patch and regenerate the OPAC CSS. Post an oversized image which corresponds to a record in your OPAC which can be added to a user's checkouts and to a list. View the following pages to confirm that the image displays well: - OPAC search results - Bibliographic detail page - Shelf browser - List contents - Recent comments - "Your summary" Sponsored-by: Orex Digital Signed-off-by: Hayley Mapley Signed-off-by: Hugo Agud Signed-off-by: Owen Leonard Signed-off-by: Michal Denar Signed-off-by: Kyle Hall Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 6 ++++++ .../opac-tmpl/bootstrap/en/includes/shelfbrowser.inc | 4 +++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 9 +++++++++ .../opac-tmpl/bootstrap/en/modules/opac-showreviews.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 6e6d3801d0..02ad5d701f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -1160,6 +1160,12 @@ ul { } } +.custom_cover_image { + img { + max-width: 140px; + } +} + .required { color: #C00; } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc index 0cc92f5b91..4eecc26ce0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc @@ -62,7 +62,9 @@ [% END %] [% END %] [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] - Cover image + + Cover image + [% 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 0cfc1c5e3b..afa1d66d6c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -99,9 +99,9 @@ [% END %] [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] [% IF ( OPACURLOpenInNewWindow ) %] - Cover image + Cover image [% ELSE %] - Cover image + Cover image [% END %] [% END %] @@ -974,7 +974,7 @@ [% END %] [% ELSE %] -
Log in to your account to post a comment.
+
to post a comment.
[% END # / IF loggedinusername %] [% END # / IF reviewson %] 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 a7e34b2219..a044134da5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -324,9 +324,9 @@ [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] [% IF ( OPACURLOpenInNewWindow ) %] - Cover image + Cover image [% ELSE %] - Cover image + Cover image [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index b9e7a67f69..b166832e5b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -362,6 +362,15 @@ [% END %] [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] + [% IF ( itemsloo.BiblioDefaultViewmarc ) %] + + [% ELSE %] + [% IF ( itemsloo.BiblioDefaultViewisbd ) %] + + [% ELSE %] + + [% END %] + [% END %] Cover image [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt index 6d0c9babd1..bee0774e65 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt @@ -152,7 +152,7 @@ [% END %] [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] - Cover image + Cover image [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index e342398c95..7f2d54622e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -243,7 +243,7 @@ [% END %] [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] - Cover image + Cover image [% END %] [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %] -- 2.39.5