menu.html.twig 4.44 KB
Newer Older
1 2 3 4 5 6
{% if menuItems is not defined %}
	{% set menuItems = getMenuItemsFromAlias('main') %}
{% endif %}



7 8
<nav class="menu navbar navbar-expand-md navbar-light bg-light">
	<a class="navbar-brand" href="{{ url('index') }}">
9
		<img src="/images/logo.png" height="45" class="d-inline-block align-top" alt="{{ parameter('app.mlc_name') }}">
10 11 12 13 14 15
	</a>
	<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
		<span class="navbar-toggler-icon"></span>
	</button>

	{% if menuItems is not null and menuItems|length > 0 %}
16 17 18
		{% import 'common/menu_tree_macro.html.twig' as tree %}
		{% set currentPath = app.request.requestUri %}
		<div class="collapse navbar-collapse" id="navbarSupportedContent">
19
			<ul class="navbar-nav ml-auto">
20 21
				{% if app.user is null %}
					<li class="nav-item dropdownmenu-item has-child dropdown" role="menu-item">
22
	                    <a href="#" id="navbarDropdown1" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link parent dropdown-toggle ">{{ 'Adhérer'|trans }}</a>
23
	                	<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
24
							<a href="/adherer" class="dropdown-item ">{{ 'Adhérer à la MLC'|trans }}</a>
25 26 27
	                	</div>
	                </li>
	            {% endif %}
28 29
				{{ tree.menu(menuItems, currentPath) }}
				{# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #}
30 31 32 33 34 35 36 37
				{% if app.user and (is_granted('ROLE_ADMIN_SIEGE') or
									is_granted('ROLE_SUPER_ADMIN') or
									is_granted('ROLE_TRESORIER') or
									is_granted('ROLE_CONTACT') or
									is_granted('ROLE_GESTION_GROUPE') or
									is_granted('ROLE_COMPTOIR') or
									is_granted('ROLE_CONTROLEUR')
									) %}
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
					<li class="nav-item ml-auto" role="menu-item">
						<a href="{{ path('sonata_admin_dashboard') }}" class="nav-link" data-toggle="tooltip" data-placement="bottom" title="{{ 'Administration'|trans }}">
							{# {{ 'Administration'|trans }} #}
							<i class="fas fa-cog"></i>
						</a>
					</li>
				{% endif %}
				{# MENU UTILISATEUR CONNECTE #}
				{% if app.user %}
					<li class="nav-item dropdown" role="menu-item">
						<a href="#" id="navbarDropdownUC" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link parent dropdown-toggle" alt='{{ app.user.name }}'>
							<span style="{# font-size: 1em; color: grey; #}">
								<i class="fas fa-user"></i>
							</span>
						</a>
	                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUC">
54 55

	                    	{# MENU ADHERENT CONNECTE #}
56
	                    	{% if is_granted('ROLE_ADHERENT') %}
Julien Jorry committed
57
	                    		{# <a href="{{ path('adherent_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
58
	                    		<a href="{{ path('transactionAdherentPrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a>
Julien Jorry committed
59
	                    		<a href="{{ path('transactionAdherentAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a> #}
60
	                    	{% endif %}
61 62

	                    	{# MENU PRESTATAIRE CONNECTE #}
63
	                    	{% if is_granted('ROLE_PRESTATAIRE') %}
Julien Jorry committed
64
	                    		{# <a href="{{ path('prestataire_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
65
	                    		<a href="{{ path('transactionPrestataireAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a>
Julien Jorry committed
66
	                    		<a href="{{ path('transactionPrestatairePrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a> #}
67
	                    	{% endif %}
68

Julien Jorry committed
69
	                    	{# MENU TRESORIER CONNECTE #}
70 71 72
	                    	{% if is_granted('ROLE_TRESORIER') %}
	                    	{% endif %}

73 74 75
	                    	{% if app.user.groups|length > 1 %}
		                    	<a href="#" class="viewChoiceGroup dropdown-item">{{ 'Choix du rôle'|trans }}</a>
		                    {% endif %}
76 77 78
		                    {% if is_granted('ROLE_PREVIOUS_ADMIN') %}
							    <a href="{{path('index')}}?_switch_user=_exit" class="dropdown-item">{{ 'Exit impersonate'|trans }}</a>
							{% endif %}
79 80 81 82 83
		                    <a href="{{ path('fos_user_security_logout') }}" class="dropdown-item">{{ 'Déconnexion'|trans }}</a>
	                    </div>
					</li>
				{% endif %}
			</ul>
84
		</div>
85
	{% endif %}
86

87
</nav>