{% extends "base.html" %}
{% block content %}

<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1><i class="bi bi-pencil"></i> Modifier le Lot: {{ lot.name }}</h1>
        <a href="{{ url_for('lots.detail', id=lot.id) }}" class="btn btn-secondary">
            <i class="bi bi-arrow-left"></i> Annuler
        </a>
    </div>

    <div class="card">
        <div class="card-header">
            <h5>Informations du Lot</h5>
        </div>
        <div class="card-body">
            <form method="POST">
                <div class="mb-3">
                    <label class="form-label">Nom du Lot</label>
                    <input type="text" class="form-control" value="{{ lot.name }}" readonly>
                </div>
                
                <div class="mb-3">
                    <label for="company_id" class="form-label">Entreprise prestataire</label>
                    <select name="company_id" id="company_id" class="form-select">
                        <option value="">-- Aucune entreprise --</option>
                        {% for company in companies %}
                        <option value="{{ company.id }}" {% if lot.company_id == company.id %}selected{% endif %}>
                            {{ company.name }}
                        </option>
                        {% endfor %}
                    </select>
                </div>
                
                <button type="submit" class="btn btn-success">
                    <i class="bi bi-save"></i> Enregistrer
                </button>
            </form>
        </div>
    </div>
</div>

{% endblock %}