{# Reusable macros for list pages #}
{# Text input filter #}
{% macro filter_text(id, label, placeholder='Filter...', wide=false) %}
{% endmacro %}
{# Multi-select dropdown filter
- id: Element ID
- label: Display label
- options: List of options - either strings or objects with 'value' and 'label' keys
- column: DataTable column index for client-side filtering (optional, omit for server-side)
- min_search: Minimum number of options to show search input (default: 5)
- with_search: Override to disable search entirely (default: true)
#}
{% macro multi_dropdown(id, label, options, column=none, min_search=5, with_search=true) %}
{% if with_search and options | length >= min_search %}
{% endif %}
{% for opt in options %}
{% if opt is string %}
{% else %}
{% endif %}
{% endfor %}
{% endmacro %}
{# Empty row for when no items found #}
{% macro empty_row(colspan, message='List is empty.') %}