@@ -, +, @@ tags review template - The initial view of tags moderation shows only tags awaiting moderation. Test that the "select all," "clear all," and "Select all pending" links work correctly. - Click the "Approve" button for a tag, and the "Reject" button for another tag. - Test the "Select all pending" link again. Only the tags awaiting moderation should be selected. --- .../intranet-tmpl/prog/en/modules/tags/review.tt | 26 ++++++++++----- .../intranet-tmpl/prog/js/pages/tags-review.js | 38 +++++++++++++++------- 2 files changed, 44 insertions(+), 20 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt @@ -77,7 +77,6 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }   -   Status Term Weight @@ -89,18 +88,28 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% FOREACH tagloo IN tagloop %] - [% offset + loop.count | html %] - - [% IF ( tagloo.approved == 0 ) %] - [% ELSE %][% END %] + + [% IF ( tagloo.approved == 0 ) %] + + [% ELSIF ( tagloo.approved == 1 ) %] + + [% ELSE %] + + [% END %] [% IF ( tagloo.approved == -1 ) %] - Rejected + [% ELSIF ( tagloo.approved == 1 ) %] - Approved + [% ELSE %] - Pending + [% END %] [% tagloo.term | html %] @@ -228,7 +237,6 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'calendar.inc' %] - [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] [% Asset.js("js/pages/tags-review.js") | $raw %] [% END %] --- a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js +++ a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js @@ -65,23 +65,37 @@ $(document).ready(function() { { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, { "sType": "title-string", "aTargets" : [ "title-string" ] } ], - "aaSorting": [[ 4, "desc" ]], + "aaSorting": [[ 2, "desc" ]], "sPaginationType": "full" })); $('.ajax_buttons' ).css({visibility:"visible"}); $("p.check").html("
<\/i> " + __("Select all") + "<\/a> | <\/i> " + __("Clear all") + "<\/a> | " + __("Select all pending") + "<\/a><\/div>"); - $("#CheckAll").click(function(){ - $(".checkboxed").checkCheckboxes(); - return false; + + $("#CheckAll").on("click", function (e) { + e.preventDefault(); + $("#tagst input:checkbox").each(function () { + $(this).prop("checked", true); + }); }); - $("#CheckNone").click(function(){ - $(".checkboxed").unCheckCheckboxes(); - return false; + + $("#CheckNone").on("click", function(e){ + e.preventDefault(); + $("#tagst input:checkbox").each(function(){ + $(this).prop("checked", false ); + }); }); - $("#CheckPending").click(function(){ - $(".checkboxed").checkCheckboxes(".pending"); - return false; + + $("#CheckPending").on("click", function (e) { + e.preventDefault(); + $("#tagst input:checkbox").each(function () { + if( $(this).hasClass("pending") ){ + $(this).prop("checked", true); + } else { + $(this).prop("checked", false); + } + }); }); + $(".approval_btn").on('click',function(event) { event.preventDefault(); pull_counts(); @@ -102,6 +116,7 @@ $(document).ready(function() { getelement = $(event.target).data("num"); gettitle = ".status" + getelement; $(gettitle).text( __("Approved") ); + $("#checkbox" + getelement ).attr("class", "approved"); if ($(gettitle).hasClass("pending") ){ $(gettitle).toggleClass("pending approved"); } else { @@ -121,7 +136,8 @@ $(document).ready(function() { $(event.target).html(" " + __("Rejected")); getelement = $(event.target).data("num"); gettitle = ".status" + getelement; - $(gettitle).text( __("Rejected") ); + $(gettitle).text(__("Rejected")); + $("#checkbox" + getelement).attr("class", "rejected"); if ($(gettitle).hasClass("pending") ){ $(gettitle).toggleClass("pending rejected"); } else { --