78 lines
3.5 KiB
HTML
78 lines
3.5 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Interventions — GarageManager{% endblock %}
|
|
{% block content %}
|
|
|
|
<div class="page-header flex justify-between items-center">
|
|
<div>
|
|
<h1 class="page-title"><i class="fas fa-tools text-electric" style="margin-right:0.5rem"></i>Interventions</h1>
|
|
<p class="page-subtitle">{{ interventions|length }} intervention(s)</p>
|
|
</div>
|
|
<a href="/interventions/new" class="btn-primary">
|
|
<i class="fas fa-plus"></i> Nouvelle intervention
|
|
</a>
|
|
</div>
|
|
|
|
<div class="card" style="padding:0">
|
|
<div class="overflow-x-auto">
|
|
{% if interventions %}
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Véhicule</th>
|
|
<th>Description</th>
|
|
<th>Date</th>
|
|
<th>Kilométrage</th>
|
|
<th>Pièces</th>
|
|
<th class="text-right">Total</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for i in interventions %}
|
|
<tr>
|
|
<td>
|
|
<a href="/vehicules/{{ i.vehicule_id }}" style="text-decoration:none">
|
|
<span class="font-semibold mono" style="color:var(--accent-electric);font-size:0.85rem">{{ i.immatriculation }}</span>
|
|
<br>
|
|
<span class="text-xs text-muted">{{ i.marque }} {{ i.modele }}</span>
|
|
</a>
|
|
</td>
|
|
<td style="max-width:260px">
|
|
<a href="/interventions/{{ i.id }}" class="font-medium" style="text-decoration:none;color:var(--text-primary)">
|
|
{{ i.description[:60] }}{% if i.description|length > 60 %}…{% endif %}
|
|
</a>
|
|
</td>
|
|
<td class="text-secondary text-xs">{{ i.date_intervention or '—' }}</td>
|
|
<td class="mono text-xs text-secondary">{{ (i.kilometrage_intervention|string + ' km') if i.kilometrage_intervention else '—' }}</td>
|
|
<td>
|
|
<span class="text-xs text-secondary">{{ i.nb_pieces }} pièce(s)</span><br>
|
|
<span class="text-xs text-muted">{{ "%.2f"|format(i.cout_pieces) }} €</span>
|
|
</td>
|
|
<td class="text-right font-semibold" style="color:var(--accent-volt)">
|
|
{{ "%.0f"|format(i.cout_main_oeuvre + i.cout_pieces) }} €
|
|
</td>
|
|
<td>
|
|
<div class="flex gap-3">
|
|
<a href="/interventions/{{ i.id }}" class="link-action">Voir</a>
|
|
<a href="/interventions/{{ i.id }}/edit" class="link-edit">Modifier</a>
|
|
<form method="post" action="/interventions/{{ i.id }}/delete" style="display:inline" onsubmit="return confirm('Supprimer cette intervention ?')">
|
|
<button class="link-danger">Supprimer</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<i class="fas fa-tools"></i>
|
|
<p>Aucune intervention pour l'instant</p>
|
|
<a href="/interventions/new" class="link-action">Créer la première →</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|