- Application FastAPI avec SQLite et Jinja2 - Gestion des véhicules (VIN, immatriculation, infos libres) - Gestion des interventions avec statut (en_attente/en_cours/termine) - Gestion des pièces détachées avec photos - Tableau de bord avec statistiques - Déploiement Docker + Traefik (HTTPS) - README complet en français
59 lines
3.6 KiB
HTML
59 lines
3.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Véhicules - GarageManager{% endblock %}
|
|
{% block content %}
|
|
<div class="flex justify-between items-center mb-8">
|
|
<div><h2 class="text-2xl font-bold text-slate-800">Véhicules</h2><p class="text-slate-500 mt-1">{{ vehicules|length }} véhicule(s)</p></div>
|
|
<a href="/vehicules/new" class="bg-orange-500 text-white px-4 py-2 rounded-lg text-sm hover:bg-orange-600 transition flex items-center gap-2"><i class="fas fa-plus"></i> Nouveau véhicule</a>
|
|
</div>
|
|
<div class="bg-white rounded-xl shadow">
|
|
<div class="p-4 border-b border-gray-100">
|
|
<form method="get" class="flex gap-2">
|
|
<input name="q" value="{{ q }}" placeholder="Immatriculation, marque, modèle, VIN..." class="flex-1 border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-orange-300">
|
|
<button type="submit" class="bg-slate-700 text-white px-4 py-2 rounded-lg text-sm">Rechercher</button>
|
|
{% if q %}<a href="/vehicules" class="text-slate-500 px-3 py-2 text-sm flex items-center">✕</a>{% endif %}
|
|
</form>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
{% if vehicules %}
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50 text-slate-600 text-xs uppercase">
|
|
<tr>
|
|
<th class="px-6 py-3 text-left">Immatriculation</th>
|
|
<th class="px-6 py-3 text-left">Marque / Modèle</th>
|
|
<th class="px-6 py-3 text-left">Année</th>
|
|
<th class="px-6 py-3 text-left">VIN</th>
|
|
<th class="px-6 py-3 text-left">Kilométrage</th>
|
|
<th class="px-6 py-3 text-left">Interventions</th>
|
|
<th class="px-6 py-3 text-left">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
{% for v in vehicules %}
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-6 py-4 font-bold text-slate-800">{{ v.immatriculation }}</td>
|
|
<td class="px-6 py-4 font-medium text-slate-700">{{ v.marque }} {{ v.modele }}</td>
|
|
<td class="px-6 py-4 text-slate-500">{{ v.annee or '-' }}</td>
|
|
<td class="px-6 py-4 text-slate-400 text-xs font-mono">{{ v.vin or '-' }}</td>
|
|
<td class="px-6 py-4 text-slate-600">{{ (v.kilometrage|string + ' km') if v.kilometrage else '-' }}</td>
|
|
<td class="px-6 py-4"><span class="bg-gray-100 text-gray-600 px-2 py-1 rounded-full text-xs">{{ v.nb_interventions }}</span></td>
|
|
<td class="px-6 py-4 flex gap-3">
|
|
<a href="/vehicules/{{ v.id }}" class="text-blue-500 hover:underline">Voir</a>
|
|
<a href="/vehicules/{{ v.id }}/edit" class="text-orange-500 hover:underline">Modifier</a>
|
|
<form method="post" action="/vehicules/{{ v.id }}/delete" class="inline" onsubmit="return confirm('Supprimer ce véhicule ?')">
|
|
<button class="text-red-500 hover:underline">Supprimer</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<div class="p-8 text-center text-slate-400">
|
|
<i class="fas fa-car text-3xl mb-3"></i><p>Aucun véhicule trouvé</p>
|
|
<a href="/vehicules/new" class="text-orange-500 hover:underline text-sm mt-2 inline-block">Ajouter le premier →</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|