templates/_header.html.twig line 1

Open in your IDE?
  1. {% set notifs = notifications.findAllUnread() %}
  2. {% set unreadNotifs = notifs %}
  3. {#{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REFERENT') %}#}
  4. {#    {% set unreadNotifs = notifs|filter(n => n.readAt is not defined or n.readAt is null) %}#}
  5. {#{% else %}#}
  6. {#    {% set unreadNotifs = notifs|filter(n => n.userReadAt is not defined or n.userReadAt is null)|map(n => n[0] is defined ? n[0] : n) %}#}
  7. {#{% endif %}#}
  8. {% set maxNotifs = app_notification_header_number %}
  9. <header class="main-header" role="banner">
  10.     <!-- Logo -->
  11.     <a aria-label="logo" href="{{ path('reporting_dashboard_index') }}" class="logo">
  12.         <span class="logo-mini"><img src="{{ asset(app_image_sidebar_reduced_path) }}" alt="Madis"/></span>
  13.         <span class="logo-lg"><img class="fit-picture" src={{ asset(app_image_logo_blanc) }} width="65%" alt="Logo Madis"></span>
  14.     </a>
  15.     <!-- Header Navbar -->
  16.     <nav class="navbar navbar-static-top" role="navigation" aria-label="En-tĂȘte principal">
  17.         <!-- Sidebar toggle button-->
  18.         <a aria-label="Sidebar" href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
  19.             <i class="fa fa-bars"></i>
  20.         </a>
  21.         <!-- Navbar Right Menu -->
  22.         <div class="navbar-custom-menu">
  23.             <ul class="nav navbar-nav">
  24.                 {% if app_activate_notifications %}
  25.                 <li id="notifications" class="nav-item dropdown notifications-menu">
  26.                     <a class="nav-link" data-toggle="dropdown" href="#">
  27.                         <i class="fa fa-bell"></i>
  28.                         {% if notifs|length %}
  29.                         <span class="badge bg-yellow navbar-badge">{{ notifs|length }}</span>
  30.                         {% endif %}
  31.                     </a>
  32.                     <ul class="dropdown-menu dropdown-large" style="width:600px">
  33.                         {{ block("body", "Notification/Notification/box.html.twig") }}
  34.                     </ul>
  35.                 </li>
  36.                 {% endif %}
  37.                 {% if app.user is defined %}
  38.                 <!-- User Account Menu -->
  39.                 <li class="dropdown user user-menu">
  40.                     <!-- Menu Toggle Button -->
  41.                     <a {% if not is_granted('ROLE_PREVIOUS_ADMIN') %} href="{{ path('logout') }}"{% endif %} class="dropdown-toggle">
  42.                         <span style="margin-right: 5px;">{{ app.user }} - {{ app.user.roles[0]|dictionary('user_user_role') }}</span>
  43.                         <i class="fa fa-power-off"></i>
  44.                     </a>
  45.                 </li>
  46.                 {% endif %}
  47.             </ul>
  48.         </div>
  49.     </nav>
  50. </header>