{% load i18n %} {% comment %} card_grid.html — toggleable grid / list view for card collections. Context: cards — CardGridData instance (codex_django.cabinet.types.CardGridData) Alpine.js handles grid/list toggle client-side (no reload). Usage: {% include "cabinet/components/card_grid.html" with cards=cards %} {% endcomment %}
{# Toolbar #}
{% if cards.search_placeholder or cards.always_show_search %} {% endif %}
{# Grid view #}
{% if cards.items %} {% else %}
{{ cards.empty_message }}
{% endif %}
{# List view #}
{% if cards.items %} {% else %}
{{ cards.empty_message }}
{% endif %}