{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1>Clienti</h1>
        <a href="{% url 'cliente_new' %}" class="btn btn-primary">Add Client</a>
    </div>
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>Nome</th>
                    <th>Cognome</th>
                    <th>Codice Fiscale</th>
                    <th>Email</th>
                    <th>Telefono</th>
                    <th>Stato</th>
                    <th>Categoria</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                {% for cliente in clienti %}
                <tr>
                    <td>{{ cliente.Nome }}</td>
                    <td>{{ cliente.Cognome }}</td>
                    <td>{{ cliente.Codice_Fiscale }}</td>
                    <td>{{ cliente.Email }}</td>
                    <td>{{ cliente.Telefono }}</td>
                    <td>{{ cliente.Stato }}</td>
                    <td>{{ cliente.Categoria }}</td>
                    <td>
                        <a href="{% url 'cliente_detail' cliente.pk %}" class="btn btn-sm btn-outline-info">Details</a>
                        <a href="{% url 'cliente_edit' cliente.pk %}" class="btn btn-sm btn-outline-primary">Edit</a>
                        <a href="{% url 'cliente_delete' cliente.pk %}" class="btn btn-sm btn-outline-danger">Delete</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
