From c84ad27fbfbecc74d44dcc1530cbaa06ae0a8cbe Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 12 Nov 2008 15:52:26 +0100 Subject: [PATCH] Overhaul of cover images. Replaces Amazon's "no cover" image with styled text, addressing bug 2241. Adds the same "no cover" text for Google and Baker & Taylor images. Signed-off-by: Galen Charlton --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 43 +++++++++++++++++++ .../prog/en/includes/doc-head-close.inc | 26 ++++++++--- .../opac-tmpl/prog/en/js/amazonimages.js | 4 +- .../opac-tmpl/prog/en/js/google-jackets.js | 15 ++++--- koha-tmpl/opac-tmpl/prog/en/js/script.js | 1 + .../prog/en/modules/opac-detail.tmpl | 18 ++++---- .../prog/en/modules/opac-readingrecord.tmpl | 6 +-- .../prog/en/modules/opac-results.tmpl | 6 +-- .../opac-tmpl/prog/en/modules/opac-user.tmpl | 29 +++++++------ opac/opac-user.pl | 18 ++++++++ 10 files changed, 125 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 381c453369..4f9006b5f6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -1660,6 +1660,7 @@ a#MARCview, a#ISBDview, a#Normalview { } #shelfbrowser a { font-size : 110%; + text-decoration : none; } #shelfbrowser td, #shelfbrowser th { vertical-align : bottom; @@ -1668,6 +1669,9 @@ a#MARCview, a#ISBDview, a#Normalview { #shelfbrowser td.top { vertical-align : top; } +#shelfbrowser td.top a { + text-decoration : underline; +} #shelfbrowser a { display : block; } @@ -1732,4 +1736,43 @@ table#items th { } #action { margin-top: 0; +} +.results_summary img { + margin : 0 5px; +} +span.no-image { + background-color : #FFF; + border: 1px solid #979797; + color : #AAA; + display:block; + font-size : 86%; + font-weight : bold; + text-align : center; + width : 75px; +} +#bookcover span.no-image { + margin-right : 10px; + margin-bottom : 10px; +} +#shelfbrowser a:link span.no-image, +#shelfbrowser a:visited span.no-image, +#shelfbrowser a:hover span.no-image, +#shelfbrowser a:active span.no-image { + font-size : 95%; +} +#shelfbrowser a:link span.no-image, +#shelfbrowser a:visited span.no-image, +#shelfbrowser a:hover span.no-image, +#shelfbrowser a:active span.no-image, +td.jacketcell a:link, +td.jacketcell a:visited, +td.jacketcell a:hover, +td.jacketcell a:active, +a.p1:link, +a.p1:visited, +a.p1:hover, +a.p1:active { + color : #AAA; + text-decoration : none; + font-weight : bold; } \ No newline at end of file diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 6ba4a2a24a..3d9f7046e0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -17,17 +17,18 @@ - + + + - - - + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/js/amazonimages.js b/koha-tmpl/opac-tmpl/prog/en/js/amazonimages.js index dadfa8390f..ce5aadf382 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/amazonimages.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/amazonimages.js @@ -5,9 +5,9 @@ function verify_images() { w = this.width; h = this.height; if ((w == 1) || (h == 1)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + $(this).parent().html(""+NO_AMAZON_IMAGE+""); } else if ((this.complete != null) && (!this.complete)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + $(this).parent().html(""+NO_AMAZON_IMAGE+""); } } }); diff --git a/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js b/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js index 42bf1ed3dd..b106ceac29 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js @@ -17,8 +17,8 @@ KOHA.Google = { */ GetCoverFromIsbn: function() { var bibkeys = []; - $(".gbs-thumbnail").each(function(i) { - bibkeys.push(this.id); // id=isbn + $("div [id^=gbs-thumbnail]").each(function(i) { + bibkeys.push($(this).attr("class")); // id=isbn }); bibkeys = bibkeys.join(','); var scriptElement = document.createElement("script"); @@ -37,15 +37,20 @@ KOHA.Google = { gbsCallBack: function(booksInfo) { for (id in booksInfo) { var book = booksInfo[id]; - $("#"+book.bib_key).each(function() { + $("."+book.bib_key).each(function() { var a = document.createElement("a"); a.href = book.info_url; - var img = document.createElement("img"); if(typeof(book.thumbnail_url) != "undefined"){ + var img = document.createElement("img"); img.src = book.thumbnail_url; a.appendChild(img); - $(this).append(a); + } else { + var message = document.createElement("span"); + $(message).attr("class","no-image"); + $(message).html(NO_GOOGLE_JACKET); + a.appendChild(message); } + $(this).append(a); }); } } diff --git a/koha-tmpl/opac-tmpl/prog/en/js/script.js b/koha-tmpl/opac-tmpl/prog/en/js/script.js index 4763af30d1..b3e3a1672f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/script.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/script.js @@ -1,3 +1,4 @@ +function _(s) { return s } // dummy function for gettext function confirmDelete(message) { return (confirm(message) ? true : false); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index c6841ddf66..711239fbd8 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -56,7 +56,7 @@ @@ -315,11 +315,11 @@ &shelfbrowse_itemnumber=#shelfbrowser"> - - .01._AA75_PU_PU-5_.jpg" alt="" /> -
" id="" class="gbs-thumbnail">
+ + .01._AA75_PU_PU-5_.jpg" alt="" />No cover image available +
" class="" id="gbs-thumbnail">
No cover image available - See Baker & Taylor" /> + See Baker & Taylor" />No cover image available
@@ -327,11 +327,11 @@ &shelfbrowse_itemnumber=#shelfbrowser"> - - .01._AA75_PU_PU-5_.jpg" alt="" /> -
" id="" class="gbs-thumbnail">
+ + .01._AA75_PU_PU-5_.jpg" alt="" />No cover image available +
" class="" id="gbs-thumbnail">
No cover image available - See Baker & Taylor" /> + See Baker & Taylor" />No cover image available
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl index 26e9b073c1..4a9aa0e004 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl @@ -49,11 +49,11 @@ TMPL_ELSE -->Title -/ref=sib_dp_pt/002-7879865-0184864#reader-link">.01.THUMBZZZ.jpg" alt="Cover Image" /> +/ref=sib_dp_pt/002-7879865-0184864#reader-link">.01.THUMBZZZ.jpg" alt="Cover Image" />No cover image available -
" id="" class="gbs-thumbnail">
+
" class="" id="gbs-thumbnail">
No cover image available - ">See Baker & Taylor" /> + ">See Baker & Taylor" />No cover image available "> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index 17eef0c99c..7cf112b0c9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -291,10 +291,10 @@ $(document).ready(function(){ "> - .01.TZZZZZZZ.jpg" alt="" class="thumbnail" /> -
" id="" class="gbs-thumbnail">
+ .01.TZZZZZZZ.jpg" alt="" class="thumbnail" />No cover image available +
" class="" id="gbs-thumbnail">
No cover image available
- ">See Baker & Taylor" /> + ">See Baker & Taylor" />No cover image available diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl index 8f332a0bc4..0456d6a87f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -176,7 +176,7 @@ $.tablesorter.addParser({ - + @@ -196,16 +196,17 @@ $.tablesorter.addParser({ --> - class="overdue"> + - +">See Baker & Taylor" />No cover image available + + - + @@ -263,15 +264,15 @@ $.tablesorter.addParser({ - - +">See Baker & Taylor" />No cover image available + + diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 763e810655..71b19b9383 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -33,6 +33,14 @@ use C4::Letters; use C4::Branch; # GetBranches my $query = new CGI; + +BEGIN { + if (C4::Context->preference('BakerTaylorEnabled')) { + require C4::External::BakerTaylor; + import C4::External::BakerTaylor qw(&image_url &link_url); + } +} + my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => "opac-user.tmpl", @@ -242,6 +250,16 @@ foreach ( @$alerts ) { $_->{ $_->{type} } = 1; $_->{relatedto} = findrelatedto( $_->{type}, $_->{externalid} ); } + +if (C4::Context->preference('BakerTaylorEnabled')) { + $template->param( + BakerTaylorEnabled => 1, + BakerTaylorImageURL => &image_url(), + BakerTaylorLinkURL => &link_url(), + BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'), + ); +} + if (C4::Context->preference("AmazonContent" ) or C4::Context->preference("GoogleJackets" ) or C4::Context->preference("BakerTaylorEnabled") ) { -- 2.39.5
Items Checked Out
   Title Item Type Call No.
+ -/ref=sib_dp_pt/002-7879865-0184864#reader-link">.01.THUMBZZZ.jpg" alt="Cover Image" /> +/ref=sib_dp_pt/002-7879865-0184864#reader-link" title="View at Amazon.com">.01.THUMBZZZ.jpg" alt="Cover Image" />No cover image available -
" id="" class="gbs-thumbnail">
+
" id="gbs-thumbnail">
">No cover image available -">See Baker & Taylor" /> -
"> @@ -251,7 +252,7 @@ $.tablesorter.addParser({
Overdues ( total)
   Title Item Type Call No.
+ -">.01.THUMBZZZ.jpg" alt="" class="thumbnail" /> +/ref=sib_dp_pt/002-7879865-0184864#reader-link" title="View at Amazon.com">.01.THUMBZZZ.jpg" alt="" class="thumbnail" />No cover image available -
" id="" class="gbs-thumbnail">
+
" id="gbs-thumbnail">
">No cover image available -">See Baker & Taylor" /> -
">"> " title="" alt="" />