
{% extends 'core/base.html' %}

{% block content %}
    <h1>Clienti</h1>
    <a href="{% url 'cliente_new' %}" class="btn btn-primary mb-3">Aggiungi Cliente</a>
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Nome</th>
                <th>Cognome</th>
                <th>Email</th>
                <th>Stato</th>
                <th>Azioni</th>
            </tr>
        </thead>
        <tbody>
            {% for cliente in clienti %}
                <tr>
                    <td>{{ cliente.nome }}</td>
                    <td>{{ cliente.cognome }}</td>
                    <td>{{ cliente.email }}</td>
                    <td>{{ cliente.stato }}</td>
                    <td>
                        <a href="{% url 'cliente_detail' cliente.pk %}" class="btn btn-sm btn-info">Dettagli</a>
                        <a href="{% url 'cliente_edit' cliente.pk %}" class="btn btn-sm btn-warning">Modifica</a>
                        <a href="{% url 'cliente_delete' cliente.pk %}" class="btn btn-sm btn-danger">Elimina</a>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
