From a11ba52f2e057ab3b10da6c90612586805ab3dba Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Jan 2024 18:54:02 +0000 Subject: [PATCH] Bug 35877: Use template wrapper to build Bootstrap accordion components This patch adds Template::Toolkit WRAPPER blocks to html_helpers.inc so that templates can build Bootstrap accordion components while keeping the Bootstrap structural markup separate. Each individual component of a Bootstrap accordion interface is defined: - Group container - Collapsible item - Item heading - Item content Included is a usage example: [ WRAPPER accordion id="accordion container id" ] [ WRAPPER accordion_item ] [ WRAPPER accordion_heading panel_id = "panel id" ] [Clickable panel heading ] [ END ] [ WRAPPER accordion_panel panel_id = "panel id" ] [Expanding content panel] [ END ] [ END ] [ END ] To test, apply this patch and one of the dependent patches. Signed-off-by: David Nind Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer --- .../prog/en/includes/html_helpers.inc | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index 535cbca2c9..cda7dca981 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -473,3 +473,44 @@ [% END %] [% END %] + +[% # [ WRAPPER accordion id="accordion container id" ] %] +[% # [ WRAPPER accordion_item ] %] +[% # [ WRAPPER accordion_heading panel_id = "panel id" ] %] +[% # [Clickable panel heading ] %] +[% # [ END ] %] +[% # [ WRAPPER accordion_panel panel_id = "panel id" ] %] +[% # [Expanding content panel] %] +[% # [ END ] %] +[% # [ END ] %] +[% # [ END ] %] + +[% BLOCK accordion %] +
+ [% content | $raw %] +
+[% END %] + +[% BLOCK accordion_item %] +
+ [% content | $raw %] +
+[% END %] + +[% BLOCK accordion_heading %] + +[% END %] + +[% BLOCK accordion_panel %] +
+
+ [% content | $raw %] +
+
+[% END %] -- 2.39.5