{% extends 'base.html.twig' %}
{% block title %}Liste des utilisateurs{% endblock %}
{% block body %}
<div class="page-header">
<h1 class="page-title">Liste des utilisateurs</h1>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ path('home') }}">Accueil Admin</a></li>
<li class="breadcrumb-item active" aria-current="page">Utilisateurs</li>
</ol>
</div>
<div class="row">
<div class="col-md-12 col-lg-12">
<div class="card">
<div class="card-header">
<a href="{{ path('user_new') }}" class="btn btn-azure">Ajouter un nouvel utilisateur</a>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table table-striped table-bordered" >
<thead>
<tr>
<th class="w-15">Nom</th>
<th class="w-15">Prénom</th>
<th>Rôle</th>
<th>Email</th>
<th>Téléphone</th>
<th class="w-15">Actions</th>
</tr>
</thead>
<tbody>
{% for user in users %}
<tr>
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
<td>{% if user.roles == ["ROLE_COMMERCIAL","ROLE_INTERVENANT"] or user.roles == ["ROLE_INTERVENANT","ROLE_COMMERCIAL"] %}
Commercial, Intervenant
{% elseif user.roles == ["ROLE_COMMERCIAL"] %}
Commercial
{% elseif user.roles == ["ROLE_INTERVENANT"] %}
Intervenant
{% elseif user.roles == ["ROLE_ADMIN"] %}
Admin
{% elseif user.roles == ["ROLE_SUPER_ADMIN"] %}
SuperAdmin
{% endif %}
</td>
<td>{{ user.email }}</td>
<td>{{ user.phone }}</td>
<td class="actions-cell d-flex flex-row justify-content-around">
<a class="btn btn-light w-30" href="{{ path('user_show', {id : user.id}) }}" title="Voir l'utilisateur">
<i class="bi bi-eye-fill"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-fill" viewBox="0 0 16 16"><path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/><path d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/></svg></i>
</a>
<a href="{{ path('user_edit', {id : user.id}) }}" class="btn btn-azure w-30" title="Modifier l'utilisateur">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-fill" viewBox="0 0 16 16">
<path d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"/>
</svg>
</a>
{{ include('admin/user/_delete_form.html.twig') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<!-- table-wrapper -->
</div>
</div>
</div>
{% endblock %}