first commit
This commit is contained in:
30
views/admin.twig
Normal file
30
views/admin.twig
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends "layout.twig" %}
|
||||
|
||||
{% block title %}Admin – Gestion des articles{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Gestion des articles</h2>
|
||||
|
||||
<!-- Lien d’ajout -->
|
||||
<a href="/admin/edit/0">+ Ajouter un article</a>
|
||||
|
||||
{% for post in posts %}
|
||||
<div class="post">
|
||||
<h3>{{ post.title }}</h3>
|
||||
<p>{{ post.content|nl2br }}</p>
|
||||
|
||||
<div class="admin-actions">
|
||||
<a href="/admin/edit/{{ post.id }}">Éditer</a>
|
||||
|
||||
<form method="post" action="/admin/delete/{{ post.id }}" style="display:inline;">
|
||||
<button type="submit"
|
||||
onclick="return confirm('Supprimer cet article ?')">
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>Aucun article à gérer.</p>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user