From a71728199ff0d24e707e69f1b4954be771ec8b92 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Jan 2024 19:33:33 +0000 Subject: [PATCH] Bug 35883: Use template wrapper for accordions: Table settings administration This patch updates the table settings administration page so that Bootstrap accordion markup is generated by WRAPPERs. This patch also makes some changes to fix the automatic scroll when a table configuration button was clicked. To test, apply the patch and go to Administration -> Table settings. - The list of modules should be displayed as before: Collapsible panels where clicking the module name heading expands the corresponding panel of settings. - Test that direct links to configurable tables still work correctly: - Go to Administration -> Libraries. - Click the "Configure" button at the top of the table of libraries. - You should be taken to the table settings page. - The "Administration" panel should be expanded by default. - You should be scrolled down automatically to the "Libraries" table. --- .../prog/en/modules/admin/columns_settings.tt | 387 +++++++----------- 1 file changed, 148 insertions(+), 239 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt index 526391b4bd..1bd13164fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt @@ -22,14 +22,14 @@ [% IF tables.$pagename.keys and tables.$pagename.keys.size > 1 %] Jump to table: [% FOR tablename IN tables.$pagename.keys.sort %] - [% SET table_id = pagename _ '#' _ tablename %] + [% SET table_id = pagename _ '_' _ tablename %] [% tablename | html %] [% UNLESS loop.last %] | [% END %] [% END %] [% END %] [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %] [% FOR tablename IN tables.$pagename.keys.sort %] - [% SET table_id = pagename _ '#' _ tablename %] + [% SET table_id = pagename _ '_' _ tablename %]
[% IF pagename == 'additem' AND tablename == 'itemst' %] @@ -206,250 +206,159 @@
-

Table settings

-
-
- -
-
-

Acquisition tables

- [% PROCESS pagelist module=modules.acqui modulename="acqui" %] -
-
-
+ [% WRAPPER accordion panelgroup_id="modules" %] + [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="acqui" %] + Acquisition + [% END %] + [% WRAPPER accordion_panel panel_id="acqui" %] +

Acquisition tables

+ [% PROCESS pagelist module=modules.acqui modulename="acqui" %] + [% END %] + [% END %] -
- -
-
-

Administration tables

- [% PROCESS pagelist module=modules.admin modulename="admin" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="admin" %] + Administration + [% END %] + [% WRAPPER accordion_panel panel_id="admin" %] +

Administration tables

+ [% PROCESS pagelist module=modules.admin modulename="admin" %] + [% END %] + [% END %] -
- -
-
-

Authorities tables

- [% PROCESS pagelist module=modules.authorities modulename="authorities" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="authorities" %] + Authorities + [% END %] + [% WRAPPER accordion_panel panel_id="authorities" %] +

Authorities tables

+ [% PROCESS pagelist module=modules.authorities modulename="authorities" %] + [% END %] + [% END %] -
- -
-
-

Catalogue tables

- [% PROCESS pagelist module=modules.catalogue modulename="catalogue" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="catalogue" %] + Catalog + [% END %] + [% WRAPPER accordion_panel panel_id="catalogue" %] +

Catalogue tables

+ [% PROCESS pagelist module=modules.catalogue modulename="catalogue" %] + [% END %] + [% END %] -
- -
-
-

Cataloguing tables

- [% PROCESS pagelist module=modules.cataloguing modulename="cataloguing" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="cataloguing" %] + Cataloging + [% END %] + [% WRAPPER accordion_panel panel_id="cataloguing" %] +

Cataloguing tables

+ [% PROCESS pagelist module=modules.cataloguing modulename="cataloguing" %] + [% END %] + [% END %] -
- -
-
-

Circulation tables

- [% PROCESS pagelist module=modules.circ modulename="circ" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="circ" %] + Circulation + [% END %] + [% WRAPPER accordion_panel panel_id="circ" %] +

Circulation tables

+ [% PROCESS pagelist module=modules.circ modulename="circ" %] + [% END %] + [% END %] -
- -
-
-

Course reserves tables

- [% PROCESS pagelist module=modules.coursereserves modulename="coursereserves" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="coursereserves" %] + Course reserves + [% END %] + [% WRAPPER accordion_panel panel_id="coursereserves" %] +

Course reserves tables

+ [% PROCESS pagelist module=modules.coursereserves modulename="coursereserves" %] + [% END %] + [% END %] -
- -
-
-

E-resource management tables

- [% PROCESS pagelist module=modules.erm modulename="erm" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="erm" %] + E-resource management + [% END %] + [% WRAPPER accordion_panel panel_id="erm" %] +

E-resource management tables

+ [% PROCESS pagelist module=modules.erm modulename="erm" %] + [% END %] + [% END %] -
- -
-
-

Interlibrary loans tables

- [% PROCESS pagelist module=modules.illrequests modulename="illrequests" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="illrequests" %] + Interlibrary loans + [% END %] + [% WRAPPER accordion_panel panel_id="illrequests" %] +

Interlibrary loans tables

+ [% PROCESS pagelist module=modules.illrequests modulename="illrequests" %] + [% END %] + [% END %] -
- -
-
-

Patrons tables

- [% PROCESS pagelist module=modules.members modulename="members" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="members" %] + Patrons + [% END %] + [% WRAPPER accordion_panel panel_id="members" %] +

Patrons tables

+ [% PROCESS pagelist module=modules.members modulename="members" %] + [% END %] + [% END %] -
- -
-
-

Point of sale tables

- [% PROCESS pagelist module=modules.pos modulename="pos" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="pos" %] + Point of sale + [% END %] + [% WRAPPER accordion_panel panel_id="pos" %] +

Point of sale tables

+ [% PROCESS pagelist module=modules.pos modulename="pos" %] + [% END %] + [% END %] -
- -
-
-

Tools tables

- [% PROCESS pagelist module=modules.tools modulename="tools" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="tools" %] + Tools + [% END %] + [% WRAPPER accordion_panel panel_id="tools" %] +

Tools tables

+ [% PROCESS pagelist module=modules.tools modulename="tools" %] + [% END %] + [% END %] -
- -
-
-

OPAC tables

- [% PROCESS pagelist module=modules.opac modulename="opac" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="opac" %] + OPAC + [% END %] + [% WRAPPER accordion_panel panel_id="opac" %] +

OPAC tables

+ [% PROCESS pagelist module=modules.opac modulename="opac" %] + [% END %] + [% END %] -
- -
-
-

Reports tables

- [% PROCESS pagelist module=modules.reports modulename="reports" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="reports" %] + Reports + [% END %] + [% WRAPPER accordion_panel panel_id="reports" %] +

Reports tables

+ [% PROCESS pagelist module=modules.reports modulename="reports" %] + [% END %] + [% END %] -
- -
-
-

Serials tables

- [% PROCESS pagelist module=modules.serials modulename="serials" %] -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="serials" %] + Serials + [% END %] + [% WRAPPER accordion_panel panel_id="serials" %] +

Serials tables

+ [% PROCESS pagelist module=modules.serials modulename="serials" %] + [% END %] + [% END %] + [% END # /WRAPPER accordion %] -
@@ -468,15 +377,15 @@ $(document).ready( function() { $("#[% panel | uri %]Toggle").click(); [%- IF page.defined -%] - $("#[% panel | uri %]").on('shown.bs.collapse', function () { - $('html, body').animate({ - [%- IF table.defined -%] - scrollTop: ($("#[% page | uri %]\\#[% table | uri %]").offset().top) - [%- ELSE -%] - scrollTop: ($("#[% page | uri %]").offset().top) - [%- END -%] - }, 500); - }); + $("#[% panel | uri %]_panel").on('shown.bs.collapse', function () { + $('html, body').animate({ + [%- IF table.defined -%] + scrollTop: ($("#[% page | uri %]_[% table | uri %]").offset().top) + [%- ELSE -%] + scrollTop: ($("#[% page | uri %]").offset().top) + [%- END -%] + }, 500); + }); [%- END -%] }); -- 2.30.2