{% extends 'spire/card/title_card.html' %}

{% block card_padding_class %}p-0{% endblock %}

{% load spire_core_tags %}

{% block card_title %}
    Group List
{% endblock %}

{% block card_button %}
    {% if perms.permission.change_portalgroup %}
        {% url 'permission:group_form' pk=0 as add_group_url %}
        {% include 'spire/button/primary_dark_button.html' with button_href=add_group_url button_text='Add' button_icon='bi bi-plus' %}
    {% endif %}
{% endblock %}

{% block card_title_content %}
    {% if group_list %}
        {% for group in group_list %}
            {% include 'spire/permission/item/group_item.html' with perm_data=group_list_permission_data|index:forloop.counter0 location='group' %}
        {% endfor %}
    {% else %}
        {% include 'spire/item/no_data_item.html' %}
    {% endif %}
{% endblock %}
