templates/layouts/partials/header.html.twig line 1

Open in your IDE?
  1. <nav class="navbar navbar-expand-lg navbar-dark bg-ku-blue">
  2.     <div class="container-fluid">
  3.         <a class="navbar-brand" href="https://ku.edu">KU</a>
  4.         <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
  5.                 aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  6.             <span class="navbar-toggler-icon"></span>
  7.         </button>
  8.         <div class="collapse navbar-collapse" id="navbarSupportedContent">
  9.             <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  10.                 <li class="nav-item">
  11.                     <a class="nav-link{% if app.request.get('_route') == 'home' %} active{% endif %}"
  12.                        href="{{ path('home') }}">Home</a>
  13.                 </li>
  14.                 {% if is_granted('ROLE_ADMIN') %}
  15.                     {% include 'admin/partials/nav.html.twig' %}
  16.                 {% endif %}
  17.             </ul>
  18.             <div class="d-flex">
  19.                 <ul class="navbar-nav ml-auto">
  20.                     {% if not is_granted('ROLE_USER') %}
  21.                         <li class="nav-item">
  22.                             <a title="login" class="nav-link" href="{{ path('app_cas') }}">
  23.                                 <i class="fas fa-sign-in-alt"></i> <span class="sr-only">CAS Login</span>
  24.                             </a>
  25.                         </li>
  26.                     {% else %}
  27.                         <li class="nav-item">
  28.                             <a title="login" class="nav-link" href="{{ path('app_logout') }}">
  29.                                 <i class="fas fa-sign-in-alt"></i> <span class="sr-only">Logout</span>
  30.                             </a>
  31.                         </li>
  32.                     {% endif %}
  33.                 </ul>
  34.             </div>
  35.         </div>
  36.     </div>
  37. </nav>