{# Workspace drawer for grouped, persistent filter controls. The data remains the standard GridViewFilters schema; sections only choose a visual grouping. #} {% macro render_option(filter, option, selected, depth=0, parent='') -%} {% for child in option.children %}{{ render_option(filter, child, selected, depth + 1, option.value) }}{% endfor %} {%- endmacro %} {% macro render_filter(filter, section) -%} {% set selected = fb.state.values.get(filter.param, ()) if fb.state else () %} {% if filter.drawer_control in ('checklist', 'tree') or filter.type in ('multiselect', 'set') %}
{% if filter.select_all %} {% endif %} {% for option in filter.options %}{{ render_option(filter, option, selected) }}{% endfor %}
{% elif filter.type == 'grouped_select' %}
{% for option in filter.options %} {% endfor %}
{% elif filter.type == 'select' %} {% elif filter.type == 'boolean' or filter.drawer_control == 'toggle' %} {% else %} {% set selected_value = selected if selected is string or selected is number else '' %} {% endif %} {%- endmacro %} {% set active_workspace_panel = workspace_panel | default('filters') %} {% set workspace_sections = fb.drawer_sections | selectattr('panel', 'equalto', active_workspace_panel) | list %} {% if workspace_sections %}
{% if active_workspace_panel == 'filters' and fb.drawer_search %} {% endif %}
{% for section in workspace_sections %}

{{ section.label | e }}

{% if section.searchable %} {% endif %} {% for filter in fb.schema if filter.id in section.filter_ids %}{{ render_filter(filter, section) }}{% endfor %}
{% endfor %}
{% if active_workspace_panel == 'filters' %} {% endif %}
{% endif %}