From 605aeba9252f9d93b642ff0a130f60047c2a7ea0 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 --- .../intranet-tmpl/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 c1ed2a2..28b2381 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2233,10 +2233,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 e287d23..7bc314b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -807,26 +807,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 ) %] @@ -904,6 +909,8 @@ [% Asset.js("js/catalog.js") | $raw %] [% INCLUDE 'greybox.inc' %]