Bugzilla – Attachment 94574 Details for
Bug 22445
Ability to define a URL for custom cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22445: (follow-up) Use CSS to set a max-width for images - OPAC
Bug-22445-follow-up-Use-CSS-to-set-a-max-width-for.patch (text/plain), 10.89 KB, created by
Martin Renvoize (ashimema)
on 2019-10-22 14:00:42 UTC
(
hide
)
Description:
Bug 22445: (follow-up) Use CSS to set a max-width for images - OPAC
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-22 14:00:42 UTC
Size:
10.89 KB
patch
obsolete
>From 7c586464b72c6ef7716a9f3fd7b1e61750288df2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >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 <hayleymapley@catalyst.net.nz> >Signed-off-by: Hugo Agud <hagud@orex.es> >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Michal Denar <black23@gmail.com> >Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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') %] >- <img alt="Cover image" src="[% item.biblio_object.custom_cover_image_url | url %]" /> >+ <span class="custom_cover_image"> >+ <img alt="Cover image" src="[% item.biblio_object.custom_cover_image_url | url %]" /> >+ </span> > [% END %] > > </a> >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 ) %] >- <a href="[% biblio.custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> > [% ELSE %] >- <a href="[% biblio.custom_cover_image_url | url %]"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> > [% END %] > [% END %] > </div><!-- / #bookcover --> >@@ -974,7 +974,7 @@ > </a></div> > [% END %] > [% ELSE %] >- <div id="addcomment"><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</div> >+ <div id="addcomment"><a class="login-link loginModal-trigger" role="button" data-toggle="modal" href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</div> > [% END # / IF loggedinusername %] > </div> <!-- / #comments --> > [% 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 ) %] >- <a href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" /></a> > [% ELSE %] >- <a href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" /></a> > [% 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 ) %] >+ <a class="custom_cover_image" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]"> >+ [% ELSE %] >+ [% IF ( itemsloo.BiblioDefaultViewisbd ) %] >+ <a class="custom_cover_image" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]"> >+ [% ELSE %] >+ <a class="custom_cover_image" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]"> >+ [% END %] >+ [% END %] > <img alt="Cover image" src="[% itemsloo.biblio_object.custom_cover_image_url | url %]" /></a> > [% 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') %] >- <a href="[% review.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% review.biblio_object.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% review.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% review.biblio_object.custom_cover_image_url | url %]" /></a> > [% END %] > > </td> >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') %] >- <a href="[% ISSUE.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% ISSUE.biblio_object.custom_cover_image_url | url %]" /></a> >+ <a class="custom_cover_image" href="[% ISSUE.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% ISSUE.biblio_object.custom_cover_image_url | url %]" /></a> > [% END %] > > [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22445
:
85925
|
85926
|
85927
|
85928
|
85929
|
85930
|
85931
|
85932
|
85933
|
85934
|
85935
|
85936
|
85937
|
85938
|
86214
|
86726
|
86727
|
87434
|
89973
|
89974
|
89975
|
89976
|
89977
|
89978
|
89979
|
89980
|
89981
|
89982
|
89983
|
89984
|
89985
|
89986
|
89987
|
89988
|
89989
|
89996
|
89997
|
89998
|
89999
|
90000
|
90001
|
90002
|
90003
|
90004
|
90005
|
90006
|
90007
|
90009
|
90010
|
90011
|
90012
|
90013
|
94227
|
94228
|
94229
|
94230
|
94231
|
94232
|
94233
|
94234
|
94235
|
94236
|
94237
|
94238
|
94239
|
94240
|
94241
|
94242
|
94243
|
94244
|
94559
|
94560
|
94561
|
94562
|
94563
|
94564
|
94566
|
94567
|
94568
|
94569
|
94570
|
94571
|
94572
|
94573
| 94574 |
94575
|
94576
|
94577