From 52bceacd82cdf4e45b2e76bb7353bb84af1ee1b3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 20 Dec 2018 16:32:34 +0000 Subject: [PATCH] Bug 22032: Improve local cover image tab on detail page This patch makes a variety of improvements to the images tab of the staff client's bibliographic detail page. To test, apply the patch and regenerate the staff client CSS. - Enable the LocalCoverImages system preference. - Locate a bibliographic record which has no images attached. - There should be a "no images" message and an upload button. - Upload an image and return to the detail page. - The "Images" tab should have a nicely-styled thumbnail of the image you uploaded. - Test the "Delete image" link: It should ask for a confirmation. If you confirm, the image should disappear and a "loading" spinner should appear. - When the image has been deleted the thumbnail container should disappear and the "no images" message should reappear. - Test this process with AllowMultipleCovers enabled and disabled. Extra credit: Modify the AJAX url in the removeLocalImage function in detail.tt. After misspelling a parameter name or the URL path, clicking the "Delete image" link should trigger an alert and re-show the image thumbnail. Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../prog/css/src/staff-global.scss | 20 +++++- .../prog/en/modules/catalogue/detail.tt | 63 +++++++++++-------- 2 files changed, 56 insertions(+), 27 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 9d946c7161..61b26051d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2268,10 +2268,28 @@ li { .thumbnail { display: block; margin: auto; +} - > li { +.thumbnails { + li { + display: inline-block; list-style-type: none; } + + .remove { + border-top: 1px solid #EEE; + display: block; + font-size: 90%; + margin: 4px -4px 2px -4px; + padding-top: .5em; + text-align: center; + } + + & + p { + border-top: 1px solid #eee; + margin-top: 1em; + padding-top: 1em; + } } #searchresults { 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 07c44de720..fe0188b43d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -812,26 +812,31 @@ [% END %] [% IF ( LocalCoverImages ) %] -
-[% IF ( localimages.0 ) %] -

Click on an image to view it in the image viewer

- + [% ELSE # - No image passed JavaScript takes care %] + No images have been uploaded for this bibliographic record yet. + [% END %] + [% IF ( CAN_user_tools_upload_local_cover_images ) %] +

Upload an image file: Upload +

+ [% END %] +
[% END %] [% IF ( HTML5MediaEnabled ) %] @@ -909,6 +914,8 @@ [% Asset.js("js/catalog.js") | $raw %] [% INCLUDE 'greybox.inc' %]