{% load i18n static admin_datta %}

<nav class="pcoded-navbar">
  <div class="navbar-wrapper">
    <div class="navbar-brand header-logo">
      <a href="{% url 'index' %}" class="b-brand">
        <div class="b-bg">
          <i class="feather icon-trending-up"></i>
        </div>
        <span class="b-title">Datta Able</span>
      </a>
      <a class="mobile-menu" id="mobile-collapse" href="javascript:"><span></span></a>
    </div>
    <div class="navbar-content scroll-div">
      <ul class="nav pcoded-inner-navbar">
        <li class="nav-item pcoded-menu-caption">
          <label>Navigation</label>
        </li>
        <li data-username="dashboard Default Ecommerce CRM Analytics Crypto Project" class="nav-item {% if 'index' in segment %}active{% endif %}">
          {% if request.user.is_superuser %}
          <a href="{% url 'admin:index' %}" class="nav-link ">
          {% else %}
          <a href="{% url 'index' %}" class="nav-link ">
          {% endif %}
            <span class="pcoded-micon"><i class="feather icon-home"></i></span><span class="pcoded-mtext">Dashboard</span>
          </a>
        </li>

        {% if not request.user.is_authenticated %}
        <li
          data-username="Authentication Sign up Sign in reset password Change password Personal information profile settings map form subscribe"
          class="nav-item pcoded-hasmenu">
          <a href="javascript:" class="nav-link "><span class="pcoded-micon"><i
                class="feather icon-lock"></i></span><span class="pcoded-mtext">Authentication</span></a>
          <ul class="pcoded-submenu">
            <li class=""><a href="{% url 'login' %}" class="">Sign IN</a></li>
            <li class=""><a href="{% url 'register' %}" class="">Sign UP</a></li>
          </ul>
        </li>
        {% endif %}

        {% admin_get_menu as app_list %}
        {% if app_list %}
          {% for app in app_list %}
            {% if app.has_perms and not app.pinned %}
              <li 
                data-username="basic components Button Alert Badges breadcrumb Paggination progress Tooltip popovers Carousel Cards Collapse Tabs pills Modal Grid System Typography Extra Shadows Embeds"
                class="nav-item pcoded-hasmenu"
              >
                <a href="javascript:" class="nav-link ">
                  <span class="pcoded-micon"><i class=" {% if app.icon %}{{ app.icon }} {% else %} feather icon-box {% endif %}"></i></span>
                  <span class="pcoded-mtext">{{ app.label|slice:10 }}{% if app.label|length > 10 %}..{% endif %}</span>
                </a>
                {% if app.models %}
                  <ul class="pcoded-submenu">
                    {% for model in app.models %}
                      {% if model.url %}
                        <li class="nav-item {% if 'bootstrap-tables' in segment or model.url in request.path|urlencode %} active {% endif %}">
                          <a class="nav-link" href="{{ model.url }}">{{ model.label }}</a>
                        </li>
                      {% else %}
                        <li class="nav-item">{{ model.label }}</li>
                      {% endif %}
                    {% endfor %}
                  </ul>
                {% endif %}
              </li>
            {% endif %}
          {% endfor %}
        {% endif %}

        {% if request.user.is_authenticated and not request.user.is_superuser %}
        <li class="nav-item pcoded-menu-caption">
          <label>UI Element</label>
        </li>
        <li
          data-username="basic components Button Alert Badges breadcrumb Paggination progress Tooltip popovers Carousel Cards Collapse Tabs pills Modal Grid System Typography Extra Shadows Embeds"
          class="nav-item pcoded-hasmenu {% if 'basic_components' in parent %}active pcoded-trigger{% endif %}">
          <a href="javascript:" class="nav-link "><span class="pcoded-micon"><i
                class="feather icon-box"></i></span><span class="pcoded-mtext">Components</span></a>
          <ul class="pcoded-submenu">
            <li class="{% if 'button' in segment %}active{% endif %}"><a href="{% url 'bc_button' %}" class="">Button</a></li>
            <li class="{% if 'badges' in segment %}active{% endif %}"><a href="{% url 'bc_badges' %}" class="">Badges</a></li>
            <li class="{% if 'breadcrumbs_&_pagination' in segment %}active{% endif %}"><a href="{% url 'bc_breadcrumb_pagination' %}" class="">Breadcrumb & paggination</a></li>
            <li class="{% if 'collapse' in segment %}active{% endif %}"><a href="{% url 'bc_collapse' %}" class="">Collapse</a></li>
            <li class="{% if 'navs_&_tabs' in segment %}active{% endif %}"><a href="{% url 'bc_tabs' %}" class="">Tabs & pills</a></li>
            <li class="{% if 'typography' in segment %}active{% endif %}"><a href="{% url 'bc_typography' %}" class="">Typography</a></li>


            <li class="{% if 'feather_icon' in segment %}active{% endif %}"><a href="{% url 'icon_feather' %}" class="">Feather<span
                  class="pcoded-badge label label-danger">NEW</span></a></li>
          </ul>
        </li>
        <li class="nav-item pcoded-menu-caption">
          <label>Forms & table</label>
        </li>
        <li data-username="form elements advance componant validation masking wizard picker select" class="nav-item {% if 'form_elements' in segment %}active{% endif %}">
          <a href="{% url 'form_elements' %}" class="nav-link "><span class="pcoded-micon"><i
                class="feather icon-file-text"></i></span><span class="pcoded-mtext">Form elements</span></a>
        </li>
        <li data-username="Table bootstrap datatable footable" class="nav-item {% if 'basic_tables' in segment %}active{% endif %}">
          <a href="{% url 'basic_tables' %}" class="nav-link "><span class="pcoded-micon"><i
                class="feather icon-server"></i></span><span class="pcoded-mtext">Table</span></a>
        </li>
        <li class="nav-item pcoded-menu-caption">
          <label>Chart & Maps</label>
        </li>
        <li data-username="Charts Morris" class="nav-item {% if 'morris_chart' in segment %}active{% endif %}"><a href="{% url 'morris_chart' %}" class="nav-link "><span
              class="pcoded-micon"><i class="feather icon-pie-chart"></i></span><span
              class="pcoded-mtext">Chart</span></a>
        </li>
        <li data-username="Maps Google" class="nav-item {% if 'google_maps' in segment %}active{% endif %}"><a href="{% url 'google_maps' %}" class="nav-link "><span
              class="pcoded-micon"><i class="feather icon-map"></i></span><span class="pcoded-mtext">Maps</span></a>
        </li>
        <li class="nav-item pcoded-menu-caption">
          <label>Pages</label>
        </li>
        <li
          data-username="Authentication Sign up Sign in reset password Change password Personal information profile settings map form subscribe"
          class="nav-item pcoded-hasmenu">
          <a href="javascript:" class="nav-link "><span class="pcoded-micon"><i
                class="feather icon-lock"></i></span><span class="pcoded-mtext">Authentication</span></a>
          <ul class="pcoded-submenu">
            <li class=""><a href="{% url 'register' %}" class="" target="_blank">Sign up</a></li>
            <li class=""><a href="{% url 'login' %}" class="" target="_blank">Sign in</a></li>
          </ul>
        </li>
        <li data-username="Profile Page" class="nav-item {% if 'profile' in segment %}active{% endif %}"><a href="{% url 'profile' %}" class="nav-link"><span
              class="pcoded-micon"><i class="feather icon-user"></i></span><span class="pcoded-mtext">Profile
              Page</span></a>
        </li>
        <li data-username="Sample Page" class="nav-item {% if 'sample_page' in segment %}active{% endif %}"><a href="{% url 'sample_page' %}" class="nav-link"><span
              class="pcoded-micon"><i class="feather icon-sidebar"></i></span><span class="pcoded-mtext">Sample
              page</span></a>
        </li>
        <li data-username="Disabled Menu" class="nav-item disabled"><a href="javascript:" class="nav-link"><span
              class="pcoded-micon"><i class="feather icon-power"></i></span><span class="pcoded-mtext">Disabled
              menu</span></a>
        </li>
        {% endif %}
      </ul>
    </div>
  </div>
</nav>