templates/partials/navbar.html.twig line 1

Open in your IDE?
  1. <nav class="navbar navbar-expand-lg navbar-light fixed-top py-3" data-navbar-on-scroll="data-navbar-on-scroll">
  2.     <div class="container">
  3.         <a class="navbar-brand" href="{{ path('home') }}">
  4.             <img src="{{ asset('assets/img/icons/logo2.png') }}" alt="" width="150" height="150"/>
  5.             <span class="text-1000 fs-6 ms-2 fw-medium">Pfau<span class="fw-bold">PN</span></span>
  6.         </a>
  7.         <button class="navbar-toggler collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
  8.             aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  9.             <span class="navbar-toggler-icon"></span>
  10.         </button>
  11.         <div class="collapse navbar-collapse" id="navbarSupportedContent">
  12.             <ul class="navbar-nav mx-auto border-bottom border-lg-bottom-0 pt-2 pt-lg-0">
  13.                 <li class="nav-item">
  14.                     <a class="nav-link {% if app.request.get('_route') == 'home' %}active{% endif %}" 
  15.                     aria-current="page" 
  16.                     href="{{ path('home') }}">
  17.                         Startseite
  18.                     </a>
  19.                 </li>
  20.                 <li class="nav-item">
  21.                     <a class="nav-link {% if app.request.get('_route') == 'about' %}active{% endif %}" 
  22.                     aria-current="page" 
  23.                     href="{{ path('about') }}">
  24.                         Über uns
  25.                     </a>
  26.                 </li>
  27.                 <li class="nav-item">
  28.                     <a class="nav-link {% if app.request.get('_route') == 'leistung' %}active{% endif %}" 
  29.                     aria-current="page" 
  30.                     href="{{ path('leistung') }}">
  31.                         Leistung
  32.                     </a>
  33.                 </li>
  34.                 <li class="nav-item">
  35.                     <a class="nav-link {% if app.request.get('_route') == 'preise' %}active{% endif %}" 
  36.                     aria-current="page" 
  37.                     href="{{ path('preise') }}">
  38.                         Preise
  39.                     </a>
  40.                 </li>
  41.                 <li class="nav-item">
  42.                     <a class="nav-link {% if app.request.get('_route') == 'hilfe' %}active{% endif %}" 
  43.                     aria-current="page" 
  44.                     href="{{ path('hilfe') }}">
  45.                         Hilfe
  46.                     </a>
  47.                 </li>
  48.             </ul>
  49.             
  50.             <form class="d-flex py-3 py-lg-0">
  51.                 {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  52.                     <!-- Wenn Benutzer authentifiziert ist -->
  53.                     {% if is_granted('ROLE_ADMIN') %}
  54.                         <!-- Admin Button, wenn Benutzer ROLE_ADMIN hat -->
  55.                         <a class="btn btn-outline-info rounded-pill order-0 me-2" href="{{ path('admin_overview') }}">Adminbereich</a>
  56.                         
  57.                     {% endif %}
  58.                     <!-- Benutzer Interface Button -->
  59.                     <a class="btn btn-link text-1000 fw-medium order-1 order-lg-0" href="{{ path('user_interface') }}">
  60.                         {{ app.user.email }}  <!-- Benutzername anzeigen -->
  61.                     </a>
  62.                     <!-- Logout Button -->
  63.                     <a class="btn btn-outline-danger rounded-pill order-0 ms-2" href="{{ path('app_logout') }}">Logout</a>
  64.                 {% else %}
  65.                     <!-- Zeige 'Anmelden' und 'Registrieren' an, wenn der Benutzer nicht eingeloggt ist -->
  66.                     <a class="btn btn-link text-1000 fw-medium order-1 order-lg-0" href="{{ path('app_login') }}">Anmelden</a>
  67.                     <a class="btn btn-outline-danger rounded-pill order-0 ms-2" href="{{ path('app_register') }}">Registrieren</a>
  68.                 {% endif %}
  69.             </form>
  70.         </div>
  71.     </div>
  72. </nav>