From eff760b352a8b8722ac454663a7bcb6f97826d38 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Dec 2011 12:22:09 -0500 Subject: [PATCH] Bug 1633 - [SIGNED-OFF] Add ability to take book cover images from local img db 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 Signed-off-by: Jared Camins-Esakov Signed-off-by: Magnus Enger Signed-off-by: Koustubha Kale --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 5 ++ .../opac-tmpl/prog/en/modules/opac-detail.tt | 4 +- .../prog/en/modules/opac-imageviewer.tt | 82 +++++++++++++++---- opac/opac-image.pl | 2 +- opac/opac-imageviewer.pl | 3 + 5 files changed, 76 insertions(+), 20 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 21dc08ff39..f904af2442 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 6534d1b656..65256ad48a 100755 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -991,10 +991,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 d6633e1351..8dd7add870 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 ) %]Thumbnail + [% ELSE %] + Thumbnail + [% 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-image.pl b/opac/opac-image.pl index 1edc0b4a07..444c127ced 100755 --- a/opac/opac-image.pl +++ b/opac/opac-image.pl @@ -29,7 +29,7 @@ use C4::Images; $|=1; -my $DEBUG = 1; +my $DEBUG = 0; my $data = new CGI; my $imagenumber; diff --git a/opac/opac-imageviewer.pl b/opac/opac-imageviewer.pl index c34c58a997..e3bddb4454 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'} = $images[0] || ''; } $template->{VARS}->{'biblio'} = $biblio; -- 2.20.1