{% extends 'base-admin.html.twig' %}



{% block content %}

  <div class="page-title">
    <div class="title_left">
    <h3>Les utilisateurs</h3>
    </div>

    <div class="title_right">
        <div class="col-md-5 col-sm-5   form-group pull-right top_search">
            <a class="btn btn-secondary" href="{{ path('user_new') }}"> <i class="fa fa-plus"></i> Nouvel Utilisateur</a>
        </div>
    </div>
</div>
  
     
    

     <div class="clearfix"></div>
     {% for message in app.flashes('success')  %}
            <div class="alert alert-success" role="alert">
              {{ message }}
            </div>
        {% endfor %}
        <!-- page content -->
        <div class="left_col" role="main">
          <div class="">
            

            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 ">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Liste des utilisateurs</h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                      <div class="row">
                          <div class="col-sm-12">
                            <div class="card-box table-responsive">
                    <table id="datatable" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th>Id</th>
                <th>Nom</th>
                <th>Prenom</th>
                <th>Username</th>
                <th>Email</th>              
                <th>Profile</th>
                <th>Pays</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for user in users %}
            <tr>
                <td>{{ user.id }}</td>
                <td>{{ user.nom }}</td>
                <td>{{ user.prenom }}</td>
                <td>{{ user.username }}</td>
                <td>{{ user.email }}</td>
                
                <td>{{ user.profile.libelle }}</td>
                <td>{{ (user.pays)? user.pays.nom :''}}</td>
                
                
                    <td class="table-action-class" style="text-align:center; font-size:20px">
                                    <!--<a href="{{ path('user_show', {'id': user.id}) }}" title="Visulaliser">
                                            <i class="fa fa-eye"></i>
                                        </a> -->
                                        <a href="{{ path('user_edit', {'id': user.id}) }}" title="Editer">
                                            <i class="fa fa-edit"></i>
                                        </a>
                                        <a  href="{{ path('user_reset_all', {'id': user.id}) }}"   title="Reinitialiser le mot de passe">
                                            <i class="fa fa-rotate-left"></i>
                                        </a>
                                        <a  href="{{ path('user_desactivate', {'id': user.id}) }}"  title="Désactiver l'utilisateur">
                                            <i style="color:red" class="fa fa-times"></i>
                                        </a>
                                    </td>
                
            </tr>
        {% else %}
            <tr>
                <td colspan="11">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    
                  </div>
                  </div>
              </div>
            </div>
                </div>
                
              </div>
              
              
{% endblock %}
