templates/header.html.twig line 1

Open in your IDE?
  1. <nav class="navbar navbar-expand-lg navbar-light bg-light">
  2.     <div class="container-fluid">
  3.         <a class="navbar-brand" href="{{ path('app_homepage') }}">{{ appName }}</a>
  4.         <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{% trans %}Toggle navigation{% endtrans %}">
  5.             <span class="navbar-toggler-icon"></span>
  6.         </button>
  7.         <div class="collapse navbar-collapse" id="navbarSupportedContent">
  8.             <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
  9.                 {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  10.                     {% set notificationReceiptsPopoverContent %}
  11.                         {% include 'notifications/index.html.twig' %}
  12.                     {% endset %}
  13.                     <li class="nav-item">
  14.                         <a class="nav-link" type="button" href="#" data-bs-container="body"
  15.                            data-bs-toggle="popover" data-bs-placement="bottom"
  16.                            title="{% trans %}Notifications{% endtrans %}" data-bs-content="{{ notificationReceiptsPopoverContent | escape }}">
  17.                             <i class="fa-solid fa-bell"></i>
  18.                             {% set numberOfUnreadNotifications = app.user.notificationReceipts | length %}
  19.                             {% if numberOfUnreadNotifications > 0 %}
  20.                             <span class="badge rounded-pill bg-danger">
  21.                                 {{ numberOfUnreadNotifications }}
  22.                             </span>
  23.                             {% endif %}
  24.                         </a>
  25.                     </li>
  26.                     <li class="nav-item dropdown">
  27.                         <a class="nav-link dropdown-toggle" href="#" id="user-menu"
  28.                            role="button" data-bs-toggle="dropdown" aria-expanded="false">
  29.                             <i class="fa fa-user"></i> {{ app.user.email }}
  30.                         </a>
  31.                     </li>
  32.                     <li class="nav-item">
  33.                         <a class="nav-link" href="{{ path('app_logout') }}"><i class="bi bi-box-arrow-right"></i> {% trans %}Log out{% endtrans %}</a>
  34.                     </li>
  35.                 {% else %}
  36.                     <li class="nav-item">
  37.                         <a class="nav-link" href="{{ path('login') }}"><i class="bi bi-box-arrow-in-right"></i> {% trans %}Log in{% endtrans %}</a>
  38.                     </li>
  39.                 {% endif %}
  40.             </ul>
  41.         </div>
  42.     </div>
  43. </nav>