- 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
64 lines
4.4 KiB
HTML
64 lines
4.4 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Interventions - GarageManager{% endblock %}
|
|
{% block content %}
|
|
<div class="flex justify-between items-center mb-8">
|
|
<div><h2 class="text-2xl font-bold text-slate-800">Interventions</h2><p class="text-slate-500 mt-1">{{ interventions|length }} intervention(s)</p></div>
|
|
<a href="/interventions/new" class="bg-orange-500 text-white px-4 py-2 rounded-lg text-sm hover:bg-orange-600 flex items-center gap-2"><i class="fas fa-plus"></i> Nouvelle intervention</a>
|
|
</div>
|
|
<div class="flex gap-2 mb-6 flex-wrap">
|
|
<a href="/interventions" class="px-4 py-2 rounded-full text-sm {% if not statut %}bg-slate-800 text-white{% else %}bg-white text-slate-600 border hover:bg-gray-50{% endif %}">Toutes</a>
|
|
<a href="/interventions?statut=en_attente" class="px-4 py-2 rounded-full text-sm {% if statut == 'en_attente' %}bg-yellow-500 text-white{% else %}bg-white text-slate-600 border hover:bg-gray-50{% endif %}">⏳ En attente</a>
|
|
<a href="/interventions?statut=en_cours" class="px-4 py-2 rounded-full text-sm {% if statut == 'en_cours' %}bg-blue-500 text-white{% else %}bg-white text-slate-600 border hover:bg-gray-50{% endif %}">🔧 En cours</a>
|
|
<a href="/interventions?statut=termine" class="px-4 py-2 rounded-full text-sm {% if statut == 'termine' %}bg-green-500 text-white{% else %}bg-white text-slate-600 border hover:bg-gray-50{% endif %}">✅ Terminées</a>
|
|
</div>
|
|
<div class="bg-white rounded-xl shadow overflow-x-auto">
|
|
{% if interventions %}
|
|
<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">Véhicule</th>
|
|
<th class="px-6 py-3 text-left">Description</th>
|
|
<th class="px-6 py-3 text-left">Statut</th>
|
|
<th class="px-6 py-3 text-left">Pièces</th>
|
|
<th class="px-6 py-3 text-left">Total</th>
|
|
<th class="px-6 py-3 text-left">Date</th>
|
|
<th class="px-6 py-3 text-left">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
{% for i in interventions %}
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-6 py-4 font-medium text-slate-800">
|
|
<a href="/vehicules/{{ i.vehicule_id }}" class="hover:text-orange-500">{{ i.immatriculation }}<br><span class="text-xs font-normal text-slate-400">{{ i.marque }} {{ i.modele }}</span></a>
|
|
</td>
|
|
<td class="px-6 py-4 text-slate-600 max-w-xs">
|
|
<a href="/interventions/{{ i.id }}" class="hover:text-orange-500">{{ i.description[:60] }}{% if i.description|length > 60 %}...{% endif %}</a>
|
|
</td>
|
|
<td class="px-6 py-4">
|
|
{% if i.statut == 'en_attente' %}<span class="bg-yellow-100 text-yellow-700 px-2 py-1 rounded-full text-xs">En attente</span>
|
|
{% elif i.statut == 'en_cours' %}<span class="bg-blue-100 text-blue-700 px-2 py-1 rounded-full text-xs">En cours</span>
|
|
{% else %}<span class="bg-green-100 text-green-700 px-2 py-1 rounded-full text-xs">Terminé</span>{% endif %}
|
|
</td>
|
|
<td class="px-6 py-4 text-slate-500 text-xs">{{ "%.2f"|format(i.cout_pieces) }} €</td>
|
|
<td class="px-6 py-4 font-semibold text-slate-700">{{ "%.0f"|format(i.cout_main_oeuvre + i.cout_pieces) }} €</td>
|
|
<td class="px-6 py-4 text-slate-400 text-xs">{{ i.created_at[:10] }}</td>
|
|
<td class="px-6 py-4 flex gap-3">
|
|
<a href="/interventions/{{ i.id }}" class="text-blue-500 hover:underline">Voir</a>
|
|
<a href="/interventions/{{ i.id }}/edit" class="text-orange-500 hover:underline">Modifier</a>
|
|
<form method="post" action="/interventions/{{ i.id }}/delete" class="inline" onsubmit="return confirm('Supprimer ?')">
|
|
<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-tools text-3xl mb-3"></i><p>Aucune intervention trouvée</p>
|
|
<a href="/interventions/new" class="text-orange-500 hover:underline text-sm mt-2 inline-block">Créer la première →</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|