templates/components/_navbar.html.twig line 1

Open in your IDE?
  1. <nav class="navbar navbar-expand-lg bg-navbar">
  2.     <div class="container">
  3.         <a class="navbar-brand" href="{{ path('home_index') }}">3D.KRO</a>
  4.         <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  5.             <span class="navbar-toggler-icon"></span>
  6.         </button>
  7.         <div class="collapse navbar-collapse" id="navbarSupportedContent">
  8.             <ul class="navbar-nav me-auto d-flex align-items-center">
  9.                 <li class="nav-item">
  10.                     <a class="nav-link mx-4{% if app.request.get('_route') == 'product_index' %} active"{% endif %}" href="{{ path('product_index') }}"><i class="bi bi-box-seam"></i> Produits</a>
  11.                 </li>
  12.                 <li class="nav-item">
  13.                     <a class="nav-link mx-4{% if app.request.get('_route') == 'home_gallery' %} active"{% endif %}" href="{{ path('home_gallery') }}"><i class="bi bi-camera"></i> Galerie</a>
  14.                 </li>
  15.                 <li class="nav-item">
  16.                     <a class="nav-link mx-4{% if app.request.get('_route') == 'contact_index' %} active"{% endif %}" href="{{ path('contact_index') }}"><i class="bi bi-chat-right-dots"></i> Contact</a>
  17.                 </li>
  18.             </ul>
  19.             <ul class="navbar-nav d-flex align-items-center">
  20.                 {% if app.user %}
  21.                 <li class="nav-item">
  22.                     <a class="nav-link mx-4{% if app.request.get('_route') == 'product_cart' %} active"{% endif %}" href="{{ path('product_cart') }}"><i class="bi bi-cart3"></i> Panier ({{ countCart() }})</a>
  23.                 </li>
  24.                 {% endif %}
  25.                 {% if is_granted('ROLE_ADMIN') %}
  26.                     <li class="nav-item dropdown">
  27.                         <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  28.                             <i class="bi bi-sliders"></i> Administration
  29.                         </a>
  30.                         <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  31.                             <a class="dropdown-item{% if app.request.get('_route') == 'management_index' %} active"{% endif %}" href="{{ path('management_index') }}">Produits</a>
  32.                             <a class="dropdown-item{% if app.request.get('_route') == 'gallery_index' %} active"{% endif %}" href="{{ path('gallery_index') }}">Galerie</a>
  33.                             <a class="dropdown-item{% if app.request.get('_route') == 'order_index' %} active"{% endif %}" href="{{ path('order_index') }}">Commandes</a>
  34.                             <div class="dropdown-divider"></div>
  35.                             <a class="dropdown-item{% if app.request.get('_route') == 'conversation_index' %} active"{% endif %}" href="{{ path('conversation_index') }}">Messagerie</a>
  36.                         </div>
  37.                     </li>
  38.                 {% endif %}
  39.                 {% if app.user %}
  40.                     <li class="nav-item">
  41.                         <a class="btn btn-navbar-login my-2" href="{{ path('security_logout') }}">Déconnexion</a>
  42.                     </li>
  43.                 {% else %}
  44.                     <li class="nav-item">
  45.                         <a class="nav-link mx-4{% if app.request.get('_route') == 'security_register' %} active"{% endif %}"" href="{{ path('security_register') }}">S'inscrire</a>
  46.                     </li>
  47.                     <li class="nav-item">
  48.                         <a class="btn btn-navbar-login my-2" href="{{ path('security_login') }}">Connexion</a>
  49.                     </li>
  50.                 {% endif %}
  51.             </ul>
  52.         </div>
  53.     </div>
  54. </nav>