Simplified

This commit is contained in:
julien
2026-03-09 14:17:05 +01:00
parent e65d79cccb
commit eff05b0971
18 changed files with 1012 additions and 523 deletions

View File

@@ -3,28 +3,49 @@
{% block title %}Admin Gestion des articles{% endblock %}
{% block content %}
<h2>Gestion des articles</h2>
<h2>Gestion des articles</h2>
<!-- Lien dajout -->
<a href="/admin/edit/0">+ Ajouter un article</a>
<!-- Lien d'ajout -->
<p>
<a href="/admin/edit/0" class="btn btn-primary">+ Ajouter un article</a>
</p>
{% for post in posts %}
<div class="post">
<h3>{{ post.title }}</h3>
<p>{{ post.content|raw }}</p>
<div class="admin-actions">
<a href="/admin/edit/{{ post.id }}">Éditer</a>
{% if posts is not empty %}
<table class="admin-table">
<thead>
<tr>
<th>Titre</th>
<th>Créé le</th>
<th>Modifié le</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for post in posts %}
<tr>
<td>
<strong>{{ post.title }}</strong>
{% if post.isRecent(7) %}
<span class="badge badge-new">Nouveau</span>
{% endif %}
</td>
<td>{{ post.createdAt|date("d/m/Y H:i") }}</td>
<td>{{ post.updatedAt|date("d/m/Y H:i") }}</td>
<td class="admin-actions">
<a href="/admin/edit/{{ post.id }}" class="btn btn-sm btn-secondary">Éditer</a>
<form method="post" action="/admin/delete/{{ post.id }}" style="display:inline;">
<button type="submit"
onclick="return confirm('Supprimer cet article?')">
<button type="submit" class="btn btn-sm btn-danger"
onclick="return confirm('Supprimer cet article ?')">
Supprimer
</button>
</form>
</div>
</div>
{% else %}
<p>Aucun article à gérer.</p>
{% endfor %}
{% endblock %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p><em>Aucun article à gérer.</em></p>
{% endif %}
{% endblock %}