{% extends 'base.html' %}

{% block title %}Удалить атрибут{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="row justify-content-center">
        <div class="col-sm-6 col-md-5 col-lg-4">
            <div class="card shadow-sm border-0">
                <div class="card-body p-4 text-center">
                    <div class="text-danger mb-3">
                        <i class="bi bi-exclamation-triangle fs-1"></i>
                    </div>

                    <h5 class="mb-3">Удалить атрибут?</h5>

                    <p class="mb-2">
                        <strong>{{ object.name }}</strong>
                    </p>

                    {% if values_count > 0 %}
                    <div class="alert alert-warning py-2 small">
                        <i class="bi bi-exclamation-circle"></i>
                        Будет удалено <strong>{{ values_count }}</strong> значени{{ values_count|pluralize:"е,я,й" }}
                    </div>
                    {% endif %}

                    <form method="post">
                        {% csrf_token %}
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-danger">
                                <i class="bi bi-trash"></i> Удалить
                            </button>
                            <a href="{% url 'products:attribute-list' %}" class="btn btn-light btn-sm">Отмена</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
