templates/include/_navbar.html.twig line 1

Open in your IDE?
  1. <nav class="navbar navbar-expand-lg bg-white shadow-sm">
  2.     <div class="container-fluid">
  3.         <a class="navbar-brand" href="{{ path('app_home') }}">Jimi & the wolf</a>
  4.         <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbar"
  5.                 aria-controls="offcanvasNavbar" aria-label="Toggle navigation">
  6.             <span class="navbar-toggler-icon"></span>
  7.         </button>
  8.         <div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasNavbar" aria-labelledby="offcanvasNavbarLabel">
  9.             <div class="offcanvas-header justify-content-end">
  10.                 <h5 class="offcanvas-title" id="offcanvasNavbarLabel">Peter & the wolf</h5>
  11.                 <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
  12.             </div>
  13.             <div class="offcanvas-body">
  14.                 <ul class="navbar-nav justify-content-center flex-grow-1 pe-3 gap-3">
  15.                     <li class="nav-item">
  16.                         <a class="nav-link {{ activeClass(['InstrumentController', 'index']) }}"
  17.                            href="{{ path('app_instrument_index') }}">
  18.                             Catalogue
  19.                         </a>
  20.                     </li>
  21.                     <li class="nav-item">
  22.                         <a class="nav-link {{ activeClass(['SoundController', 'index']) }}"
  23.                            href="{{ path('app_sound_index') }}">
  24.                             Titres
  25.                         </a>
  26.                     </li>
  27.                     {{ component('companies_navigation') }}
  28.                 </ul>
  29.                 <ul class="navbar-nav navbar-nav-utils justify-content-end pe-3">
  30.                     {{ component('search') }}
  31.                     {% if app.user %}
  32.                     <li class="nav-item dropdown">
  33.                         <a class="btn btn-primary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
  34.                             {{ app.user.nickname }}
  35.                         </a>
  36.                         <ul class="dropdown-menu dropdown-menu-end border-0">
  37.                             {% if is_granted('ROLE_ADMIN') %}
  38.                                 <li><a class="dropdown-item" data-turbo="false" href="{{ path('app_admin') }}">Admin</a></li>
  39.                                 <li>
  40.                                     <hr class="dropdown-divider">
  41.                                 </li>
  42.                             {% endif %}
  43.                             <li><a class="dropdown-item" href="#">Account</a></li>
  44.                             <li><a class="dropdown-item" href="#">Settings</a></li>
  45.                             <li>
  46.                                 <hr class="dropdown-divider">
  47.                             </li>
  48.                             <li><a class="dropdown-item" data-turbo="false" href="{{ path('app_logout') }}">Logout</a></li>
  49.                         </ul>
  50.                     </li>
  51.                     {% else %}
  52.                         <li class="nav-item">
  53.                             <a class="btn btn-primary" href="{{ path('app_login') }}">Connexion</a>
  54.                         </li>
  55.                     {% endif %}
  56.                 </ul>
  57.             </div>
  58.         </div>
  59.     </div>
  60. </nav>