You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
2.7 KiB

5 months ago
5 months ago
5 months ago
5 months ago
  1. <header>
  2. <nav class="navbar navbar-expand-lg bg-body-tertiary">
  3. <div class="container-fluid">
  4. <a class="navbar-brand" href="{{ path('app_home') }}" title="{{ long_title }}">{{ title }}</a>
  5. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
  6. <span class="navbar-toggler-icon"></span>
  7. </button>
  8. <div class="collapse navbar-collapse" id="navbar">
  9. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  10. {% for item in menu.header %}
  11. <li class="nav-item">
  12. <a {% if app.request.attributes.get('_route') == item.route %}class="nav-link active" aria-current="page"{% else %}class="nav-link"{% endif %} href="{{ path(item.route) }}">{{ item.icon|raw }} {{ item.label }}</a>
  13. </li>
  14. {% endfor %}
  15. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  16. <li class="nav-item dropdown">
  17. <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  18. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
  19. <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
  20. </svg>
  21. {{ app.user.username }}
  22. </a>
  23. <ul class="dropdown-menu">
  24. <li><a class="dropdown-item" href="{{ path('app_osm_logout') }}">Déconnexion</a></li>
  25. </ul>
  26. </li>
  27. {% else %}
  28. <li class="nav-item">
  29. <a class="nav-link" href="{{ path('app_osm_request') }}">
  30. <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
  31. <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
  32. </svg>
  33. Connexion
  34. </a>
  35. </li>
  36. {% endif %}
  37. </ul>
  38. </div>
  39. </div>
  40. </nav>
  41. </header>