{% 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 {% endcomment %}
{% block card_header %} {% if search_fields or filters or 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 %} {% include "conjunto/tables/_header_actions.html" %} {% endblock %}
{% endif %} {% endblock %} {% block card_body %} {% render_table table %} {% endblock %}