{% load i18n django_tables2 conjunto_tables %} {% comment %} Main list-card template for the TableListView pattern. Renders a Tabler-styled card with (optional) search input, per-column filters, header action buttons, and a django-tables2-rendered table body. Block structure (override via {% block ... %} in consumer templates): - card_header: the whole
...
- search: the search input slot - filters: the filter widgets slot - header_actions: the right-aligned action-button slot - card_body: the table body (defaults to {% render_table table %}) Context variables expected (provided by TableListView.get_context_data): - table django-tables2 Table (with .wrapper_id from RowActionsMixin) - search_fields iterable (truthy => render search input) - search_param GET parameter name - search_value current search string - search_placeholder optional placeholder - filters list of conjunto.filters.Filter instances - filter_values dict of {filter.name: current_value} - header_actions list of HeaderAction instances - flat (optional) when truthy, omit the inner ``
`` wrapper. Use when this list is embedded inside another Tabler card (e.g. the medux ``/administration/`` sectioned page) where a nested card would produce a visible card-in-card. - suppress_header_actions (optional) when truthy, the inner card-header does not render the header_actions block — the outer template (e.g. ``administration_list.html``) has already hoisted them into the page-level ``card-actions`` slot. {% endcomment %}
{% if not flat %}
{% endif %} {% block card_header %} {% if search_fields or filters or header_actions %} {% if search_fields or filters or not suppress_header_actions %}
{% block search %} {% if search_fields %} {% include "conjunto/tables/_search.html" %} {% endif %} {% endblock %} {% block filters %} {% for filter in filters %} {% with current_value=filter_values|dict_item:filter.name %} {% include filter.widget_template %} {% endwith %} {% endfor %} {% endblock %}
{% block header_actions %} {% if not suppress_header_actions %} {% include "conjunto/tables/_header_actions.html" %} {% endif %} {% endblock %}
{% endif %} {% endif %} {% endblock %} {% block card_body %} {% render_table table %} {% endblock %} {% if not flat %}
{% endif %}