58 lines
1.9 KiB
HTML
58 lines
1.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Utilisateurs{% endblock %}
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>Utilisateurs</h1>
|
|
<a href="/admin/utilisateurs/nouveau" class="btn btn-primary">+ Nouvel utilisateur</a>
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Nom d'utilisateur</th>
|
|
<th>Email</th>
|
|
<th>Rôle</th>
|
|
<th>Statut</th>
|
|
<th>Créé le</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td>
|
|
<strong>{{ u.username }}</strong>
|
|
{% if u.id == current_user.id %}<em>(vous)</em>{% endif %}
|
|
</td>
|
|
<td>{{ u.email or "—" }}</td>
|
|
<td>
|
|
{% if u.is_admin %}
|
|
<span class="badge badge-accepte">Admin</span>
|
|
{% else %}
|
|
<span class="badge badge-brouillon">Utilisateur</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{% if u.actif %}
|
|
<span class="badge badge-payee">Actif</span>
|
|
{% else %}
|
|
<span class="badge badge-annulee">Inactif</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ u.created_at | date_fr }}</td>
|
|
<td>
|
|
<a href="/admin/utilisateurs/{{ u.id }}/modifier" class="btn btn-sm">Modifier</a>
|
|
{% if u.id != current_user.id %}
|
|
<form method="post" action="/admin/utilisateurs/{{ u.id }}/desactiver" style="display:inline">
|
|
<button type="submit" class="btn btn-sm {% if u.actif %}btn-danger{% endif %}">
|
|
{{ "Désactiver" if u.actif else "Réactiver" }}
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|