From 3c6d0cdbd4bbb204389bbd7b24a2dfa5c59aa426 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 --- .../intranet-tmpl/prog/css/src/staff-global.scss | 20 ++++++- .../prog/en/modules/catalogue/detail.tt | 65 +++++++++++++--------- 2 files changed, 57 insertions(+), 28 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 af5afa2..c68d3a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2284,10 +2284,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 e369043..b1b3b6b 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 ) %] @@ -904,7 +909,9 @@ [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] [% INCLUDE 'greybox.inc' %] -