demo_shortcut.html.twig 2.57 KB
Newer Older
Julien Jorry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
{# UNIQUEMENT POUR LES TESTS => fixture de dev #}
{% if app.environment == 'dev' and isDevFixture() and (is_granted('ROLE_ADMIN') or is_granted('ROLE_PREVIOUS_ADMIN')) %}
	{% 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 app.user and 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_caissier') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_caissier'>
					{{ 'CAISSIER'|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 %}