{# Filterable table component — Alpine dzTable for all state #} {% if table %}
{# Header row: title + actions #} {% block table_header %}

{{ table.title }}

{# Column visibility toggle #} {% if table.columns | length > 3 %}
{% for col in table.columns %} {% if not col.hidden %} {% endif %} {% endfor %}
{% endif %} {% if table.create_url %} + New {{ table.entity_name }} {% endif %}
{% endblock table_header %} {# Search bar #} {% if table.search_enabled %} {% with endpoint=table.api_endpoint, target='#' + (table.table_id or 'dt-table') + '-body' %} {% include 'fragments/search_input.html' with context %} {% endwith %} {% endif %} {# Filter bar #} {% set has_filters = table.columns | selectattr('filterable') | list | length > 0 %} {% if has_filters %} {% include 'fragments/filter_bar.html' with context %} {% endif %} {# Bulk actions toolbar #} {% if table.bulk_actions %} {% with entity_name=table.entity_name, actions_endpoint=table.api_endpoint %} {% include 'fragments/bulk_actions.html' %} {% endwith %} {% endif %} {# Skeleton loading indicator #}
{% for _ in range(5) %} {% for col in table.columns %} {% if not col.hidden %} {% endif %} {% endfor %} {% endfor %}
Loading data...
{# Table #}
{% if table.bulk_actions %} {% endif %} {% for col in table.columns %} {% if not col.hidden %} {% endif %} {% endfor %} {% include 'fragments/table_rows.html' %}
{{ table.title }}
{% if col.sortable %} {% else %} {{ col.label }} {% endif %} Actions
{# Pagination #} {% if table.pagination_mode == "infinite" %} {% else %}
{% include 'fragments/table_pagination.html' %}
{% endif %} {# Slide-over panel for detail views #} {% if table.slide_over %} {% include 'components/alpine/slide_over.html' %} {% endif %}
{% endif %}