From 75d7a8c07f6fea51090fe5fd4be89a78bd10ab74 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 12 Jul 2016 11:55:51 -0400 Subject: [PATCH] Bug 17112: Action buttons for course reserves detail page This patch revises the edit and delete buttons on the course reserves detail page so that they are styled as Bootstrap buttons with Font Awesome icons. To test, apply the patch and choose or create a course reserve which has in it at least one lost item and at least one item which is checked out. - In the list of items on the course reserve detail page, confirm that the 'Edit' and 'Delete' buttons are correctly styled. - Confirm that for the checked out item the delete button is disabled. Hovering over the button should trigger a tooltip. Clicking the button should trigger an alert. - Confirm that for the lost item the same is true. Signed-off-by: Hector Castro Buttons styled as Bootstrap. Works as expected. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- .../modules/course_reserves/course-details.tt | 66 +++++++++++-------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index ea9fda8b19..99aa832eb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -25,6 +25,15 @@ $("#delete_course").click(function(){ return confirm( _("Are you sure you want to delete this course?") ); }); + $(".disabled").tooltip().on("click", function(e){ + e.preventDefault(); + if( $(this).hasClass("checkedout") ){ + alert(_("This item cannot be removed. It is checked out")); + } + if( $(this).hasClass("itemlost") ) { + alert(_("This item cannot be removed. It is lost")); + } + }); }); //]]> @@ -82,10 +91,11 @@ Library Staff note Public note - [% IF CAN_user_coursereserves_add_reserves %] [% END %] - [% IF CAN_user_coursereserves_delete_reserves %] [% END %] - Other course reserves Link + Other course reserves + [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] + Actions + [% END %] @@ -167,22 +177,13 @@ [% END %] - [% IF CAN_user_coursereserves_add_reserves %] - Edit - [% END %] - - [% IF CAN_user_coursereserves_delete_reserves %] - - [% IF cr.item.onloan %] - Checked out - [% ELSIF cr.item.itemlost %] - Item lost - [% ELSE %] - Remove - [% END %] - - - [% END %] + + [% IF (cr.item.uri) %] + Item URI + [% ELSIF (cr.item.url) %] + Record URL + [% END %] + [% FOREACH c IN cr.courses %] @@ -197,13 +198,26 @@ [% END %] [% END %] - - [% IF (cr.item.uri) %] - Item URI - [% ELSIF (cr.item.url) %] - Record URL - [% END %] - + + [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] + + [% IF CAN_user_coursereserves_add_reserves %] + Edit + [% END %] + + [% IF CAN_user_coursereserves_delete_reserves %] + [% IF cr.item.onloan %] + + [% ELSIF cr.item.itemlost %] + + [% ELSE %] + + [% END %] + Remove + [% END %] + + [% END %] + [% END %] -- 2.39.5