{% with request_path=request.path|slice:'/' %}
  

<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <a id="home_id" class="navbar-brand" href="/"><img height="25px" class="center" src="https://aduanasoft.com/wp-content/uploads/2019/01/aslogo-1.png" id="icon" alt="User Icon" /></a>
    
    <div class="collapse navbar-collapse" id="navbarTogglerDemo03">
      <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
        
        <li class="nav-item dropdown {% if request_path == '/' %}active{% endif %}">
          <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              Timbres/Clientes
          </a>
          <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="/">Timbres x Cliente</a>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="{% url 'add_cliente' %}">Agregar Cliente</a>
              
              <a class="dropdown-item" href="#">---</a>
          </div>
        </li>
{% comment %}
        <li class="nav-item">
          <a class="nav-link" href="#">Contacts</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">List</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">#</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">List</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">List</a>
        </li>
        <li class="nav-item">
          <a class="nav-link disabled" href="#">Disabled</a>
        </li>

{% endcomment %}
          
          <li class="nav-item {% if 'sistemas' in request_path %}active border{% endif %}">
            <a class="nav-link" href="/sistemas" >Sistemas CFDI</a>
          </li> 
          <li class="nav-item {% if 'IMMEX' in request_path %}active border{% endif %}">
            <a class="nav-link" href="{% url 'sistemasXcli_IMMEX' %}" >Sistemas IMMEX</a>
          </li> 
          
        {% if request.user.is_superuser %}
          <li class="nav-item">
            <a class="nav-link" href="/admin" target="_blank">Admin site</a>
          </li>  
        {% endif %}              
      </ul>
      {% include "partials/search_form.html" %} 
      
      <li class="navbar-text mr-2 nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          {{request.user|capfirst}}
        </a>
        <div class="dropdown-menu dropleft" aria-labelledby="navbarDropdown">          
          <form method="post" action="{% url 'account_logout' %}">
            {% csrf_token %}
            
            <button type="submit" class="dropdown-item">Cerrar sesión</button>
          </form>
          <div class="dropdown-divider"></div>
          
          {% if request.user.is_superuser %}
            <a class="dropdown-item" href="{% url 'ErroresTimbresList' %}">Lista Errores Timbres</a>
            
            <a class="dropdown-item" href="{% url 'lista_sistmas_bitacora' %}">Lista Errores Bitacora</a>
            <div class="dropdown-divider"></div>
          {% endif %}                      
            
            <a class="dropdown-item" href="{% url 'uploadZipViewHTML' %}">Actualizar CFDI Version</a>
        </div>
      </li>        
    </div>
  </nav>
{% endwith%}