Files

76 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block title %}Clients — GarageManager{% endblock %}
{% block content %}
<div class="page-header flex justify-between items-center">
<div>
<h1 class="page-title"><i class="fas fa-users text-electric" style="margin-right:0.5rem"></i>Clients</h1>
<p class="page-subtitle">{{ clients|length }} client(s) enregistré(s)</p>
</div>
<a href="/clients/new" class="btn-primary">
<i class="fas fa-plus"></i> Nouveau client
</a>
</div>
<!-- Search -->
<div class="card mb-4" style="padding:1rem 1.25rem">
<form method="get" class="flex gap-2">
<input name="q" value="{{ q }}" placeholder="Rechercher par nom, téléphone…" style="flex:1">
<button type="submit" class="btn-secondary" style="width:auto;white-space:nowrap">
<i class="fas fa-search"></i> Rechercher
</button>
{% if q %}
<a href="/clients" class="btn-secondary" style="width:auto"></a>
{% endif %}
</form>
</div>
<div class="card" style="padding:0">
<div class="overflow-x-auto">
{% if clients %}
<table>
<thead>
<tr>
<th>Nom</th>
<th>Téléphone</th>
<th>Email</th>
<th>Véhicules</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for c in clients %}
<tr>
<td>
<a href="/clients/{{ c.id }}" class="font-semibold" style="text-decoration:none;color:var(--text-primary)">{{ c.nom }} {{ c.prenom }}</a>
</td>
<td class="text-secondary text-sm">{{ c.telephone or '—' }}</td>
<td class="text-secondary text-sm">{{ c.email or '—' }}</td>
<td>
<span class="badge badge-info">{{ c.nb_vehicules }}</span>
</td>
<td>
<div class="flex gap-3">
<a href="/clients/{{ c.id }}" class="link-action">Voir</a>
<a href="/clients/{{ c.id }}/edit" class="link-edit">Modifier</a>
<form method="post" action="/clients/{{ c.id }}/delete" style="display:inline" onsubmit="return confirm('Supprimer ce client ?')">
<button class="link-danger">Supprimer</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="empty-state">
<i class="fas fa-users"></i>
<p>Aucun client trouvé</p>
<a href="/clients/new" class="link-action">Ajouter le premier →</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}