53 lines
2.4 KiB
Twig
53 lines
2.4 KiB
Twig
{% extends 'base.html.twig' %}
|
|
{% block title %}Users - ServerControl{% endblock %}
|
|
|
|
{% block body %}
|
|
<h1 class="h3 mb-4">User Management</h1>
|
|
|
|
<div class="card">
|
|
<div class="card-body p-0">
|
|
<table class="table table-hover mb-0">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Pseudo</th><th>Email</th><th>Roles</th><th>Status</th><th>Registered</th><th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for user in users %}
|
|
<tr class="{{ not user.active ? 'table-secondary text-muted' : '' }}">
|
|
<td>{{ user.pseudo }}</td>
|
|
<td>{{ user.email }}</td>
|
|
<td>
|
|
{% for role in user.roles %}
|
|
{% if role != 'ROLE_USER' %}
|
|
<span class="badge bg-{{ role == 'ROLE_ADMIN' ? 'danger' : 'primary' }}">{{ role }}</span>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</td>
|
|
<td>
|
|
<span class="badge bg-{{ user.active ? 'success' : 'secondary' }}">
|
|
{{ user.active ? 'Active' : 'Disabled' }}
|
|
</span>
|
|
</td>
|
|
<td>{{ user.createdAt|date('d/m/Y') }}</td>
|
|
<td>
|
|
<a href="{{ path('app_admin_user_edit', {id: user.id}) }}" class="btn btn-sm btn-outline-secondary">
|
|
<i class="bi bi-pencil"></i>
|
|
</a>
|
|
{% if user != app.user %}
|
|
<form method="post" action="{{ path('app_admin_user_toggle', {id: user.id}) }}" class="d-inline">
|
|
<input type="hidden" name="_token" value="{{ csrf_token('toggle_user_' ~ user.id) }}">
|
|
<button class="btn btn-sm btn-outline-{{ user.active ? 'warning' : 'success' }}"
|
|
title="{{ user.active ? 'Disable' : 'Enable' }}">
|
|
<i class="bi bi-{{ user.active ? 'person-x' : 'person-check' }}"></i>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|