{# UNIQUEMENT POUR LES TESTS #}
{% if app.environment == 'dev' and is_granted('ROLE_USER') %}
	{% set routeName = routeName|default('index')%}
	{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
		<div class='w-100 text-center mb-2'>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=_exit'>
				RETOUR SUPER ADMIN
			</a>
		</div>
	{% else %}
		<div class='mb-2'>
			<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'>
				PRESTATAIRE
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_adherent'>
				ADHERENT
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_adminsiege'>
				ADMIN SIEGE
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_comptoir'>
				COMPTOIR
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_gestiongroupe'>
				GESTION GROUPE
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_contact'>
				CONTACT
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_tresorier'>
				TRESORIER
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_controleur'>
				CONTROLEUR
			</a>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_redacteur'>
				REDACTEUR
			</a>
		</div>
	{% endif %}
{% endif %}

{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion">
	{% if is_granted('ROLE_ADMIN_SIEGE') %}
		{% set siege = getSiege() %}
		{% set compte = siege.getCompte() %}
		{% set soldelabel = 'Solde du siège'|trans %}
		{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'siege/block/transfert_siegegroupe.html.twig' %}
		{% include 'siege/block/transfert_groupesiege.html.twig' %}
	{% elseif is_granted('ROLE_REDACTEUR') %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
	{% elseif is_granted('ROLE_TRESORIER') %}
		{% set siege = getSiege() %}
		{% set compte = siege.getCompte() %}
		{% set soldelabel = 'Solde du siège'|trans %}
		{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{# {% include 'block/soldegroupes.html.twig' %} #}
	{% elseif is_granted('ROLE_CONTROLEUR') %}
		{% include 'block/userinfos.html.twig' %}
	{% elseif is_granted('ROLE_GESTION_GROUPE') %}
		{% if app.user.groupesgere != null %}
			{% set compte = app.user.groupesgere.compte %}
			{% set soldelabel = 'Solde du groupe'|trans %}
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% endif %}
		{% include 'groupe/block/infos.html.twig' %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'block/transactions.html.twig' %}
		{% include 'groupe/block/transaction_comptoir.html.twig' %}
	{% elseif is_granted('ROLE_COMPTOIR') %}
		{% if app.user.comptoirsgere != null %}
			{% set compte = app.user.comptoirsgere.compte %}
			{% set soldelabel = 'Solde du comptoir "'|trans ~ app.user.comptoirsgere ~ '"' %}
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% endif %}
		{% include 'comptoir/block/infos.html.twig' %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'block/transactions.html.twig' %}
		{% include 'comptoir/block/transaction_adherent.html.twig' %}
		{% include 'comptoir/block/reconversion.html.twig' %}
	{% elseif is_granted('ROLE_CONTACT') %}
		{% if app.user.groupesgere != null %}
			{% set compte = app.user.groupesgere.compte %}
			{% set soldelabel = 'Solde du groupe'|trans %}
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% endif %}
		{% include 'groupe/block/infos.html.twig' %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'block/transactions.html.twig' %}
	{% elseif is_granted('ROLE_SUPER_ADMIN') %}
		{% set siege = getSiege() %}
		{% set compte = siege.getCompte() %}
		{% set soldelabel = 'Solde du siège'|trans %}
		{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
	{% elseif is_granted('ROLE_PRESTATAIRE') %}
		{% include 'presta/block/solde.html.twig' %}
		{% include 'presta/block/infos.html.twig' %}
		{% include 'block/userinfos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'block/cotisations.html.twig' %}
		{% include 'block/transactions.html.twig' %}
		{% include 'groupepresta/block/inscription.html.twig' %}
		{% include 'presta/block/transaction_presta.html.twig' %}
		{% include 'presta/block/transaction_adherent.html.twig' %}
		{% include 'presta/block/reconversion.html.twig' %}
	{% elseif is_granted('ROLE_ADHERENT') %}
		{% include 'adherent/block/solde.html.twig' %}
		{% include 'adherent/block/infos.html.twig' %}
		{% include 'block/userpassword.html.twig' %}
		{% include 'block/cotisations.html.twig' %}
		{% include 'block/transactions.html.twig' %}
		{% include 'adherent/block/transaction_presta.html.twig' %}
		{% include 'adherent/block/transaction_adherent.html.twig' %}
	{% else %}
		{% include 'presta/block/carte.html.twig' with {'title': 'Situer les Prestataires'|trans}%}
	{% endif %}
</div>