From 2718bd4bb0be5ca972a4615e6ee24005b0e47e46 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 27 Sep 2023 15:42:26 +0000 Subject: [PATCH] Bug 34934: Remove the use of event attributes from OPAC lists page This patch removes the use of event attributes (onclick, onchange) from the OPAC lists template. These events are defined now along with the other in-page JS. The patch also removes a "delete list" button which was only shown when viewing an empty list and which was redundant. To test, apply the patch and log into the OPAC. - Go to Lists -> New list. - Change the category to "Private" and the "Allow changes" dropdown to "Staff only." - You should see a message, 'The "Staff only" permission has no actual effect while this list is strictly private' - Change the category to "Public." The message should disappear. - View the contents of a list. - Click the "Send list" button at the top of the table of titles. - It should trigger the "Sending your list" popup window. Signed-off-by: Pedro Amorim --- .../bootstrap/en/modules/opac-shelves.tt | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 6e352839c4..671e0c33d3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -39,7 +39,7 @@ [% BLOCK list_permissions %]
  • - [% IF shelf.allow_change_from_owner %][% ELSE %][% END %] @@ -241,7 +241,7 @@ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] - Send list + Send list [% END %] Print list @@ -567,14 +567,6 @@ [% END %] - [% IF can_manage_shelf %] -
    - - - - -
    - [% END %] [% END # / IF itemsloop %] [% END # /IF shelf AND op == 'view' %] @@ -630,7 +622,7 @@ [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
  • - [% IF shelf.is_private %] [% ELSE %] @@ -1079,6 +1071,16 @@ $(function() { $("#download_list").submit(); }); + $("#allow_changes_from, #public").on("change", function(){ + AdjustRemark(); + }); + + $(".send").on("click", function(e){ + e.preventDefault(); + let link = this.href; + Dopop( link ); + }); + }); // document.ready function sortMenu( sorting_form ){ -- 2.30.2