From f941f67897994e31b22617cf0e38661fba403af1 Mon Sep 17 00:00:00 2001 From: Hector Castro Date: Fri, 13 May 2016 23:40:25 -0600 Subject: [PATCH] Bug 16456: Add Font Awesome icons to some buttons in Tools module, section Patrons and circulation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add Font Awesome Icons to section Patrons and circulation in Tools module. Also correct a error dialog in JQuery functions To test: -Apply patch -Goto Tools -> Patron list -> my_list_saved -> Add patrons -> Remove selected patrons, Clear all, Select all. -Add new patron list and add some patrons, notice about the trash icon. -Make some comments in some bib records and goto Tools->Comments you will presented with two tabs "Approved comments" and "Comments awaiting moderation". See the three new buttons: Approve, Delete, Unapprove. -Set syspref TagsModeration to Require. This will show all pending tags to review. -Make some tags in bib records and goto Tools -> Tags. -Notice about the new look. -In the new screen look the icons in buttons "Apply filter(s)", "Test", "Approved", "Reject". Notice about the new header bar above the DataTable with options: Select all, Clear all, Select all pending. -Play with filters; Check if terms exist or not in appoved/rejected lists -Play with Terms summary and see if DataTable is working as expected -Click in some term tag with multiple titles -A table with titles tagged with the term is presented -See the new button 'Remove' -Verify if you can remove tag from a selected title. -Verify that all tools work as expected NOTE: The Tag and Comments tools has been revised to fit with others interfaces in Koha. Bug ammended according with QA comment 5 Bug rebased because bug 16005 Test plan amended for clarity Clock icon for "Select all pending" removed (QA comment 23). Fix some forbidden patterns (tab char) in review.tt according by IRC comment by Marc Veron Followed test plan, looks and works as expected Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 2a6a3de7c407724d2778be8bf422b1222910e4a7) Signed-off-by: Frédéric Demians --- .../intranet-tmpl/js/autocomplete/patrons.js | 2 +- .../prog/en/modules/patron_lists/list.tt | 6 +- .../prog/en/modules/reviews/reviewswaiting.tt | 4 +- .../prog/en/modules/tags/list.tt | 2 +- .../prog/en/modules/tags/review.tt | 104 +++++++++++------- 5 files changed, 69 insertions(+), 49 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js b/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js index 909162ba64..ef61f0e085 100644 --- a/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js +++ b/koha-tmpl/intranet-tmpl/js/autocomplete/patrons.js @@ -33,7 +33,7 @@ function patron_autocomplete(params) { } function AddPatron( patron_name, value, container, input_name ) { - div = "
" + patron_name + " ( " + MSG_REMOVE_PATRON + " )
"; + div = "
" + patron_name + " ( " + MSG_REMOVE_PATRON + " )
"; $(container).append( div ); $(container).parent().show( 800 ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt index d4df15efb1..187c7da918 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt @@ -102,8 +102,8 @@ $(document).ready(function() {
- Select all | - Clear all | + Select all | + Clear all |
@@ -152,7 +152,7 @@ $(document).ready(function() { - +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt index b609d83f87..65cb8295f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt @@ -53,8 +53,8 @@ [% review.review |html %] - [% IF ( status ) %]Unapprove[% ELSE %]Approve[% END %] | - Delete + [% IF ( status ) %] Unapprove[% ELSE %] Approve[% END %] + Delete [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt index 24bb2de969..ee4ef72140 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt @@ -71,7 +71,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %][% ELSE %]This record has no items.[% END %] -
+
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt index 06fe62ae38..b89fe6c810 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -74,11 +74,11 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } var success_test_call = function() { $('#test_button').prop('disabled', false); - $('#test_button').attr("value",_("Test")); + $('#test_button').html("" +_(" Test")); }; $(document).ready(function() { $('.ajax_buttons' ).css({visibility:"visible"}); - $("p.check").html(""+_("Select:")+" <\/strong>"+_("All")+"<\/a> "+_("Pending")+"<\/a> "+_("None")+"<\/a>"); + $("p.check").html("
<\/i>"+_(" Select all")+"<\/a> | <\/i>"+_(" Clear all")+"<\/a> | "+_("Select all pending")+"<\/a><\/div>"); $("#CheckAll").click(function(){ $(".checkboxed").checkCheckboxes(); return false; @@ -96,28 +96,48 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } // window.alert(_("Click detected on ") + event.target + ": " + $(event.target).html); if ($(event.target).is('.ok')) { $.ajax({ - "data": {ok: $(event.target).attr("title")}, - "success": count_approve // success_approve + data: {ok: $(event.target).attr("title")}, + success: count_approve // success_approve }); - $(event.target).next(".rej").prop('disabled', false).attr("value",_("Reject")).css("color","#000"); - $(event.target).attr( "value",_("Approved")).prop('disabled', true).css("color","#666"); + $(event.target).next(".rej").prop('disabled', false).css("color","#000"); + $(event.target).next(".rej").html("" + _(" Reject")); + $(event.target).prop('disabled', true).css("color","#666"); + $(event.target).html("" + _(" Approved")); + var getelement = $(event.target).attr("title"); + var gettitle = "span[data-title|=" + getelement + "]"; + $(gettitle).text(_("Approved")); + if ($(gettitle).attr("class") == "pending"){ + $(gettitle).toggleClass("pending approved"); + } else { + $(gettitle).toggleClass("rejected approved"); + } return false; // cancel submit } if ($(event.target).is('.rej')) { $.ajax({ - "data": {rej: $(event.target).attr("title")}, - "success": count_reject // success_reject - }); - $(event.target).prev(".ok").prop('disabled', false).attr("value",_("Approve")).css("color","#000"); - $(event.target).attr( "value",_("Rejected")).prop('disabled', true).css("color","#666"); + data: {rej: $(event.target).attr("title")}, + success: count_reject // success_reject + }); + $(event.target).prev(".ok").prop('disabled', false).css("color","#000"); + $(event.target).prev(".ok").html("" + _(" Approve")); + $(event.target).prop('disabled', true).css("color","#666"); + $(event.target).html("" + _(" Rejected")); + var getelement = $(event.target).attr("title"); + var gettitle = "span[data-title|=" + getelement + "]"; + $(gettitle).text(_("Rejected")); + if ($(gettitle).attr("class") == "pending"){ + $(gettitle).toggleClass("pending rejected"); + } else { + $(gettitle).toggleClass("approved rejected"); + } return false; // cancel submit } - if ($(event.target).is('#test_button')) { - $(event.target).attr( "value",_("Testing...")).prop('disabled', true); - $.ajax({ - "data": {test: $('#test').attr("value")}, - "success": success_test_call // success_reject - }); + if ($(event.target).is('#test_button')) { + $(event.target).text(_("Testing...")).prop('disabled', true); + $.ajax({ + data: {test: $('#test').attr("value")}, + success: success_test_call // success_reject + }); return false; // cancel submit } }); @@ -239,11 +259,11 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% IF ( tagloo.approved == -1 ) %] - Rejected + Rejected [% ELSIF ( tagloo.approved == 1 ) %] - Approved + Approved [% ELSE %] - Pending + Pending [% END %] [% tagloo.term %] @@ -253,11 +273,11 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% IF ( tagloo.approved ) %] @@ -265,8 +285,8 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% ELSE %] [% UNLESS ( filter_approved_pending ) %] [% END %] @@ -280,8 +300,8 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% END %] [% IF ( tagloop ) %]
- - + +
[% END %]
@@ -289,18 +309,18 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }

Terms summary

    -
  • Approved: - [% approved_count %] -
  • -
  • Rejected: - [% rejected_count %] -
  • -
  • Pending: - [% unapproved_count %] -
  • -
  • Total: - [% approved_total %] -
  • +
  • Approved: + [% approved_count %] +
  • +
  • Rejected: + [% rejected_count %] +
  • +
  • Pending: + [% unapproved_count %] +
  • +
  • Total: + [% approved_total %] +
 
@@ -309,7 +329,7 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
Enter a word or phrase to check against approved/rejected lists:
-
+
[% IF ( test_term ) %] [% IF ( verdict_ok ) %] @@ -360,7 +380,7 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
[% INCLUDE 'date-format.inc' %]
-
+
-- 2.39.5