From 7be6714148f35f3d33d848d4cc9dca251356971a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 16 Jan 2019 18:27:54 +0000 Subject: [PATCH] Bug 22035: Improve local cover image browser page This patch makes changes to the way local cover images are handled on the image viewer page in the staff client. From this page you can now delete images or reach the upload images page. The patch also modifies slightly the process for deleting an image from the images tab on the bibliographic detail page. To test, apply the patch and regenerate the staff client CSS. LocalCoverImages and AllowMultipleCovers should be enabled. - Open the detail view for a record which has multiple cover images attached. On the Images tab, click the "Delete image" link for an image. After confirming, the link should change to a spinner icon and image should fade out. - Click one of the cover images to open the image viewer page. The thumbnails should each have a delete link which looks like and behaves like the delete links on the biblio detail page. - Clicking an image thumbnail should load a spinner icon into the area where the full-sized image was, which should be replaced by the image you chose. - There should be a button for uploading images which takes you to the correct page for adding images to that record. - The page title and breadcrumbs should show the title of the record. Signed-off-by: Claire Gravely Signed-off-by: Nick Clemens --- .../prog/css/src/staff-global.scss | 1 + .../prog/en/modules/catalogue/detail.tt | 3 +- .../prog/en/modules/catalogue/imageviewer.tt | 133 ++++++++++++------ 3 files changed, 93 insertions(+), 44 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 2844424e29..7327eb3e7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2280,6 +2280,7 @@ li { li { display: inline-block; list-style-type: none; + margin: 4px; } .remove { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 4b4c1dae43..6520134dc2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -789,7 +789,8 @@ function removeLocalImage(imagenumber) { var thumbnail = $("#imagenumber-" + imagenumber ); var copy = thumbnail.html(); - thumbnail.html("
"); + thumbnail.find("img").css("opacity", ".2"); + thumbnail.find("a.remove").html(""); $.ajax({ url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber, success: function(data) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt index 73af2f0153..b5d95e7e10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt @@ -2,36 +2,24 @@ [% USE Asset %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Catalog › Details for [% biblio.title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] +Koha › Catalog › [% biblio.title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %] › Images [% INCLUDE 'doc-head-close.inc' %] -[% IF ( LocalCoverImages == 1 ) %] [% END %] + @@ -39,7 +27,7 @@ img.thumbnail { [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +
@@ -54,28 +42,45 @@ img.thumbnail { [% IF ( LocalCoverImages == 1 ) %] [% IF ( images.size > 0 ) %]
-
-
- -
- -
- - [% FOREACH img IN images %] - [% IF img %] - - [% IF ( imagenumber == img ) %] - Thumbnail - [% ELSE %] - Thumbnail - [% END %] - +
+
+ +
+ [% IF ( CAN_user_tools_upload_local_cover_images ) %] +
+

Upload an image file: Upload +

[% END %] - [% END %] -
-
+
+ +
+ +
+
[% ELSE %]
There are no images for this record.
+ [% IF ( CAN_user_tools_upload_local_cover_images ) %] +
+

Upload an image file: Upload +

+ [% END %] [% END %] [% ELSE %]
Local images have not been enabled by your system administrator.
@@ -95,19 +100,61 @@ img.thumbnail { [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] [% END %] -- 2.39.5