{# UNIQUEMENT POUR LES TESTS => fixture de dev #}
{% if app.environment == 'dev' and is_granted('ROLE_ADMIN') and isDevFixture() %}
	{% 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'|trans }}
			</a>
		</div>
	{% elseif is_granted('ROLE_SUPER_ADMIN') %}
		<div class='mb-2 group text-center'>
			{% if isDevFixture('user_prestataire') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'>
					{{ 'PRESTATAIRE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_adherent') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_adherent'>
					{{ 'ADHERENT'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_adminsiege') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_adminsiege'>
					{{ 'ADMIN SIEGE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_comptoir') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_comptoir'>
					{{ 'COMPTOIR'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_gestiongroupe') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_gestiongroupe'>
					{{ 'GESTION GROUPE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_contact') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_contact'>
					{{ 'CONTACT'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_tresorier') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_tresorier'>
					{{ 'TRESORIER'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_controleur') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_controleur'>
					{{ 'CONTROLEUR'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_redacteur') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_redacteur'>
					{{ 'REDACTEUR'|trans }}
				</a>
			{% endif %}
		</div>
	{% endif %}
{% endif %}

{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion">
	{% if not app.request.session.has('_choixGroup') %}
		{% if isCurrentRoleGranted('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/solde.html.twig' with {'compte': siege.getCompteNantie(), 'soldelabel': 'Monnaie nantie'} %}
			{% 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 isCurrentRoleGranted('ROLE_REDACTEUR') %}

			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif isCurrentRoleGranted('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 isCurrentRoleGranted('ROLE_CONTROLEUR') %}

			{% include 'block/userinfos.html.twig' %}

		{% elseif isCurrentRoleGranted('ROLE_GESTION_GROUPE') %}

			{% if app.session.get('_groupegere') != null %}
				{% set compte = app.session.get('_groupegere').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' %}
			{% include 'groupe/block/retourgroupe.html.twig' %}

		{% elseif isCurrentRoleGranted('ROLE_COMPTOIR') %}

			{% if app.session.get('_comptoirgere') != null %}
				{% set compte = app.session.get('_comptoirgere').compte %}
				{% set soldelabel = 'Solde du comptoir "'|trans ~ app.session.get('_comptoirgere') ~ '"' %}
				{% 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/vente_adherent.html.twig' %}
			{% include 'comptoir/block/vente_prestataire.html.twig' %}
			{% include 'comptoir/block/retrait_prestataire.html.twig' %}
			{% include 'comptoir/block/retrait_adherent.html.twig' %}
			{% include 'comptoir/block/reconversion.html.twig' %}

		{% elseif isCurrentRoleGranted('ROLE_CONTACT') %}

			{% include 'groupe/block/infos.html.twig' %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif isCurrentRoleGranted('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/solde.html.twig' with {'compte': siege.getCompteNantie(), 'soldelabel': 'Monnaie nantie'} %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif isCurrentRoleGranted('ROLE_PRESTATAIRE') and app.user and app.session.has('_prestagere') %}

			{% set esoldelabel = 'Solde e-mlc'|trans %}
			{% include 'block/solde.html.twig' with {'compte': app.session.get('_prestagere').ecompte, 'soldelabel': esoldelabel} %}
			{% 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' %}
			{% if app.session.get('_prestagere').ecompte > 0 %}
				{% include 'presta/block/reconversion.html.twig' %}
			{% endif %}

		{% elseif isCurrentRoleGranted('ROLE_ADHERENT') and app.user and app.user.adherent %}

			{% set esoldelabel = 'Solde e-mlc'|trans %}
			{% include 'block/solde.html.twig' with {'compte': app.user.adherent.ecompte, 'soldelabel': esoldelabel} %}
			{% 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 %}
	{% endif %}
</div>