{% if request.user.is_superuser %}

<div class="bs-example container-fluid">
    <nav
      class="navbar navbar-expand-md navbar-dark fixed-top"
      style="background: #343a40"
    >
      <a href="/" class="navbar-brand">Admin Panel</a>
      <button
        type="button"
        class="navbar-toggler"
        data-toggle="collapse"
        data-target="#navbarCollapse"
      >
        <span class="navbar-toggler-icon"></span>
      </button>

      <div
        class="collapse navbar-collapse justify-content-between"
        id="navbarCollapse"
      >
        <div class="navbar-nav">
          <a href="{% url 'allUsers' %}" class="nav-item nav-link">Customer</a>
          <a href="{% url 'adminOrders' %}" class="nav-item nav-link">View Orders</a>
          <a href="{% url 'adminProductView' %}" class="nav-item nav-link">Manage Products</a>
          <a href="{% url 'adminAddCategory' %}" class="nav-item nav-link">Category</a>
          <!-- <a href="/view-feedback" class="nav-item nav-link">Feedback</a> -->
        </div>

        <div class="navbar-nav navbar-right">
          <a href="/logout" class="nav-item nav-link"> Logout</a>
        </div>
        
      </div>
    </nav>
  </div>


{% else %}

<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container-fluid">
      <a class="navbar-brand" href="{% url 'home' %}">Logo</a>
      <button
        class="navbar-toggler"
        type="button"
        data-bs-toggle="collapse"
        data-bs-target="#navbarSupportedContent"
        aria-controls="navbarSupportedContent"
        aria-expanded="false"
        aria-label="Toggle navigation"
      >
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">

          <li class="nav-item">
            <a
              class="nav-link active"
              aria-current="page"
              href="{% url 'home' %}"
              >Home</a
            >
          </li>

          <li class="nav-item dropdown">
            <a
              class="nav-link dropdown-toggle"
              href="#"
              role="button"
              data-bs-toggle="dropdown"
              aria-expanded="false"
            >
              Category
            </a>

            <ul class="dropdown-menu">
              {% for  categorie in categories %}
              <li><a class="dropdown-item" href="{% url 'category' categorie %}">{{categorie}}<li>
              {% endfor %}
            </ul>
            
          </li>
         

          <li class="nav-item">
            <a class="nav-link" href="#">About</a>
          </li>

          <li class="nav-item">
            <a class="nav-link" href="#">Contact</a>
          </li>
        </ul>

        <form class="d-flex" role="search" action='/search'>

         <input
            class="form-control me-2"
            type="search"
            placeholder="Search"
            name="search" 
            aria-label="Search"
          />

          <button class="btn btn-outline-dark" type="submit">
            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search text-light" viewBox="0 0 16 16">
              <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
            </svg>
          </button>

        </form>
        <div>

          <ul class="navbar-nav me-auto mb-2 mb-lg-0">
    
            {% if request.user.is_authenticated %}
            
            
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false" >{{request.user.username|capfirst}}</a>
              <ul class="dropdown-menu" aria-labelledby="profileDropdown">
                <li><a class="dropdown-item" href="{% url 'profile' %}">Profile</a></li>
                <li><a class="dropdown-item" href="{% url 'orders' %}">My Orders</a></li>
                <li><a class="dropdown-item" href="{% url 'logout' %}">Logout</a></li>
              </ul>
            </li>
    
            <li class="nav-item mx-2">
              <a href="{% url 'AuthCart' %}" class="nav-link">Cart <sup class="">{% if cartItems >= 1 %}{{cartItems}}{% endif %}</sup></a>
            </li>
    
            <li class="nav-item mx-2">
              <a href="{% url 'Wish' %}" class="nav-link">Wishlist <sup class="">
                {% if wishItems >= 1 %}{{wishItems}}{% endif %}
              </sup></a>
            </li>
    
            {% else %}
            
            <li class="nav-item mx-2">
              <a href="{% url 'SessionCartView' %}" class="nav-link">Cart <sup class="">{% if cartItems >= 1 %}{{cartItems}}{% endif %}</sup></a>
            </li>
    
            <li class="nav-item mx-2">
              <a href="{% url 'login' %}" class="nav-link">Login</a>
            </li>
    
            <li class="nav-item mx-2">
              <a href="{% url 'registration' %}" class="nav-link">Registration</a>
            </li>
    
    
            
            {% endif %}
    
          </ul>
        </div>




        
      </div>

    </div>
  </nav>


  {% endif %}