Bugzilla – Attachment 107721 Details for
Bug 26120
Remove the use of jquery.checkboxes plugin from tags review template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26120: Remove the use of jquery.checkboxes plugin from tags review template
Bug-26120-Remove-the-use-of-jquerycheckboxes-plugi.patch (text/plain), 7.47 KB, created by
Owen Leonard
on 2020-08-03 19:40:08 UTC
(
hide
)
Description:
Bug 26120: Remove the use of jquery.checkboxes plugin from tags review template
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-08-03 19:40:08 UTC
Size:
7.47 KB
patch
obsolete
>From e359fb68edc7e98f141ec5e8e9bb38f9ca8dd6b2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Sat, 1 Aug 2020 00:37:32 +0000 >Subject: [PATCH] Bug 26120: Remove the use of jquery.checkboxes plugin from > tags review template > >This patch removes the use of the jquery.checkboxes plugin and improves >the handling of tag status markup so that the "Select all pending" >selection link works correctly. > >To test, apply the patch and go to Tools -> Tags. To test properly you >should have multiple tags awaiting moderation. > > - 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(-) > >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 32af227d02..e588174d32 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt >+++ b/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; } > <thead> > <tr> > <th class="NoSort"> </th> >- <th class="NoSort"> </th> > <th>Status</th> > <th>Term</th> > <th>Weight</th> >@@ -89,18 +88,28 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } > <tbody> > [% FOREACH tagloo IN tagloop %] > <tr> >- <td class="count">[% offset + loop.count | html %] >- </td> >- [% IF ( tagloo.approved == 0 ) %]<td><span><input type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" /></span> >- [% ELSE %]<td><span><input type="checkbox" value="[% tagloo.term | html %]" name="tags" /></span>[% END %] >+ <td> >+ [% IF ( tagloo.approved == 0 ) %] >+ <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="pending" /> >+ [% ELSIF ( tagloo.approved == 1 ) %] >+ <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="approved" /> >+ [% ELSE %] >+ <input id="checkbox[% offset + loop.count | html %]" type="checkbox" value="[% tagloo.term | html %]" name="tags" class="rejected" /> >+ [% END %] > </td> > <td> > [% IF ( tagloo.approved == -1 ) %] >- <span class="rejected status[% offset + loop.count | html %]">Rejected</span> >+ <label for="checkbox[% offset + loop.count | html %]"> >+ <span class="rejected status[% offset + loop.count | html %]">Rejected</span> >+ </label> > [% ELSIF ( tagloo.approved == 1 ) %] >- <span class="approved status[% offset + loop.count | html %]">Approved</span> >+ <label for="checkbox[% offset + loop.count | html %]"> >+ <span class="approved status[% offset + loop.count | html %]">Approved</span> >+ </label> > [% ELSE %] >- <span class="pending status[% offset + loop.count | html %]">Pending</span> >+ <label for="checkbox[% offset + loop.count | html %]"> >+ <span class="pending status[% offset + loop.count | html %]">Pending</span> >+ </label> > [% END %] > </td> > <td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term|uri %]">[% tagloo.term | html %]</a> >@@ -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 %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js b/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js >index 842ffb9acf..f5ee5245d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js >+++ b/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("<div id=\"searchheader\"><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-check\" aria-hidden=\"false\"><\/i> " + __("Select all") + "<\/a> | <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-remove\" aria-hidden=\"false\"><\/i> " + __("Clear all") + "<\/a> | <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\"> " + __("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("<i class='fa fa-remove' aria-hidden='false'></i> " + __("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 { >-- >2.11.0
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 26120
:
107721
|
110819
|
110821