afpy.org/templates/admin.html

44 lines
1.2 KiB
HTML

{% extends '_layout.jinja2' %}
{% block header %}
<h1>Administration</h1>
{% endblock header %}
{% block main %}
<article>
<h2>{{ label }}</h2>
{% for state, timestamps in posts.items() %}
{% if state == 'waiting' %}
{% set state_label= 'En attente' %}
{% elif state == 'published' %}
{% set state_label= 'Publiés' %}
{% else %}
{% set state_label= 'Supprimés' %}
{% endif %}
<h3>{{ state_label }}</h3>
{% if timestamps %}
<table>
<thead>
<tr>
<th>Titre</th>
<th>Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for timestamp, post in timestamps.items() %}
<tr>
<td>{{ post.title }}</td>
<td>{{ post.published | parse_iso_datetime('%x') }}</td>
<td><a href="{{ url_for('edit_post_admin', name=name, timestamp=timestamp) }}">Éditer</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Aucun article.</p>
{% endif %}
{% endfor %}
</article>
{% endblock main %}