From 6caeb1f6274ead6509b27edcdc701d1c6d1d3c9e Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Mon, 6 Feb 2023 18:06:26 +0000 Subject: [PATCH] Bug 32341: (follow-up) Making the remains OPAC tables responsive Apply the patch and check for the responsivity of the following tables 1- Go to the OPAC 2- Open mobile mode 3- The following tables are not responsive - Summary - Clubs - Summary - Recalls - Summary - Article requests - Charges - (relative's) - Search history - Authority - Checkout history - All - Checkout history - Checkouts - Checkout history - On-site - Recalls history - Messaging - Subscription (serial) - Course reserves - Courses - Course reserves - Reserves - Authority search results 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 previous step (1-3) 8- Confirm that the tables are now displayed correctly and is now responsive. Signed-off-by: David Cook Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/css/src/_responsive.scss | 4 +- .../bootstrap/en/includes/account-table.inc | 4 +- .../bootstrap/en/modules/clubs/clubs-tab.tt | 19 ++++++++ .../bootstrap/en/modules/opac-account.tt | 4 ++ .../opac-authoritiessearchresultlist.tt | 25 ++++++++++- .../en/modules/opac-course-details.tt | 10 ++++- .../en/modules/opac-course-reserves.tt | 10 ++++- .../bootstrap/en/modules/opac-detail.tt | 44 +++++++++++-------- .../bootstrap/en/modules/opac-messaging.tt | 14 ++++++ .../en/modules/opac-readingrecord.tt | 12 ++++- .../bootstrap/en/modules/opac-recalls.tt | 8 +++- .../en/modules/opac-search-history.tt | 10 ++--- .../bootstrap/en/modules/opac-user.tt | 28 +++++++++--- 13 files changed, 153 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss index 791a4d71f0..07359bec3f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_responsive.scss @@ -257,11 +257,11 @@ display: block; } - #finestable tfoot tr { + table.finestable tfoot tr { display: flex !important; width: max-content; } - #finestable tfoot td, #finestable tfoot th { + table.finestable tfoot td, table.finestable tfoot th { display: flex !important; } } 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 71a8de27da..f0d85e087a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc @@ -1,7 +1,7 @@ [% PROCESS 'accounts.inc' %]
[% IF ( ACCOUNT_LINES ) %] - +
@@ -88,7 +88,7 @@ [% FOREACH r IN relatives %]

[% r.patron.firstname | html %] [% r.patron.surname | html %]'s fines and charges

-
Your charges
+
[% IF ENABLE_OPAC_PAYMENTS %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt index b18cd068d4..162189c8da 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt @@ -12,6 +12,7 @@ + @@ -30,6 +31,7 @@ Contact your library to be disenrolled from this club. [% END %] + [% END %] @@ -46,6 +48,7 @@ + @@ -63,6 +66,7 @@ You must have an email address to enroll [% END %] + [% END %] @@ -98,4 +102,19 @@ function cancelEnrollment( id ) { }); return false; } +var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); +Tables.each(function(){ + $(this).dataTable($.extend(true, {}, dataTablesDefaults, { + "searching": false, + "paging": false, + "info": false, + "autoWidth": false, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "columnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 } + ], + })); +}); 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 2dec22c620..8786a6fc31 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt @@ -99,6 +99,10 @@ $( document ).ready(function() { "responsive": true, } )); + $('table[id^="finestable-"]').dataTable($.extend(true, {}, dataTablesDefaults, { + "responsive": true + } )); + $("#filter_p").html('

'+txtActivefilter+''); $('#filter_paid').click(function(e) { e.preventDefault(); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt index 20cd6545ff..d02d8f09e6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt @@ -96,11 +96,13 @@

- + + [% UNLESS ( isEDITORS ) %] [% END %] + @@ -124,6 +126,7 @@ [% END %] [% END %] + [% END %] @@ -140,4 +143,22 @@ [% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %][% END %] +[% BLOCK jsinclude %] + [% INCLUDE 'datatables.inc' %] + +[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index 19700c6e7d..42df1cef2e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -74,6 +74,7 @@ + @@ -105,6 +106,7 @@ Record URL [% END %] + [% END %] @@ -134,7 +136,13 @@ "language": { "search": "_INPUT_", "searchPlaceholder": _("Search course reserves") - } + }, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "aoColumnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 }, + ], }, columns_settings ); }); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt index c0437f0250..0b5e0aabf3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-reserves.tt @@ -45,6 +45,7 @@ + @@ -62,6 +63,7 @@ [% END %] + [% END %]
 Description Date enrolled  
Name Description  
Authority search results
Authorized headingsAuthorized headings Type of headingRecords
Date due Notes Link
[% tp('Semester', 'Term') | html %] Instructors Notes
[% c.public_note | $raw %]
@@ -87,7 +89,13 @@ "language": { "search": "_INPUT_", "searchPlaceholder": _("Search courses") - } + }, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "aoColumnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 }, + ], }, columns_settings ); }); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 230e19b9fb..dfb0a15fb4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -758,6 +758,7 @@ Received date Status Note + @@ -770,6 +771,7 @@ [% INCLUDE 'serial-status.inc' serial = latestserial %] [% latestserial.notes | html %] + [% END # / FOREACH latestserials %] @@ -1740,31 +1742,26 @@ KohaTable("#holdingst", { dom: '<"clearfix">t', - "columnDefs": [ - { "targets": [ -1 ], "sortable": false, "searchable": false }, - ], + "aoColumnDefs": [ + { "className": "dtr-control", "orderable": false, "targets": -1 } + ], "bKohaColumnsUseNames": true, "autoWidth": false, "responsive": { - "details": { - "type": 'column', - "target": -1 - } - }, - aoColumnDefs: [ { - className:"dtr-control", - orderable: false, - targets: [-1], - } ], + "details": { "type": 'column', "target": -1 } + } }, columns_settings); KohaTable("#otherholdingst", { dom: '<"clearfix">t', - "columnDefs": [ - { "targets": [ -1 ], "sortable": false, "searchable": false }, - ], + "aoColumnDefs": [ + { "className": "dtr-control", "orderable": false, "targets": -1 } + ], "bKohaColumnsUseNames": true, - "autoWidth": false + "autoWidth": false, + "responsive": { + "details": { "type": 'column', "target": -1 } + } }, columns_settings); var serial_column_settings = [% TablesSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; @@ -1773,9 +1770,20 @@ dom: '<"clearfix">t', "sorting": [[ 1, "desc" ]], "autoWidth": false, - "bKohaColumnsUseNames": true + "bKohaColumnsUseNames": true, + "responsive": { + "details": { "type": 'column', "target": -1 } + }, + "aoColumnDefs": [ + { "className": "dtr-control", "orderable": false, "targets": -1 } + ], }, serial_column_settings); + var dTables = $("#holdingst,#subscriptionst,#otherholdingst"); + $('a[data-toggle="tab"]').on('shown.bs.tab', function (event) { + dTables.DataTable().responsive.recalc(); + } ); + [% IF ( TagsInputEnabled && loggedinusername ) %] $(".tag_add").click(function(){ var thisid = $(this).attr("id"); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index 863e56664b..cf3dd4c555 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -56,6 +56,7 @@ [% IF Koha.Preference('PhoneNotification') %]Phone[% END %] Email Digests only + @@ -171,6 +172,7 @@ [% ELSE %] - [% END %] + [% END # / FOREACH messaging_preferences%] @@ -254,6 +256,7 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] + [% INCLUDE 'datatables.inc' %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt index 7277a12824..528e6bc836 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -112,6 +112,7 @@ [% IF ( OPACMySummaryHTML ) %] Links [% END %] + @@ -189,6 +190,7 @@ [% IF OPACMySummaryHTML %] [% issue.MySummaryHTML | $raw %] [% END %] + [% END # / FOREACH issue %] @@ -224,7 +226,15 @@ "language": { "search": "_INPUT_", "searchPlaceholder": _("Search") - } + }, + "responsive": { + "details": {"type": 'column',"target": -1} + }, + "aoColumnDefs": [ + { "className": "dtr-control","orderable": false,"targets": [-1] }, + { "visible": false, "targets": [0]}, + { "orderable": false, "targets": [1]} + ], }, columns_settings); $("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt index 833befc69d..c523cc9fda 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt @@ -41,6 +41,7 @@ Status Due date   + @@ -120,6 +121,7 @@ [% END %] [% END %] + @@ -146,10 +148,14 @@ return confirmDelete(_("Are you sure you want to remove this recall?")); }); $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { + "responsive": { + "details": { "type": 'column', "target": -1 } + }, "aoColumnDefs": [ { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false }, { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, - { "sType": "title-string", "aTargets" : [ "title-string" ] } + { "sType": "title-string", "aTargets" : [ "title-string" ] }, + { "className": "dtr-control", "orderable": false, "targets": -1 } ] })); }); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt index a6e9347072..135d9c2ebf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt @@ -289,7 +289,7 @@ "dom": '<"top"<"table_entries"><"table_controls"fB>>t', "columnDefs": [ { "targets": [ 0 ], "sortable": false, "searchable": false }, - {"className": 'dtr-control',"orderable": false,"targets": -1} + { "className": 'dtr-control', "orderable": false, "targets": -1 } ], "language": { "search": "_INPUT_", @@ -297,13 +297,13 @@ }, "autoWidth": false, "responsive": { - details: { - type: 'column', - target: -1 - } + "details": { "type": 'column',"target": -1 } }, })); + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + $(".historyt").DataTable().responsive.recalc(); + }); $(".CheckNone").click(function(e){ e.preventDefault(); var form = $(this).parents("form").get(0); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index b7df2e6f82..4703e89c33 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -852,6 +852,7 @@ Pickup location Status   + @@ -907,6 +908,7 @@ [% END %] [% END %] + @@ -935,6 +937,7 @@ Status Pickup library   + @@ -1011,6 +1014,7 @@ + [% END %] @@ -1207,7 +1211,8 @@ "columnDefs": [ { "targets": [ "nosort" ],"sortable": false,"searchable": false }, { "type": "anti-the", "targets" : [ "anti-the" ] }, - { "visible": false, "targets" : [ "hidden" ] } + { "visible": false, "targets" : [ "hidden" ] }, + { "className": 'dtr-control', "orderable": false, "targets": -1 } ], "language": { "search": "_INPUT_", @@ -1220,11 +1225,6 @@ target: -1 } }, - "columnDefs": [ { - className: 'dtr-control', - orderable: false, - targets: -1 - } ], buttons: [ /* Override default button set so that we can extend the options of print and csv */ 'clearFilter', 'copy', @@ -1246,8 +1246,24 @@ })); }); + var dataTables = $("#recalls-table,#article-requests-table"); + dataTables.each(function(){ + $(this).dataTable($.extend(true, {}, dataTablesDefaults, { + "searching": false, + "paging": false, + "info": false, + "autoWidth": false, + "responsive": { + "details": { "type": 'column',"target": -1 } + }, + "columnDefs": [ + { "className": 'dtr-control', "orderable": false, "targets": -1 } + ], + })); + }); $('a[data-toggle="tab"]').on('shown.bs.tab', function (event) { dTables.DataTable().responsive.recalc(); + dataTables.DataTable().responsive.recalc(); } ); $("body").on("click", "#buttons-ics", function(){ -- 2.39.5