{% macro drawRegionSelectorToolbar(namedSelections) -%}
{%- endmacro %} {% macro drawRegionSelectorChannels(groupedOptions, initialSelection, radio=None) -%} {% for groupName, options in groupedOptions %} {% set sectionWidth = 100 / (groupedOptions | length ) %}
{{ groupName }}
{% for value, label in options %} {% set selected = value in initialSelection %} {% endfor %}
{% endfor %} {%- endmacro %} {% macro drawRegionSelector(title, divId, groupedOptions, initialSelection=[], namedSelections=[], radio=false) -%}
{{ title }}
{% if not radio %} {{ drawRegionSelectorToolbar(namedSelections) }} {% endif %} {{ drawRegionSelectorChannels(groupedOptions, initialSelection, divId if radio else none) }}
{%- endmacro %}