<!-- 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>
      </div>
      <div class="modal-body">
        <div class='row'>
          {% if app.user %}
            {% for group in app.user.possiblegroups %}
              {% 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-default btn-secondary" href='{{path('presta_choice', {'prestaid' : presta.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{presta}} </a>
                    </div>
                  {% endfor %}
                {% elseif role == 'ROLE_CAISSIER_PRESTATAIRE' %}
                  {% for presta in app.user.caissierprestataires %}
                    <div class='col-6 text-center p-2'>
                      <a role="button" class="btn btn-default btn-secondary" href='{{path('presta_choice', {'prestaid' : presta.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{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-default btn-secondary" href='{{path('comptoir_choice', {'cptid' : comptoir.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{comptoir}} </a>
                    </div>
                  {% endfor %}
                {% elseif role == 'ROLE_CAISSIER_COMPTOIR' %}
                  {% for comptoir in app.user.caissiercomptoirs %}
                    <div class='col-6 text-center p-2'>
                      <a role="button" class="btn btn-default 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-default 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-default btn-secondary" href='{{path('usergroup_choice', {'id': group.id})}}'>{{ group.name|trans }}</a>
                  </div>
                {% endif %}
              {% endfor %}
            {% endfor %}
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>