{% from "macros/nswdesignsystem/_accordion_toggle_all.html" import toggle_all with context %} {% from "macros/nswdesignsystem/_accordion_wrapper.html" import wrapper with context %} {% from "macros/nswdesignsystem/_accordion_title.html" import title with context %} {% from "macros/nswdesignsystem/_accordion_content.html" import content with context %} {# Generic accordion. Example: {% call(idx, part) accordion(["hello", "world"]) %} {% if idx == 0 %} Hello content {% elif idx == 0 %} World content {% endif %} {% endcall %} #} {% macro accordion(length_or_headers, with_toggle_all=false, toggle_all_labels=[], open=[]) %} {% if length_or_headers is iterable %} {% set headers = length_or_headers %} {% set length = headers | length %} {% else %} {% set headers = [] %} {% set length = length_or_headers %} {% endif %}