4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Images › [% INCLUDE 'biblio-title-head.inc' %] › Catalog › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 background: transparent url("[% interface | html %]/[% theme | html %]/img/spinner-small.gif") center center no-repeat;
12 border : 1px solid #CCCCCC;
18 .thumbnails img.selected {
25 <body id="catalog_imageviewer" class="catalog">
27 [% WRAPPER 'header.inc' %]
28 [% INCLUDE 'cat-search.inc' %]
31 [% WRAPPER 'sub-header.inc' %]
32 [% WRAPPER breadcrumbs %]
33 [% WRAPPER breadcrumb_item %]
34 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
36 [% WRAPPER breadcrumb_item %]
37 [% INCLUDE 'biblio-title.inc' link = 1 %]
39 [% WRAPPER breadcrumb_item bc_active= 1 %]
42 [% END #/ WRAPPER breadcrumbs %]
43 [% END #/ WRAPPER sub-header.inc %]
45 <div class="main container-fluid">
47 <div class="col-sm-10 col-sm-push-2">
50 [% INCLUDE 'cat-toolbar.inc' %]
52 <h1>Images for <em>[% INCLUDE 'biblio-title.inc' %]</em></h1>
53 <h4>[% biblio.author | html %]</h4>
55 [% IF ( LocalCoverImages == 1 ) %]
58 <div class="col-md-8">
60 <img id="largeCoverImg" alt="" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% imagenumber | html %]" />
62 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
66 Upload an image file for this item:
67 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% itemnumber | uri %]&filetype=image">
69 Upload an image file for this bibliographic record:
70 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&filetype=image">
72 <i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
77 <div class="col-md-4">
78 <ul class="thumbnails">
79 [% FOREACH image IN images %]
80 <li id="imagenumber-[% image.imagenumber | html %]" data-itemnumber="[% image.itemnumber | html %]" data-biblionumber="[% image.biblionumber | html %]" class="thumbnail">
81 <a class="show_cover" data-coverimg="[% image.imagenumber | html %]" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&imagenumber=[% image.imagenumber | html %]">
82 [% IF image.imagenumber == imagenumber %]
83 <img class="selected" id="thumbnail_[% image.imagenumber | html %]" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | html %]&thumbnail=1" alt="Thumbnail" />
85 <img id="thumbnail_[% image.imagenumber | html %]" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | html %]&thumbnail=1" alt="Thumbnail" />
88 [% IF CAN_user_tools_upload_local_cover_images %]
89 <a href="#" class="remove" data-coverimg="[% image.imagenumber | html %]"><i class="fa fa-trash-can"></i> Delete image</a>
92 [% END # /FOREACH img %]
93 </ul> <!-- /ul.thumbnails -->
94 </div> <!-- /.col-md-4 -->
98 <div class="dialog message">There are no images for this item.</div>
100 <div class="dialog message">There are no images for this record.</div>
102 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
105 Upload an image file:
107 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% itemnumber | uri %]&filetype=image">
109 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&filetype=image">
111 <i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
116 <div class="dialog message">Local images have not been enabled by your system administrator.</div>
120 </div> <!-- /.col-sm-10.col-sm-push-2 -->
122 <div class="col-sm-2 col-sm-pull-10">
124 [% INCLUDE 'biblio-view-menu.inc' %]
126 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
127 </div> <!-- /.row -->
129 [% IF ( Koha.Preference('CatalogConcerns') ) %]
130 [% INCLUDE 'modals/add_catalog_concern.inc' %]
133 [% MACRO jsinclude BLOCK %]
134 [% INCLUDE 'catalog-strings.inc' %]
135 [% Asset.js("js/catalog.js") | $raw %]
136 [% IF ( Koha.Preference('CatalogConcerns') ) %]
138 /* Set a variable needed by add_catalog_concern.js */
139 var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
141 [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
144 var interface = "[% interface | html %]";
145 var theme = "[% theme | html %]";
146 $(document).ready(function(){
147 showCover([% imagenumber | html %]);
148 $(".show_cover").on("click",function(e){
150 if( $(this).find("img").hasClass("selected") ){
153 $("#largeCoverImg").attr( "src", interface + "/" + theme + "/img/spinner-small.gif");
154 var imagenumber = $(this).data("coverimg");
155 showCover( imagenumber );
159 $('.thumbnails .remove').on("click", function(e) {
161 var result = confirm(_("Are you sure you want to delete this cover image?"));
162 var imagenumber = $(this).data("coverimg");
163 if ( result == true ) {
164 removeLocalImage(imagenumber);
170 function removeLocalImage(imagenumber) {
171 var thumbnail = $("#imagenumber-" + imagenumber );
172 var itemnumber = $(thumbnail).data("itemnumber");
173 var biblionumber = $(thumbnail).data("biblionumber");
174 var copy = thumbnail.html();
175 thumbnail.find("img").css("opacity", ".2");
176 thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
179 url: "/cgi-bin/koha/svc/cover_images?action=delete&imagenumber=" + imagenumber,
180 success: function(data) {
181 $(data).each( function() {
182 if ( this.deleted == 1 ) {
184 location.href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=" + itemnumber;
186 location.href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=" + biblionumber;
189 thumbnail.html( copy );
190 alert(_("An error occurred on deleting this image"));
194 error: function(data) {
195 thumbnail.html( copy );
196 alert(_("An error occurred on deleting this image"));
201 function showCover(img) {
202 $('.thumbnail img').removeClass("selected");
203 $('#largeCoverImg').attr("src","").attr('src', '/cgi-bin/koha/catalogue/image.pl?imagenumber=' + img);
204 $('#thumbnail_' + img).addClass("selected");
209 [% INCLUDE 'intranet-bottom.inc' %]