From e0964c19ecb69abc25014686beed337ff9230dd5 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 (cherry picked from commit ea411a563a3bd57a1fa8fbb8a75ddf0a5a5a44fc) Signed-off-by: Jacob O'Mara --- .../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 981fd41f36..b8bced4d13 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -38,7 +38,7 @@ [% BLOCK list_permissions %]
  • - [% IF shelf.allow_change_from_owner %][% ELSE %][% END %] @@ -236,7 +236,7 @@ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] - Send list + Send list [% END %] Print list @@ -547,14 +547,6 @@ [% END %] - [% IF can_manage_shelf %] -
    - - - - -
    - [% END %] [% END # / IF itemsloop %] [% END # /IF shelf AND op == 'view' %] @@ -610,7 +602,7 @@ [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
  • - [% IF shelf.is_private %] [% ELSE %] @@ -1057,6 +1049,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