{% macro select(field, hint=None, disable=[], option_hints={}, hide_legend=False, collapsible_opts={}, legend_style="text", input="radio", inline=False) %} {% call select_wrapper( field, hint, disable, option_hints, hide_legend, collapsible_opts, legend_style, inline=inline ) %} {% for option in field %} {{ select_input(option, disable, option_hints, input=input) }} {% endfor %} {% endcall %} {% endmacro %} {% macro select_list(options, child_map, disable=[], option_hints={}, input="radio", indent_level=0) %} {% for option in options %} {% if child_map[option.data] %}
{{ select_input(option, disable, option_hints, as_list_item=False, input=input) }}
{{ select_list(child_map[option.data], child_map, disable, option_hints, input=input, indent_level=indent_level + 1) }} {% else %}
{{ select_input(option, disable, option_hints, as_list_item=False, input=input) }}
{% endif %} {% endfor %} {% endmacro %} {% macro select_nested(field, child_map, hint=None, disable=[], option_hints={}, hide_legend=False, collapsible_opts={}, legend_style="text", input="radio") %} {% call select_wrapper( field, hint, disable, option_hints, hide_legend, collapsible_opts, legend_style ) %}
{{ select_list(child_map[None], child_map, disable, option_hints, input=input) }}
{% endcall %} {% endmacro %} {% macro select_wrapper(field, hint=None, disable=[], option_hints={}, hide_legend=False, collapsible_opts={}, legend_style="text", inline=False) %} {% set is_collapsible = collapsible_opts|length %}
{% if is_collapsible %}
{% endif %}
{% if hide_legend %}{% endif %} {{ field.label.text|safe }} {% if hide_legend %}{% endif %} {% if hint %} {{ hint }} {% endif %} {% if field.errors %} {{ field.errors[0] }} {% endif %} {{ caller() }}
{% endmacro %} {% macro select_input(option, disable=[], option_hints={}, data_target=None, as_list_item=False, input="radio") %}
{% if caller %} {{ caller() }} {% endif %}
{% endmacro %}