{% macro action_button_group(item=None, batch=False, group_cls="") %}
{% for a, _action in listing._actions.items() %} {% if not _action.hidden and (item or (batch and _action.batch)) %} {% endif %} {% endfor %}
{% endmacro %} {% macro filter_button_group(filter) %} {% set choices = filter(listing, items) %} {% set button_type = "btn-primary" if filter.active() else "btn-outline btn-outline-primary" %} {% if choices %}
{% if filter.toggle %} {{ filter.title }}  {% else %} {% endif %}
{% endif %} {% endmacro %}
{{ action_button_group(batch=True, group_cls="fl-batch-buttons d-none") }}
{% for filter in listing._filters %} {{ filter_button_group(filter) }} {% endfor %}
{{ count_str }}
{% for f in listing._columns %} {{ f.th() | safe }} {% endfor %} {% for item in items %} {% for f in listing._columns %} {{ f.td(item) | safe }} {% endfor %} {% endfor %}
{{ action_button_group(item=item) }}