<!-- Modal -->
<div class="modal fade" id="roleGroupeModal" tabindex="-1" role="dialog" aria-labelledby="roleGroupeModalTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="roleGroupeModalLongTitle">{{ 'Choix du rôle'|trans }}</h5>
        {# <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button> #}
      </div>
      <div class="modal-body">
        <div class='row'>
          {% if app.user %}
            {# 
            TODO : choisir le rôle ainsi que le groupe/comptoir/presta si l'utilisateur en gère plusieurs 

            PRESTA                => choisir le presta
            GESTIONNAIRE GROUPE   => choisir le groupe
            CONTACT               => choisir le groupe
            TRESORIER             => choisir le groupe
            GESTIONNAIRE COMPTOIR => choisir le comptoir
            #}
            {% for group in app.user.groups %}
              {% for role in group.roles %}
                {% if role == 'ROLE_PRESTATAIRE' %}
                  {% for presta in app.user.prestataires %}
                    <div class='col-6 text-center p-2'>
                      <a role="button" class="btn btn-secondary" href='{{path('presta_choice', {'prestaid' : presta.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - azaiuhzaiuh aziuzah iuzah iazhazihiuhazuihazi za za{{presta}} </a>
                    </div>
                  {% endfor %}
                {% elseif role == 'ROLE_COMPTOIR' %}
                  {% for comptoir in app.user.comptoirsgeres %}
                    <div class='col-6 text-center p-2'>
                      <a role="button" class="btn btn-secondary" href='{{path('comptoir_choice', {'cptid' : comptoir.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{comptoir}} </a>
                    </div>
                  {% endfor %}
                {% elseif role == 'ROLE_TRESORIER' or role == 'ROLE_CONTACT' or role == 'ROLE_GESTION_GROUPE' %}
                  {% for groupe in app.user.groupesgeres %}
                    <div class='col-6 text-center p-2'>
                      <a role="button" class="btn btn-secondary" href='{{path('groupe_choice', {'grpid' : groupe.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{groupe}} </a>
                    </div>
                  {% endfor %}
                {% elseif role == 'ROLE_ADHERENT' or role == 'ROLE_ADMIN_SIEGE' or role == 'ROLE_REDACTEUR' or role == 'ROLE_CONTROLEUR' or role == 'ROLE_SUPER_ADMIN' %}
                  <div class='col-6 text-center p-2'>
                    <a role="button" class="btn btn-secondary" href='{{path('usergroup_choice', {'id': group.id})}}'>{{ group.name|trans }}</a>
                  </div>
                {% endif %}
              {% endfor %}
            {% endfor %}
          {% endif %}
        </div>
      </div>
      {# <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">{{ 'Fermer'|trans }}</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div> #}
    </div>
  </div>
</div>