Init project

This commit is contained in:
seb
2026-02-21 23:26:50 +01:00
parent df61e93871
commit b7046b125c
29 changed files with 2553 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{% extends "base.html" %}
{% block title %}{{ titre }}{% endblock %}
{% block content %}
<div class="page-header">
<h1>{{ titre }}</h1>
<a href="/clients/" class="btn">← Retour</a>
</div>
<form method="post" class="form-card">
<div class="form-grid">
<div class="form-group full">
<label>Nom *</label>
<input type="text" name="nom" required value="{{ client.nom if client else '' }}">
</div>
<div class="form-group full">
<label>Adresse *</label>
<input type="text" name="adresse" required value="{{ client.adresse if client else '' }}">
</div>
<div class="form-group">
<label>Code postal *</label>
<input type="text" name="code_postal" required value="{{ client.code_postal if client else '' }}">
</div>
<div class="form-group">
<label>Ville *</label>
<input type="text" name="ville" required value="{{ client.ville if client else '' }}">
</div>
<div class="form-group">
<label>Email</label>
<input type="email" name="email" value="{{ client.email if client else '' }}">
</div>
<div class="form-group">
<label>Téléphone</label>
<input type="text" name="telephone" value="{{ client.telephone if client else '' }}">
</div>
<div class="form-group">
<label>SIRET</label>
<input type="text" name="siret" maxlength="14" value="{{ client.siret if client else '' }}">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Enregistrer</button>
<a href="/clients/" class="btn">Annuler</a>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,41 @@
{% extends "base.html" %}
{% block title %}Clients{% endblock %}
{% block content %}
<div class="page-header">
<h1>Clients</h1>
<a href="/clients/nouveau" class="btn btn-primary">+ Nouveau client</a>
</div>
{% if clients %}
<table>
<thead>
<tr>
<th>Nom</th>
<th>Ville</th>
<th>Email</th>
<th>SIRET</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for c in clients %}
<tr>
<td><strong>{{ c.nom }}</strong></td>
<td>{{ c.code_postal }} {{ c.ville }}</td>
<td>{{ c.email or "—" }}</td>
<td>{{ c.siret or "—" }}</td>
<td>
<a href="/clients/{{ c.id }}/modifier" class="btn btn-sm">Modifier</a>
<form method="post" action="/clients/{{ c.id }}/supprimer" style="display:inline">
<button type="submit" class="btn btn-sm btn-danger"
onclick="return confirm('Supprimer ce client ?')">Supprimer</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="empty-state">Aucun client. <a href="/clients/nouveau">Créer le premier</a>.</p>
{% endif %}
{% endblock %}