Bug 35877

Summary: Use template wrapper to build Bootstrap accordion components
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Julian Maurice <julian.maurice>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, julian.maurice
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 35880, 35882, 35883    
Attachments: Bug 35877: Use template wrapper to build Bootstrap accordion components
Bug 35877: Use template wrapper to build Bootstrap accordion components
Bug 35877: Use template wrapper to build Bootstrap accordion components
Bug 35877: (follow-up) Correct accordion wrapper parameter name
Bug 35877: Use template wrapper to build Bootstrap accordion components
Bug 35877: (follow-up) Correct accordion wrapper parameter name

Description Owen Leonard 2024-01-23 18:53:05 UTC
Like the conversion of Bootstrap tabs to WRAPPER-generated markup, I would like to create a set of WRAPPERs for Bootstrap accordion components, found on these pages:

- Table settings
- Notice editor
- Patrons requesting modification
Comment 1 Owen Leonard 2024-01-24 12:50:03 UTC Comment hidden (obsolete)
Comment 2 David Nind 2024-02-04 22:41:28 UTC
Created attachment 161739 [details] [review]
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 <david@davidnind.com>
Comment 3 Julian Maurice 2024-02-16 09:42:58 UTC
The documentation says:

[ WRAPPER accordion id="accordion container id" ]

but `id` is not used inside accordion block. `panelgroup_id` is used instead.

Bug 35880 and bug 35883 use `panelgroup_id` but bug 35882 uses `id`.

Either the doc should be fixed or the block should be fixed to match the doc.
Comment 4 Owen Leonard 2024-03-22 16:44:58 UTC
Created attachment 163719 [details] [review]
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 <david@davidnind.com>
Comment 5 Owen Leonard 2024-03-22 16:45:00 UTC
Created attachment 163720 [details] [review]
Bug 35877: (follow-up) Correct accordion wrapper parameter name
Comment 6 Julian Maurice 2024-03-26 08:32:51 UTC
Created attachment 163886 [details] [review]
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 <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Julian Maurice 2024-03-26 08:32:54 UTC
Created attachment 163887 [details] [review]
Bug 35877: (follow-up) Correct accordion wrapper parameter name

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 8 Katrin Fischer 2024-03-26 10:21:59 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-05-22 13:33:08 UTC
Enhancement not backported
Comment 10 Caroline Cyr La Rose 2024-07-04 18:21:32 UTC
Code structure change, nothing to add/edit in the manual.