From 0cab6ee3d43a2a52a2ff09ffc10ade010064bfa8 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 12 Apr 2024 07:38:23 +0000 Subject: [PATCH] Bug 36559: Add sticky table headers to transport cost matrix To test: 1. APPLY patch and regenerate CSS. ( yarn build ) 2. Have many, many branches. To test it is good to have more branches than in a standard k-t-d. 3. Go to Admin > Transport cost matrix 4. Scroll down and to the right, the table headers should stay visible. 5. Hover over any cell, a title should appear like 'Branch A / Branch B' 6. Test in Chrome and Firefox. This uses position: sticky which has recently gained more widespread browser support: https://caniuse.com/?search=sticky Signed-off-by: Brendan Lawlor Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer --- .../prog/css/src/staff-global.scss | 23 +++++++++++++++++++ .../en/modules/admin/transport-cost-matrix.tt | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) 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 808854350d..8519e74d8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4373,6 +4373,29 @@ input.renew { } } +/* transport cost matrix */ +#transport-cost-matrix { + table { + border-collapse: separate; /* Don't collapse */ + border-spacing: 0; + + tbody { + tr { + th, + td { + border: 1px solid #dddddd; + padding: 5px; + } + th { + position: sticky; + top: 0; + left: 0; + } + } + } + } +} + /* Permissions */ #permissionstree { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt index b84e41c76e..688f86dda1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt @@ -74,9 +74,9 @@ [% FOR bf IN branchfromloop %] - [% bf.name | html %] + [% bf.name | html %] [% FOR bt IN bf.branchtoloop %] - + [% IF bt.skip %]   [% ELSE %] -- 2.39.5