Files

53 lines
1.9 KiB
HTML

{% extends 'base.html' %}
{% block title %}Clients{% endblock %}
{% block content %}
<div class="page-header d-flex justify-content-between align-items-center">
<h1><i class="bi bi-building me-2 text-info"></i>Clients</h1>
<a href="{{ url_for('new_client') }}" class="btn btn-sm" style="background:#ff6b35;color:#fff">
<i class="bi bi-plus-lg me-1"></i>Nouveau client
</a>
</div>
<div class="card">
<div class="card-body p-0">
{% if clients %}
<table class="table table-hover mb-0">
<thead class="table-light">
<tr>
<th>Nom</th><th>Email</th><th>Commandes</th><th>CA total</th><th></th>
</tr>
</thead>
<tbody>
{% for c in clients %}
<tr>
<td class="fw-semibold">{{ c.name }}</td>
<td class="text-muted">{{ c.email or '—' }}</td>
<td>{{ c.job_count }}</td>
<td class="fw-semibold">{{ c.total_revenue or 0 }} €</td>
<td>
<div class="d-flex gap-1">
<a href="{{ url_for('edit_client', id=c.id) }}" class="btn btn-sm btn-outline-secondary py-0">
<i class="bi bi-pencil"></i>
</a>
<form method="POST" action="{{ url_for('delete_client', id=c.id) }}"
onsubmit="return confirm('Supprimer ce client ? Ses commandes seront conservées.')">
<button class="btn btn-sm btn-outline-danger py-0"><i class="bi bi-trash"></i></button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="text-center text-muted py-5">
<i class="bi bi-building fs-1"></i>
<p class="mt-2">Aucun client enregistré.</p>
<a href="{{ url_for('new_client') }}" class="btn btn-sm" style="background:#ff6b35;color:#fff">Ajouter le premier client</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}