{% import "tungsten/components/ui.html" as ui %} {% set sort_col, sort_dir = table.sort %} {% set page_keys = rows | selectattr('key', 'defined') | map(attribute='key') | list %}
{% if table.param('tab') %}{% endif %} {% if reordering %}{% endif %} {% if table.param('sort') is not none %}{% endif %} {% if heading or description %}
{% if heading %}

{{ heading }}

{% endif %} {% if description %}

{{ description }}

{% endif %}
{% endif %} {% if tabs %} {# ------------------------------------------------------------ list tabs #} {% endif %} {% if table._toolbar %} {# ------------------------------------------------------------ toolbar #}
{% if table.is_searchable() %}
{{ ui.search_input('search', table.search, search_placeholder, table.id ~ '-search') }}
{% endif %} {% for f in inline_filters %} {% for field in f.get_fields() %}
{{ field.render(table.filter_form, f.base()) }}
{% endfor %} {% endfor %} {% if panel_filters %} {% endif %}
{% if groups %} {% endif %} {% if toggleable %} {% call(part) ui.dropdown(width='w-60') %} {% if part == 'trigger' %} {% else %}

{{ __('Show columns') }}

{% for c in toggleable %} {% endfor %} {% endif %} {% endcall %} {% endif %} {% if reorderable %} {% endif %} {% for a in header_actions %}{{ a.render(ctx, host, None, table_id=table.id) }}{% endfor %}
{# ------------------------------------------------------------ active filter chips #} {% if indicators %}
{{ __('Active filters') }} {% for i in indicators %}{{ ui.badge(i.label, 'primary') }}{% endfor %} {{ icon('x', 'h-4 w-4') }}
{% endif %} {% endif %} {# ------------------------------------------------------------ bulk bar #} {% if selectable %}
{{ __('selected') }} {% for a in bulk_actions %}{{ a.render(ctx, host, None, style='soft', table_id=table.id) }}{% endfor %}
{% endif %}
{# ------------------------------------------------------------ table #} {% if rows %}
{% if reordering %}{% endif %} {% if selectable %} {% endif %} {% if table._row_index %}{% endif %} {% for c in columns %} {% endfor %} {% if row_actions %}{% endif %} {% set colspan = columns | length + (1 if reordering else 0) + (1 if selectable else 0) + (1 if table._row_index else 0) + (1 if row_actions else 0) %} {% for row in rows %} {% if row.group is defined %} {% else %} {% if reordering %}{% endif %} {% if selectable %} {% endif %} {% if table._row_index %}{% endif %} {% for c in columns %} {% endfor %} {% if row_actions %} {% endif %} {% endif %} {% endfor %} {% if summaries %} {% if selectable %}{% endif %} {% if table._row_index %}{% endif %} {% for c in columns %} {% endfor %} {% if row_actions %}{% endif %} {% endif %}
# {% if c._sortable %} {% else %}{{ c.get_label() }}{% endif %} {{ __('Actions') }}
{{ row.group }}
{{ icon('grip-vertical', 'h-5 w-5') }}{{ row.index }} {% if row.url and not c.editable and not c._url %} {{ c.render_cell(table, row.record) }} {% else %}{{ c.render_cell(table, row.record) }}{% endif %}
{% for a in row_actions %}{{ a.render(ctx, host, row.record, style=(None if a._style else ('icon' if a._icon else 'link')), table_id=table.id) }}{% endfor %}
{% for s in summaries.get(c.name, []) %}
{{ s.label }}: {{ s.value }}
{% endfor %} {% if loop.first and not summaries.get(c.name) %}{{ __('Summary') }}{% endif %}
{# ------------------------------------------------------------ pagination #} {% if paginated %} {% endif %} {% else %}
{% call ui.empty_state(empty_heading, empty_description, empty_icon) %} {% for a in empty_actions %}{{ a.render(ctx, host, None, table_id=table.id) }}{% endfor %} {% endcall %}
{% endif %}
{# ------------------------------------------------------------ filter panel #} {% if panel_filters %} {% set has_builder = panel_filters | selectattr('field', 'defined') | list %} {% endif %}