{# Partial HTMX — contenu swapé dans #list-content lors des navigations liste #} {# Variables requises : identiques à admin/list #} {% set_global can_create = false %} {% if current_user %} {% if current_user.is_superuser %} {% set_global can_create = true %} {% else %} {% for groupe in current_user.groupes %} {% for perm in groupe.permissions %} {% if perm.resource_key == resource.key and perm.can_create %} {% set_global can_create = true %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% endif %} {% set has_filters = resource.display.list_filter | length > 0 %}
{# ── Barre de recherche + bouton filtres ── #}
{% if sort_by %}{% endif %} {% if sort_dir %}{% endif %} {% for col, val in active_filters %}{% endfor %} {% if search %} {% endif %}
{% if has_filters %} {% endif %}
{# ── Barre d'actions bulk (cachée jusqu'à sélection) ── #} {% set_global can_bulk = false %} {% if current_user %} {% if current_user.is_superuser %} {% set_global can_bulk = true %} {% else %} {% for groupe in current_user.groupes %} {% for perm in groupe.permissions %} {% if perm.resource_key == resource.key and perm.can_delete %} {% set_global can_bulk = true %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% endif %} {% if can_bulk %}
{% csrf %}
0 sélectionné(s)
{% if group_actions | length > 0 %}
{% for ga in group_actions %} {% endfor %}
{% endif %} {% if can_update %} {% endif %}
{% endif %}
{# ── Colonne principale : card + pagination ── #}
{% if entries is defined and entries | length > 0 %}
{% if can_bulk %}{% endif %} {% for col in visible_columns %} 0 %} class="col-secondary"{% endif %}> {% endfor %} {% if can_bulk %}{% endif %} {% for col in visible_columns %} {% endfor %} {% for entry in entries %} {% if can_bulk %}{% endif %} {% for col in visible_columns %} {% set value = entry[col] %} {% endfor %} {% endfor %}
{% if admin_list_th_id %}{{ admin_list_th_id }}{% endif %} {% if sort_by == "id" %}{% if sort_dir == "asc" %}▲{% else %}▼{% endif %}{% endif %} 0 %} class="col-secondary"{% endif %}> {% if column_labels[col] %}{{ column_labels[col] }}{% else %}{{ col | replace(from="_", to=" ") }}{% endif %} {% if sort_by == col %}{% if sort_dir == "asc" %}▲{% else %}▼{% endif %}{% endif %} {% if admin_list_th_actions %}{{ admin_list_th_actions }}{% endif %}
#{{ entry.id }} {% if value == true %} {% if admin_list_bool_true %}{{ admin_list_bool_true }}{% endif %} {% elif value == false %} {% if admin_list_bool_false %}{{ admin_list_bool_false }}{% endif %} {% elif value %} {% if value is string %}{{ value | escape }}{% else %}{{ value }}{% endif %} {% else %} {% endif %} {% set resource_key = resource.key %} {% set entry_id = entry.id %} {% include "admin/kebab" %}
{% for col in visible_columns %} {% if loop.index0 > 0 %} {% set value = entry[col] %}
{% if column_labels[col] %}{{ column_labels[col] }}{% else %}{{ col | replace(from="_", to=" ") }}{% endif %} {% if value == true %}{% if admin_list_bool_true %}{{ admin_list_bool_true }}{% endif %} {% elif value == false %}{% if admin_list_bool_false %}{{ admin_list_bool_false }}{% endif %} {% elif value %}{% if value is string %}{{ value | escape }}{% else %}{{ value }}{% endif %} {% else %}{% endif %}
{% endif %} {% endfor %}
{% else %}

{% if admin_list_empty_title %}{{ admin_list_empty_title }}{% endif %}

{% if admin_list_empty_desc %}{{ admin_list_empty_desc }}{% endif %}

{% if can_create %}{% if admin_list_btn_create_first %}{{ admin_list_btn_create_first }}{% endif %}{% endif %}
{% endif %}
{% if page_count is defined and page_count > 1 %} {% endif %}
{# ── Sidebar filtres (droite) ── #} {% if has_filters %}
{% endif %}
{# fin admin-list-layout #}