templates/navbar/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Hello NavbarController!{% endblock %}
  3. {% block body %}
  4.     <style>
  5.         .navbar {
  6.             margin-bottom: 5rem;
  7.         }
  8.         .navbar-brand:hover {
  9.             scale: 1.1;
  10.             transition-duration: 0.5s;
  11.         }
  12.         .nav-link:after {
  13.             background: none repeat scroll 0 0 transparent;
  14.             bottom: 0;
  15.             content: "";
  16.             display: block;
  17.             height: 2px;
  18.             left: 50%;
  19.             background: #fff;
  20.             transition: width 0.3s ease 0s, left 0.3s ease 0s;
  21.             width: 0;
  22.         }
  23.         .nav-link:hover:after {
  24.             width: 50%;
  25.             left: 0;
  26.         }
  27.     </style>
  28.     <nav class="navbar navbar-dark bg-dark fixed-top">
  29.         <div class="container-fluid">
  30.             <a class="navbar-brand" href={{ path('app_home') }}>
  31.                 <h2>ALTIUS</h2>
  32.             </a>
  33.             <button class="navbar-toggler" type="button" data-bs-toggle="offcanvas"
  34.                     data-bs-target="#offcanvasDarkNavbar" aria-controls="offcanvasDarkNavbar">
  35.                 <span class="navbar-toggler-icon"></span>
  36.             </button>
  37.             <div class="offcanvas offcanvas-end text-bg-dark" tabindex="-1" id="offcanvasDarkNavbar"
  38.                  aria-labelledby="offcanvasDarkNavbarLabel">
  39.                 <div class="offcanvas-header">
  40.                     <button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvas"
  41.                             aria-label="Close"></button>
  42.                 </div>
  43.                 <div class="offcanvas-body">
  44.                     <ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
  45.                         <div class="container-fluid mb-5">
  46.                             {% if is_granted("ROLE_USER") %}
  47.                                 <figure class="d-inline-flex">
  48.                                 </figure>
  49.                             {% endif %}
  50.                         </div>
  51.                         {% if is_granted('ROLE_USER') %}
  52.                             <li class="nav-item h2">
  53.                                 <a class="nav-link" href={{ path('app_logout') }}>Déconnexion</a>
  54.                             </li>
  55.                             <li class="nav-item h2">
  56.                                 <a class="nav-link" href="{{ path('app_bailleur_new') }}">Créer un nouveau Bailleur</a>
  57.                             </li>
  58.                             <li class="nav-item h2">
  59.                                 <a class="nav-link" href="{{ path('app_bailleur_index') }}">Liste des bailleurs</a>
  60.                             </li>
  61.                         {% else %}
  62.                             <li class="nav-item h2">
  63.                                 <a class="nav-link active" aria-current="page"
  64.                                    href={{ path('app_login') }}>Connexion</a>
  65.                             </li>
  66.                         {% endif %}
  67.                         {% if is_granted('ROLE_ADMIN') %}
  68.                             {% if is_granted('ROLE_ADMIN') %}
  69.                                 <li class="nav-item h2">
  70.                                     <a class="nav-link" href="{{ path('app_user_new') }}">Nouvel utilisateur</a>
  71.                                 </li>
  72.                             {% endif %}
  73.                         {% endif %}
  74.                     </ul>
  75.                 </div>
  76.             </div>
  77.         </div>
  78.     </nav>
  79. {% endblock %}
  80.