{% load card_badge %}
{% load pagination_tags %}
{% if group_by and groups %}
    {% for group in groups %}
        <div class="divider">{{ group.group }}</div>
        <div class="flex justify-center flex-wrap gap-2">
            {% for card in group.cards %}
                {% card_badge card expanded=True %}
            {% endfor %}
        </div>
    {% endfor %}
{% else %}
    <div class="flex justify-center flex-wrap gap-2">
        {% for card in cards %}
            {% card_badge card expanded=True %}
        {% endfor %}
    </div>
{% endif %}

<!-- Somewhere in your template, e.g., after the card list: -->
{% if page_obj %}
    {% render_pagination page_obj %}
{% endif %}
