{% extends 'inventory/base_inventory_minimal.html' %}

{% block inventory_title %}Новая инвентаризация{% endblock %}
{% block breadcrumb_current %}
    <a href="{% url 'inventory:inventory-list' %}" class="text-decoration-none">Инвентаризация</a>
{% endblock %}

{% block inventory_content %}
<div class="card">
    <div class="card-header">
        <h4 class="mb-0">Начало новой инвентаризации</h4>
    </div>

    <div class="card-body">
        <form method="post" class="form">
            {% csrf_token %}

            <div class="mb-3">
                <label for="{{ form.warehouse.id_for_label }}" class="form-label">
                    {{ form.warehouse.label }} <span class="text-danger">*</span>
                </label>
                {{ form.warehouse }}
                {% if form.warehouse.errors %}
                    <div class="invalid-feedback d-block">
                        {% for error in form.warehouse.errors %}{{ error }}{% endfor %}
                    </div>
                {% endif %}
            </div>

            <div class="mb-3">
                <label for="{{ form.notes.id_for_label }}" class="form-label">
                    {{ form.notes.label }}
                </label>
                {{ form.notes }}
                {% if form.notes.errors %}
                    <div class="invalid-feedback d-block">
                        {% for error in form.notes.errors %}{{ error }}{% endfor %}
                    </div>
                {% endif %}
            </div>

            <div class="d-flex gap-2">
                <button type="submit" class="btn btn-primary">
                    <i class="bi bi-check-circle"></i> Начать инвентаризацию
                </button>
                <a href="{% url 'inventory:inventory-list' %}" class="btn btn-secondary">
                    <i class="bi bi-x-circle"></i> Отменить
                </a>
            </div>
        </form>
    </div>
</div>

<style>
    select, textarea, input {
        width: 100%;
    }
</style>
{% endblock %}
