This repository has been archived on 2026-03-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blog-slim.old/views/pages/admin.twig
2026-03-09 15:14:57 +01:00

48 lines
1.3 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "layout.twig" %}
{% block title %}Admin Gestion des articles{% endblock %}
{% block content %}
<h2>Gestion des articles</h2>
<!-- Lien d'ajout -->
<p>
<a href="/admin/edit/0" class="btn btn-primary">+ Ajouter un article</a>
</p>
{% 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>
</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" class="btn btn-sm btn-danger"
onclick="return confirm('Supprimer cet article ?')">
Supprimer
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p><em>Aucun article à gérer.</em></p>
{% endif %}
{% endblock %}