{% load cart_tag %}
<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <div class="container">
    <a class="navbar-brand" href="{% url 'App_Shop:home' %}"> Django Ecommerce Project</a>

<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
  <ul class="navbar-nav ml-auto">
    {% if request.user.is_authenticated %}
    <li class="nav-item">
 <a class="nav-link" href="{% url 'App_Order:cart' %}">
   <i class="fa fa-shopping-cart" aria-hidden="true"></i> Cart
<span class="badge badge-light"> ({{ request.user | cart_total }})</span>
 </a>

    </li>

  <li class="nav-item dropdown">
 <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
 data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user-circle-o"></i> {{ request.user.profile.username }}  </a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
  <a class="dropdown-item" href="{% url 'App_Login:profile' %}">Profile</a>
  <a class="dropdown-item" href="{% url 'App_Payment:orders' %}">Orders</a>
  <div class="dropdown-divider">  </div>
  <a class="dropdown-item" href="{% url 'App_Login:logout' %}">Logout</a>
</div>
  </li>
{% else %}
 <li class="nav-item">
   <a href="{% url 'App_Login:login' %}" class="btn btn-info btn-sm"> Login</a>
   <a href="{% url 'App_Login:signup' %}" class="btn btn-info btn-sm"> Signup</a>
 </li>
{% endif %}
  </ul>

    </div>
  </div>

</nav>
