From 94d46864b9719dd3fe2ac0a34d25a12f448f243b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Dec 2011 12:22:09 -0500 Subject: [PATCH] Bug 1633 - Add ability to take book cover images from local img db Content-Type: text/plain; charset="utf-8" OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 5 + koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 4 +- .../opac-tmpl/prog/en/modules/opac-imageviewer.tt | 82 ++++++++++++++++---- opac/opac-imageviewer.pl | 3 + 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 21dc08f..f904af2 100755 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2289,3 +2289,8 @@ a.koha_url { .nav_results #listResults li a { color:#FFFFFF; font-weight:normal;} +a.localimage img { + border : 1px solid #8EB3E7; + margin : 0 .5em; + padding : .3em; +} \ No newline at end of file diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 717c5b6..7f52117 100755 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -987,10 +987,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( OPACLocalCoverImages ) %]
-
Click on an image to view it in the image viewer
+

Click on an image to view it in the image viewer

[% FOREACH image IN localimages %] [% IF image %] -img + [% END %] [% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-imageviewer.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-imageviewer.tt index d6633e1..a14e61d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-imageviewer.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-imageviewer.tt @@ -1,11 +1,12 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Images for: [% biblio.title |html %] [% INCLUDE 'doc-head-close.inc' %] - - + -
Large view
-[% IF OPACLocalCoverImages == 1 %] -[% FOREACH img IN images %] -[% IF img %] -Image -[% END %] -[% END %] -[% biblio.title %] [% biblio.author %] +[% IF ( OpacNav ) %]
[% ELSE %]
[% END %] +
+[% INCLUDE 'masthead.inc' %] +
+
+
+
+

Images for [% IF ( BiblioDefaultViewmarc ) %] + [% ELSE %] + [% IF ( BiblioDefaultViewisbd ) %] + [% ELSE %] + [% END %] + [% END %][% biblio.title %] [% biblio.author %]

+
+ +
+ + [% IF OPACLocalCoverImages == 1 %] +
+ [% FOREACH img IN images %] + [% IF img %] + + [% IF ( imagenumber == img ) %] + [% ELSE %] + + [% END %] + + [% END %] + [% END %] +
+
[% ELSE %] Unfortunately, images are not enabled for this catalog at this time. [% END %] - - + +
+
+
+[% IF ( OpacNav ) %] +
+[% INCLUDE 'navigation.inc' %] +
+[% END %] +
+[% INCLUDE 'opac-bottom.inc' %] diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl index 6d2f326..cddc45c 100755 --- a/opac/opac-imageviewer.pl +++ b/opac/opac-imageviewer.pl @@ -38,12 +38,15 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $biblionumber = $query->param('biblionumber') || $query->param('bib'); +my $imagenumber = $query ->param('imagenumber'); my ($count, $biblio) = GetBiblio($biblionumber); if (C4::Context->preference("OPACLocalCoverImages")) { my @images = ListImagesForBiblio($biblionumber); $template->{VARS}->{'OPACLocalCoverImages'} = 1; $template->{VARS}->{'images'} = \@images; + $template->{VARS}->{'biblionumber'} = $biblionumber; + $template->{VARS}->{'imagenumber'} = $imagenumber; } $template->{VARS}->{'biblio'} = $biblio; -- 1.7.3