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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{% if menuItems is not defined %}
{% set menuItems = getMenuItemsFromAlias('main') %}
{% endif %}
<nav class="menu navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="{{ url('index') }}">
<img src="/images/logo.png" height="45" class="d-inline-block align-top" alt="{{ parameter('app.mlc_name') }}">
</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 %}
{% import 'common/menu_tree_macro.html.twig' as tree %}
{% set currentPath = app.request.requestUri %}
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
{% if app.user is null %}
<li class="nav-item dropdownmenu-item has-child dropdown" role="menu-item">
<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>
<div class="dropdown-menu" aria-labelledby="navbarDropdown1">
<a href="/adherer" class="dropdown-item ">{{ 'Adhérer à la MLC'|trans }}</a>
</div>
</li>
{% endif %}
{{ tree.menu(menuItems, currentPath) }}
{# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #}
{% 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')
) %}
<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">
{# MENU ADHERENT CONNECTE #}
{% if is_granted('ROLE_ADHERENT') %}
{# <a href="{{ path('adherent_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
<a href="{{ path('transactionAdherentPrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a>
<a href="{{ path('transactionAdherentAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a> #}
{% endif %}
{# MENU PRESTATAIRE CONNECTE #}
{% if is_granted('ROLE_PRESTATAIRE') %}
{# <a href="{{ path('prestataire_infos') }}" class="dropdown-item">{{ 'Mes infos'|trans }}</a>
<a href="{{ path('transactionPrestataireAdherent') }}" class="dropdown-item">{{ 'Transaction vers adherent'|trans }}</a>
<a href="{{ path('transactionPrestatairePrestataire') }}" class="dropdown-item">{{ 'Transaction vers presta'|trans }}</a> #}
{% endif %}
{# MENU TRESORIER CONNECTE #}
{% if is_granted('ROLE_TRESORIER') %}
{% endif %}
{% if app.user.groups|length > 1 %}
<a href="#" class="viewChoiceGroup dropdown-item">{{ 'Choix du rôle'|trans }}</a>
{% endif %}
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
<a href="{{path('index')}}?_switch_user=_exit" class="dropdown-item">{{ 'Exit impersonate'|trans }}</a>
{% endif %}
<a href="{{ path('fos_user_security_logout') }}" class="dropdown-item">{{ 'Déconnexion'|trans }}</a>
</div>
</li>
{% endif %}
</ul>
</div>
{% endif %}
</nav>