<div class="container-fluid">
<header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
{% if app.request.get('_route_params')['slug'] is defined %}
{% set active_page = app.request.get('_route_params')['slug'] %}
{% else %}
{% set active_page = 'homepage' %}
{% endif %}
<a href="/" class="d-flex align-items-center col-md-2 mb-2 mb-md-0 text-dark text-decoration-none">
<img src="{{ asset('build/img/ferme_logo.png') }}" alt="" class="bi me-2" id="logo-navbar" role="img">
</a>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
{% for item in generateMenu() %}
{% if item.children is empty and item.parent is null %}
<li class="nav-item px-2 ms-4">
<a href="{{ path('app_page_show', {'slug': item.slug}) }}" class="nav-link px-4 {% if item.slug is same as active_page %}active{% endif %}">
<strong>
{{ item.title }}
</strong>
</a>
</li>
{% elseif item.children is not empty %}
<li class="nav-item dropdown px-2 ms-4">
<a href="#" data-bs-toggle="dropdown" class="nav-link dropdown-toggle px-4">
<strong>{{ item.title }}</strong>
</a>
<div class="dropdown-menu">
{% for children in item.children %}
{% if children.online == '1' %}
<a href="{{ path('app_page_show', {'slug': children.slug}) }}" class="dropdown-item">
<strong>
{{ children.title }}
</strong>
</a>
{% endif %}
{% endfor %}
</div>
</li>
{% endif %}
{% endfor %}
</ul>
<div class="col-md-2 text-end">
{% if is_granted('ROLE_USER') %}
<a href="{{ path('app_logout') }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
Déconnexion
</a>
<a href="{{ path('app_user_show', {'id': app.user.id}) }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
Votre profil
</a>
{% elseif is_granted('ROLE_ADMIN') %}
<a href="{{ path('app_logout') }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
Logout
</a>
<a href="{{ path('easyadmin') }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
> Admin
</a>
{% else %}
<a href="{{ path('app_login') }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
Se connecter
</a>
<a href="{{ path('app_register') }}" type="button"
class="btn btn-outline-primary btn-sm me-2">
Creer un compte
</a>
{% endif %}
</div>
</header>
</div>