From 3f350f58478ff8edf70944fcfcc7d5b083c88c09 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 15 Feb 2017 00:03:28 +0000 Subject: [PATCH] Bug 7626: Delete multiple tags in OPAC at once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch removes the individual 'Delete' buttons for every tag as suggested in Comment 0. It adds a checkbox to every tag, with a 'Delete selected tags' button at the bottom of the table. This patch also adds a function to check if any checkboxes have been checked before submitting the form (only works with JS enabled). To test: 1) Find a record in the OPAC and add some tags to it 2) Go to your tags and notice the checkboxes, no more delete buttons for each tag 3) Click 'Delete selected tags' button without selecting any tags 4) Confirm alert shows up. Click OK 5) Select one or more tags and click 'Delete selected tags' button 6) Confirm delete is successful and correct number of deleted tags shows up Sponsored-by: Catalyst IT Followed test plan, works as expected Signed-off-by: Marc VĂ©ron --- .../opac-tmpl/bootstrap/en/modules/opac-tags.tt | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt index 052acd6..4d6a428 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -105,21 +105,24 @@ [% END # / TAGLOOP%] [% IF ( add_op ) %] [% IF ( added_count ) %] -
[% added_count %] [% IF ( added_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully added.
+
[% added_count %] [% IF ( added_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully added.
[% END %] [% IF ( deleted_count ) %] -
[% deleted_count %][% IF ( deleted_count ==1 ) %] tag[% ELSE %]tags[% END %] successfully deleted.
+
[% deleted_count %] [% IF ( deleted_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully deleted.
[% END %] [% END # /add_op %] [% IF ( MY_TAGS ) %] -
+

Your tags

- + [% FOREACH MY_TAG IN MY_TAGS %] + - - [% END %]
TermTitleDate addedDelete
 TermTitleDate added
+ + Tag: [% IF MY_TAG.approved == 1 %] @@ -128,7 +131,6 @@ [% MY_TAG.term |html %] (not approved) [% END %] [% IF ( MY_TAG.XSLTBloc ) %] [% MY_TAG.XSLTBloc %] @@ -153,11 +155,11 @@ [% MY_TAG.date_created | $KohaDates %]
+
[% END # /MY_TAGS %] @@ -171,17 +173,29 @@ [% INCLUDE 'datatables.inc' %]