diff --git a/installer/data/mysql/atomicupdate/bug_39698_add_syspref_for_responsive_opac_tables.pl b/installer/data/mysql/atomicupdate/bug_39698_add_syspref_for_responsive_opac_tables.pl new file mode 100755 index 0000000000..2b83da7fde --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39698_add_syspref_for_responsive_opac_tables.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => "39698", + description => "Add system preferences for responsive OPAC tables", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + VALUES ('OPACTableColExpandedByDefault', '0', NULL, 'Determines whether or not table rows are expanded by default on mobile', 'YesNo'); + } + ); + say $out "Added OPACTableColExpandedByDefault syspref"; + + } +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 585d7a5d8d..3793a88ebc 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -590,6 +590,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacSuppression','0',NULL,'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'), ('OpacSuppressionByIPRange','',NULL,'Restrict the suppression to IP adresses outside of the IP range','Free'), ('OpacSuppressionRedirect','1',NULL,'Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','YesNo'), +('OPACTableColExpandedByDefault','0',NULL,'Determines whether or not table rows are expanded by default on mobile','YesNo'), ('opacthemes','bootstrap',NULL,'Define the current theme for the OPAC interface.','Themes'), ('OpacTopissue','0',NULL,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server','YesNo'), ('OpacTrustedCheckout', '0', NULL, 'Allow logged in OPAC users to check out to themselves', 'YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 37202dc17c..7e038fad75 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -18,6 +18,12 @@ OPAC: - pref: opacthemes choices: opac-templates - theme on the OPAC. + - + - pref: OPACTableColExpandedByDefault + choices: + 1: Expand + 0: Don't expand + - tables on the OPAC by default, when zoomed in or viewed on a mobile screen. - - Use the - pref: OPACFallback 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 0e56b7e112..fae8e23d88 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 @@ -96,6 +96,12 @@ return false; } + [% IF ( Koha.Preference('OPACTableColExpandedByDefault') ) %] + var responsive_display = DataTable.Responsive.display.childRowImmediate; + [% ELSE %] + var responsive_display = DataTable.Responsive.display.childRow; + [% END %] + var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); Tables.each(function(){ $(this).kohaTable({ @@ -103,7 +109,11 @@ paging: false, info: false, responsive: { - details: { type: "column", target: -1 }, + details: { + display: responsive_display, + type: "column", + target: -1 + }, }, columnDefs: [ { className: "dtr-control", orderable: false, targets: -1 }, 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 650524815b..67a2721175 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt @@ -121,12 +121,22 @@ [% INCLUDE 'datatables.inc' %]