From 16008c24c5ec0838eb61b5e19603104b2071c004 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Thu, 16 Feb 2023 18:06:56 +0000 Subject: [PATCH] Bug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button style for finestables To activate Curbside pickups 1- Enable the CurbsidePickup system preference 1.1 Go to Administration > Global system preferences 1.2 Search for CurbsidePickup 1.3 Change the value for 'Enable' 1.4 Click on 'Save all circulation preferences' 2- Configure time slots for at least one library 2.1 Go to Administration > Curbside pickup 2.2 Fill out the form for Centerville (or another library) Enable: Check Pickup interval: 10 (or other) Maximum boss per interval: 3 (or other) Patron-scheduled pickup: Check Enable for waiting holds only: DO NOT check 2.3 Add a time slot In 'New slot', enter Monday From: 10:00 To: 12:00 Click on 'Add' 3- Make an appointment from the OPAC 3.1 Go to OPAC 3.2 Open mobile mode 3.3 Connect with a user 3.4 Click on 'Curbside pickups' 3.5 Choose the library in 'Pick a library' 3.6 Choose a date in 'Pickup date' 3.7 Choose a time range in 'Select a time' 3.8 Click on 'Schedule pickup' => Notice The table is not responsive 4- Apply the patch 5- Execute 'yarn build --view opac' 6- Clean your cache or open your navigator on private mode (to load updated css files) 7- Perform step 3.1, 3.2, 3.3, 3.4, 8- click on 'Your pickups' => Confirm that the CurbsidePickup table are now displayed correctly and is now responsive. 9- Click on 'Charges' => Confirm that the Charges table are now displayed correctly and is now responsive. I correct a little bug. The "suspend_hold" button did not work anymore. This change resets it to it's original state. Signed-off-by: David Cook Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/css/src/_responsive.scss | 8 ------ .../bootstrap/en/includes/account-table.inc | 6 ++++ .../bootstrap/en/modules/opac-account.tt | 28 +++++++++++++++++-- .../en/modules/opac-curbside-pickups.tt | 15 ++++++++++ .../bootstrap/en/modules/opac-user.tt | 2 +- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss index 07359bec3f..d9d630feee 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss @@ -256,14 +256,6 @@ #checkouts_filter { display: block; } - - table.finestable tfoot tr { - display: flex !important; - width: max-content; - } - table.finestable tfoot td, table.finestable tfoot th { - display: flex !important; - } } @media only screen and ( max-width: 700px ) { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc index f0d85e087a..dcd0b0f1bb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -12,6 +12,7 @@ Description Amount Amount outstanding + @@ -39,6 +40,7 @@ [% IF ( ACCOUNT_LINE.is_credit ) %][% ACCOUNT_LINE.amount * -1 | $Price %][% ELSE %][% ACCOUNT_LINE.amount | $Price %][% END %] [% IF ( ACCOUNT_LINE.is_credit ) %][% ACCOUNT_LINE.amountoutstanding * -1 | $Price %][% ELSE %][% ACCOUNT_LINE.amountoutstanding | $Price %][% END %] + [% END %] @@ -52,6 +54,7 @@ [%- END -%] Total due [% total | $Price %] + [% IF outstanding_credits.total_outstanding < 0 %] [% FOREACH outstanding_credit IN outstanding_credits %] @@ -97,6 +100,7 @@ Description Fine amount Amount outstanding + @@ -124,6 +128,7 @@ [% IF ( a.amount < 0 ) %][% ELSE %][% END %][% a.amount | $Price %] [% IF ( a.amountoutstanding < 0 ) %][% ELSE %][% END %][% a.amountoutstanding | $Price %] + [% END %] @@ -132,6 +137,7 @@ Total due [% account_sum | $Price %] + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt index 8786a6fc31..adf358c116 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -96,13 +96,37 @@ $( document ).ready(function() { [% END %] "dom": '<"#filter_p">', "autoWidth": false, - "responsive": true, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "columnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 } + ], + 'fnDrawCallback': function() { + show_hiddentfoot('#finestable'); + } } )); $('table[id^="finestable-"]').dataTable($.extend(true, {}, dataTablesDefaults, { - "responsive": true + "autoWidth": false, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "columnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 } + ], + 'fnDrawCallback': function() { + show_hiddentfoot('table[id^="finestable-"]'); + } } )); + function show_hiddentfoot(selector) { + $('.finestable tfoot .sum').show(); + if ($(".finestable tfoot td.dtr-hidden").length > 0) { + $(selector+" tfoot th").removeAttr( "colspan" ); + $(".finestable tfoot .dtr-control").hide(); + } + } $("#filter_p").html('

'+txtActivefilter+''); $('#filter_paid').click(function(e) { e.preventDefault(); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt index 992e0dbae5..46bc3b157c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-curbside-pickups.tt @@ -179,6 +179,7 @@ Schedule Notes Actions + @@ -211,6 +212,7 @@ Cancel this pickup + [% END %] @@ -280,6 +282,7 @@ [% INCLUDE 'calendar.inc' %] + [% INCLUDE 'datatables.inc' %]