{% load static %}{% load multitenancy_tags %}
{% load i18n helpdesk_staff %}
{% load thumbnail %}

{% get_company_details as details %}

<!-- Main Sidebar Container -->
<aside class="main-sidebar elevation-4 sidebar-light-navy">
    <!-- Brand Logo -->
    <a href="{% url "admin_dashboard" %}" class="brand-link navbar-white">
        <img src="{{details.logo.logo.url}}" alt="{{details.info.company_name}} Logo"
            class="brand-image img-circle elevation-3" style="opacity: .8">
        <span class="brand-text font-weight-light">{{details.info.company_name}}</span>
    </a>

    <!-- Sidebar -->
    <div
        class="sidebar os-host os-theme-light os-host-resize-disabled os-host-transition os-host-scrollbar-horizontal-hidden os-host-scrollbar-vertical-hidden">
        <!-- Sidebar user panel (optional) -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">

                <img src="{% avatar_url user %}" alt="" class="img-circle elevation-2">
                {% comment %} <img src="{{ avatar.user}}" class="img-circle elevation-2" alt="User Image">
                {% endcomment %}
                {% comment %}
                <img src="{% static "admin/img/avatar.jpg" %}" class="img-circle elevation-2" alt="User Image">
                {% endcomment %}
            </div>
            <div class="info">
                <a href="{#% url 'profiles_detail' username=user.username %#}" class="d-block">Hi,
                    {{user}}!</a>
            </div>
        </div>

        <!-- Sidebar Menu -->
        <nav class="mt-2">
            {% with request.resolver_match.url_name as url_name %}
            <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
                <li class="nav-item">
                    <a href="{% url "customer_dashboard" %}"
                        class="nav-link {% if url_name == "customer_dashboard" %}active{% endif %}">
                        <i class="nav-icon fas fa-tachometer-alt"></i>
                        <p>
                            Home

                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="{% url "subscriptions" %}"
                        class="nav-link {% if url_name == 'subscriptions' or url_name == 'create_service' %}active{% endif %}">
                        <i class="nav-icon fas fa-database"></i>
                        <p>
                            Subscriptions

                        </p>
                    </a>
                </li>
                
                {% comment "" %}
                support
                {% endcomment %}
                <li class="nav-item has-treeview ">
                    <a href="#"
                        class="nav-link {% if url_name == 'home' or url_name == 'list' or url_name == 'submit' or url_name == 'report_index' or url_name == 'kb_index'%}active{% endif %}">
                        <i class="nav-icon fas fa-headset"></i>
                        <p>
                            Helpdesk
                            <i class="fas fa-angle-left right"></i>
                        </p>
                    </a>
                    <ul class="nav nav-treeview">
                        <li class="nav-item">
                            <a href="{% url "helpdesk:home" %}"
                                class="nav-link {% if url_name == 'home'  %}active{% endif %}">
                                <i class="nav-icon fa-regular fa-envelope-open"></i>
                                <p>
                                    Support Home
                                </p>
                            </a>
                        </li>
                        
                      
                        <li class="nav-item">
                            <a class="nav-link {% if url_name ==  'submit' %} active{% endif %}"
                                href="{% url 'helpdesk:submit' %}">
                                <i class="fas fa-fw fa-plus-circle"></i>
                                <span>{% trans "New Ticket" %}</span>
                            </a>
                        </li>
                        
                        {% if helpdesk_settings.HELPDESK_KB_ENABLED %}
                        <li class="nav-item">
                            <a class="nav-link {% if url_name == 'kb_index'  %} active{% endif %}"
                                href="{% url 'helpdesk:kb_index' %}">
                                <i class="fas fa-fw fa-database"></i>
                                <span>{% trans "Knowledgebase" %}</span>
                            </a>
                        </li>
                        {% endif %}
                    </ul>
                </li>
        

            </ul>
            {% endwith %}
            </li>

            </li>


        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside>