templates/admin/user/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Liste des utilisateurs{% endblock %}
  3. {% block body %}
  4.     <div class="page-header">
  5.         <h1 class="page-title">Liste des utilisateurs</h1>
  6.         <ol class="breadcrumb">
  7.             <li class="breadcrumb-item"><a href="{{ path('home') }}">Accueil Admin</a></li>
  8.             <li class="breadcrumb-item active" aria-current="page">Utilisateurs</li>
  9.         </ol>
  10.     </div>
  11.     <div class="row">
  12.         <div class="col-md-12 col-lg-12">
  13.             <div class="card">
  14.                 <div class="card-header">
  15.                     <a href="{{ path('user_new') }}" class="btn btn-azure">Ajouter un nouvel utilisateur</a>
  16.                 </div>
  17.                 <div class="card-body">
  18.                     <div class="table-responsive">
  19.                         <table id="data-table" class="table table-striped table-bordered" >
  20.                             <thead>
  21.                             <tr>
  22.                                 <th class="w-15">Nom</th>
  23.                                 <th class="w-15">Prénom</th>
  24.                                 <th>Rôle</th>
  25.                                 <th>Email</th>
  26.                                 <th>Téléphone</th>
  27.                                 <th class="w-15">Actions</th>
  28.                             </tr>
  29.                             </thead>
  30.                             <tbody>
  31.                             {% for user in users %}
  32.                                 <tr>
  33.                                     <td>{{ user.firstName }}</td>
  34.                                     <td>{{ user.lastName }}</td>
  35.                                     <td>{% if user.roles == ["ROLE_COMMERCIAL","ROLE_INTERVENANT"] or user.roles == ["ROLE_INTERVENANT","ROLE_COMMERCIAL"] %}
  36.                                             Commercial, Intervenant
  37.                                         {% elseif user.roles == ["ROLE_COMMERCIAL"] %}
  38.                                             Commercial
  39.                                         {% elseif user.roles == ["ROLE_INTERVENANT"] %}
  40.                                             Intervenant
  41.                                         {% elseif user.roles == ["ROLE_ADMIN"] %}
  42.                                             Admin
  43.                                         {% elseif user.roles == ["ROLE_SUPER_ADMIN"] %}
  44.                                             SuperAdmin
  45.                                         {% endif %}
  46.                                     </td>
  47.                                     <td>{{ user.email }}</td>
  48.                                     <td>{{ user.phone }}</td>
  49.                                     <td class="actions-cell d-flex flex-row justify-content-around">
  50.                                         <a class="btn btn-light w-30" href="{{ path('user_show', {id : user.id}) }}" title="Voir l'utilisateur">
  51.                                             <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>
  52.                                         </a>
  53.                                         <a href="{{ path('user_edit', {id : user.id}) }}" class="btn btn-azure w-30" title="Modifier l'utilisateur">
  54.                                             <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-fill" viewBox="0 0 16 16">
  55.                                                 <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"/>
  56.                                             </svg>
  57.                                         </a>
  58.                                         {{ include('admin/user/_delete_form.html.twig') }}
  59.                                     </td>
  60.                                 </tr>
  61.                             {% endfor %}
  62.                             </tbody>
  63.                         </table>
  64.                     </div>
  65.                 </div>
  66.                 <!-- table-wrapper -->
  67.             </div>
  68.         </div>
  69.     </div>
  70. {% endblock %}