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

{% load spire_core_tags %}

{% block card_title %}
    {{ group.name }}
{% endblock %}

{% block card_button %}
    {% if perms.django_spire_auth_group.change_authgroup %}
        {% url 'django_spire:auth:group:form:update' pk=group.pk as edit_group_url %}
        {% include 'django_spire/button/primary_dark_button.html' with button_icon='bi bi-pencil' button_text='Edit' button_href=edit_group_url %}
    {% endif %}
{% endblock %}

{% block card_title_content %}
    <div class="row">
        <div class="col">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Name' attribute_value=group.name %}
        </div>
        <div class="col">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Number of Users' attribute_value=group.user_set.count|default:'0' %}
        </div>
    </div>
{% endblock %}
