From b2d877b07c2a2bf963c76fe6f022d5b7537b8b3d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 7 Apr 2022 16:02:37 +0000 Subject: [PATCH] Bug 30494: Replace the use of jQueryUI Accordion on the table settings page This page updates the table settings page so that it uses Bootstrap's "Collapse" feature instead of jQueryUI's Accordion. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Go to Administration -> Table settings. - You should see a list of table settings which looks much the same as it did before, with arrow icons prefixing each section header. All panels should be collapsed. - Test expanding and collapsing panels to confirm it's working correctly. - When you expand a section the heading arrow should change from right-pointing to down. - Make a change to one of the table configurations. After clicking "Save" the page should reload with the same panel expanded. Signed-off-by: Lucas Gass Signed-off-by: Tomas Cohen Arazi Signed-off-by: Fridolin Somers --- admin/columns_settings.pl | 2 +- .../prog/css/src/staff-global.scss | 71 +++++ .../prog/en/modules/admin/columns_settings.tt | 275 +++++++++++++----- 3 files changed, 276 insertions(+), 72 deletions(-) diff --git a/admin/columns_settings.pl b/admin/columns_settings.pl index d5b0df9dca..4d040e96a1 100755 --- a/admin/columns_settings.pl +++ b/admin/columns_settings.pl @@ -74,7 +74,7 @@ if ( $action eq 'save' ) { if ( $action eq 'list' ) { my $modules = C4::Utils::DataTables::TablesSettings::get_modules; $template->param( - panel => ( $input->param('panel') || 0 ), + panel => defined $input->param('panel') ? $input->param('panel') : undef, modules => $modules, ); } diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 2f84696730..3e06728f5c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3315,6 +3315,77 @@ button, padding: 3px 5px; } +/* Bootstrap Collapse */ + +.panel { + background: #F4F8F9 none; + box-shadow: none; +} + +.panel-collapse { + background: #FFF none; +} + +.panel-title { + a { + border-radius: 3px; + display: block; + padding: 10px 15px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + + &::before { + content: "\f0d7"; + display: inline-block; + font-family: FontAwesome; + width: 1em; + } + + &:hover { + background: #e6f0f2 none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + &.collapsed { + &::before { + content: "\f0da"; + display: inline-block; + font-family: FontAwesome; + width: 1em; + } + + &:hover { + background: #e6f0f2 none; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + } + } + } +} + +.panel-default { + border: 1px solid #B9D8D9; + > .panel-heading { + background: transparent none; + padding: 0; + + + .panel-collapse { + > .panel-body { + border-top-color: #B9D8D9; + } + } + } +} + +.panel-group { + .panel { + + .panel { + margin-top: 3px; + } + } +} + #toolbar { .dropdown-menu { border-top-width: 1px; 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 1885e780db..0b4d54ecaa 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 @@ -201,89 +201,229 @@

Table settings

-
- -
-

Acquisition tables

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

Acquisition tables

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

Administration tables

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

Administration tables

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

Authorities tables

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

Authorities tables

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

Catalogue tables

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

Catalogue tables

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

Cataloguing tables

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

Cataloguing tables

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

Circulation tables

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

Circulation tables

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

Course reserves tables

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

Course reserves tables

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

Interlibrary loans tables

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

Interlibrary loans tables

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

Patrons tables

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

Patrons tables

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

Point of sale tables

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

Point of sale tables

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

Tools tables

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

Tools tables

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

OPAC tables

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

OPAC tables

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

Reports tables

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

Reports tables

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

Serials tables

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

Serials tables

+ [% PROCESS pagelist module=modules.serials modulename="serials" %] +
+
@@ -299,20 +439,13 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/admin-menu.js") | $raw %] - + + [%- END -%] [% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5