gmao/app_new/templates/auth/users.html

54 lines
2.6 KiB
HTML
Raw Normal View History

2026-08-14 18:02:25 +02:00
{% extends "base.html" %}
{% block title %}Utilisateurs — GMAO Collège{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1><i class="bi bi-people"></i> Utilisateurs</h1>
<a href="{{ url_for('auth.create_user') }}" class="btn btn-primary">
<i class="bi bi-plus-lg"></i> Nouvel utilisateur
</a>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead><tr><th>Nom</th><th>Identifiant</th><th>Email</th><th>Rôle</th><th>Statut</th><th>Actions</th></tr></thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.full_name }}</td>
<td>{{ user.username }}</td>
<td>{{ user.email }}</td>
<td>
{% if user.role == 'admin' %}<span class="badge bg-danger">Administrateur</span>
{% elif user.role == 'chef' %}<span class="badge bg-warning text-dark">Chef d'établissement</span>
{% elif user.role == 'technicien' %}<span class="badge bg-primary">Technicien</span>
{% elif user.role == 'demandeur' %}<span class="badge bg-secondary">Demandeur</span>
{% else %}<span class="badge bg-secondary">{{ user.role }}</span>{% endif %}
</td>
<td>
{% if user.is_active %}<span class="badge bg-success">Actif</span>
{% else %}<span class="badge bg-secondary">Inactif</span>{% endif %}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ url_for('auth.edit_user', id=user.id) }}" class="btn btn-outline-primary" title="Éditer">
<i class="bi bi-pencil"></i>
</a>
<a href="{{ url_for('auth.change_user_password', id=user.id) }}" class="btn btn-outline-warning" title="Changer le mot de passe">
<i class="bi bi-key"></i>
</a>
{% if user.id != current_user.id %}
<form method="POST" action="{{ url_for('auth.delete_user', id=user.id) }}" class="d-inline" onsubmit="return confirm('Êtes-vous sûr de vouloir supprimer cet utilisateur ?')">
<button type="submit" class="btn btn-outline-danger" title="Supprimer">
<i class="bi bi-trash"></i>
</button>
</form>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}