From ea411a563a3bd57a1fa8fbb8a75ddf0a5a5a44fc 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 56348379ec35bbccbb54e205cc180cc0bd4f9297) Signed-off-by: Fridolin Somers --- .../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 9a97f79a2b..c88f0120b4 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.39.5