{% set notifs = notifications.findAllUnread() %}
{% set unreadNotifs = notifs %}
{#{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REFERENT') %}#}
{# {% set unreadNotifs = notifs|filter(n => n.readAt is not defined or n.readAt is null) %}#}
{#{% else %}#}
{# {% set unreadNotifs = notifs|filter(n => n.userReadAt is not defined or n.userReadAt is null)|map(n => n[0] is defined ? n[0] : n) %}#}
{#{% endif %}#}
{% set maxNotifs = app_notification_header_number %}
<header class="main-header" role="banner">
<!-- Logo -->
<a aria-label="logo" href="{{ path('reporting_dashboard_index') }}" class="logo">
<span class="logo-mini"><img src="{{ asset(app_image_sidebar_reduced_path) }}" alt="Madis"/></span>
<span class="logo-lg"><img class="fit-picture" src={{ asset(app_image_logo_blanc) }} width="65%" alt="Logo Madis"></span>
</a>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top" role="navigation" aria-label="En-tĂȘte principal">
<!-- Sidebar toggle button-->
<a aria-label="Sidebar" href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<i class="fa fa-bars"></i>
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{% if app_activate_notifications %}
<li id="notifications" class="nav-item dropdown notifications-menu">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fa fa-bell"></i>
{% if notifs|length %}
<span class="badge bg-yellow navbar-badge">{{ notifs|length }}</span>
{% endif %}
</a>
<ul class="dropdown-menu dropdown-large" style="width:600px">
{{ block("body", "Notification/Notification/box.html.twig") }}
</ul>
</li>
{% endif %}
{% if app.user is defined %}
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a {% if not is_granted('ROLE_PREVIOUS_ADMIN') %} href="{{ path('logout') }}"{% endif %} class="dropdown-toggle">
<span style="margin-right: 5px;">{{ app.user }} - {{ app.user.roles[0]|dictionary('user_user_role') }}</span>
<i class="fa fa-power-off"></i>
</a>
</li>
{% endif %}
</ul>
</div>
</nav>
</header>