Bugzilla – Attachment 29829 Details for
Bug 12559
Wrong message if all cover images deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12559: Wrong message if all cover images deleted
PASSED-QA-Bug-12559-Wrong-message-if-all-cover-ima.patch (text/plain), 4.26 KB, created by
Kyle M Hall (khall)
on 2014-07-18 12:56:35 UTC
(
hide
)
Description:
[PASSED QA] Bug 12559: Wrong message if all cover images deleted
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-07-18 12:56:35 UTC
Size:
4.26 KB
patch
obsolete
>From 25739a15f6a4902b13016d9d2c36006eeadc50b8 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 11 Jul 2014 15:35:27 -0300 >Subject: [PATCH] [PASSED QA] Bug 12559: Wrong message if all cover images deleted > >If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI. > >To reproduce: > - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow". > - Go to the detail page of a record that has no images attached. > - The 'Images' tab conveniently shows the following message: > "No images have been uploaded..." > - Use the "upload" link to add a local cover to the record > - Complete the process, and "view final record". > - The 'Images' tab shows the added cover. > - Delete the cover image using the link below the cover. >=> FAIL: 'Click on an image...' message still shows instead of 'No images have been...' > >To test: > - Apply the patch > - Repeat the previous steps >=> SUCCESS : 'No images have been...' > >Bonus points: previous code didn't show a message at all if the user didn't have >permissions to upload local cover images. I've split the message in two: > - 'No images have been...' (for everyone) > - 'Please upload (link)...' (for those with the right permissions :-D > >Regards >To+ > >Edit: I used JavaScript to inject the 'No images...' message to aid localization. >It can be improved once we fix some stuff in the translation scripts to better support >placeholders/variables in the templates. > >Sponsored-by: Universidad Nacional de Cordoba > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/catalogue/detail.tt | 28 ++++++++++++++++--- > 1 files changed, 23 insertions(+), 5 deletions(-) > >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 9e17a40..e10d95f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -63,6 +63,9 @@ function verify_images() { > if ( this.deleted == 1 ) { > $('#imagenumber-' + this.imagenumber).remove(); > } >+ if ( $('ul.thumbnails > li').length == 0 ) { >+ showNoImageMessage(); >+ } > }); > }, > error: function(data) { >@@ -72,6 +75,20 @@ function verify_images() { > > } > >+ function showNoImageMessage() { >+ >+ var no_images_msg = _("No images have been uploaded for this bibliographic record yet."); >+ no_images_msg = '<p>' + no_images_msg + '</p>'; >+ [% IF ( CAN_user_tools_upload_local_cover_images ) %] >+ var please_upload = _("Please %supload%s one.").format( >+ "<a href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'>", >+ "</a>"); >+ no_images_msg += "<p>" + please_upload + '</p>'; >+ [% END %] >+ >+ $('#images').html(no_images_msg); >+ } >+ > [% IF StaffDetailItemSelection %] > function selectAllItems(div) { > $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked'); >@@ -141,7 +158,7 @@ function verify_images() { > }); > [% END %] > >- $(document).ready(function() { >+ $(document).ready(function() { > $('#bibliodetails').tabs(); > $('#search-form').focus(); > $('.thumbnails > li > a > span.remove').click(function() { >@@ -154,6 +171,10 @@ function verify_images() { > > return false; > }); >+ [%# inject no images message %] >+ [% IF ( LocalCoverImages && ! localimages.0 ) %] >+ showNoImageMessage(); >+ [% END %] > }); > > [% IF ( AmazonCoverImages ) %]$(window).load(function() { >@@ -940,10 +961,7 @@ function verify_images() { > [% END %] > [% END %] > </ul> >-[% ELSE %] >-[% IF ( CAN_user_tools_upload_local_cover_images ) %] >- <p>No images have been uploaded for this bibliographic record yet. Please <a href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'>upload</a> one.</p> >-[% END %] >+[%# ELSE - No image passed JavaScript takes care %] > [% END %] > </div> > [% END %] >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12559
:
29654
|
29689
| 29829