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

{% load spire_core_tags %}

{% block card_title %}
    {{ user.get_full_name }}
{% endblock %}

{% block card_button %}
    {% if perms.django_spire_auth_user.change_authuser %}
        {% url 'django_spire:auth:user:form:update' pk=user.pk as form_url %}
        {% include 'django_spire/button/primary_dark_button.html' with button_text='Edit' button_icon='bi bi-pencil-fill' button_href=form_url %}
    {% endif %}
{% endblock %}

{% block card_title_content  %}
    <div class="row g-2">
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='First Name' attribute_value=user.first_name %}
        </div>
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Last Name' attribute_value=user.last_name %}
        </div>
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Email' attribute_value=user.email %}
        </div>
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Status' %}
            {% include 'django_spire/auth/group/element/is_active_badge.html' with is_active=user.is_active %}
        </div>
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Last Login' attribute_value=user.last_login|default:'N/A' %}
        </div>
        <div class="col-lg-3 col-sm-6 col-12">
            {% include 'django_spire/element/attribute_element.html' with attribute_title='Date Created' attribute_value=user.date_joined %}
        </div>
    </div>
{% endblock %}
