{% load i18n %}
{% load static %}
{% load inventree_extras %}

<ul class='list-group'>
    <li class='list-group-item'>
        <a href='#' id='part-menu-toggle'>
            <span class='menu-tab-icon fas fa-expand-arrows-alt'></span>
        </a>
    </li>
    <li class='list-group-item {% if tab == "details" %}active{% endif %}' title='{% trans "Part Details" %}'>
        <a href='{% url "part-detail" part.id %}'>
            <span class='menu-tab-icon fas fa-info-circle'></span>
            <span class='tab-text'>
                {% trans "Details" %}
            </span>
        </a>
    </li>
    <li class='list-group-item {% if tab == "params" %}active{% endif %}' title='{% trans "Part Parameters" %}'>
        <a href='{% url "part-params" part.id %}'>    
            <span class='menu-tab-icon fas fa-tasks'></span>
            {% trans "Parameters" %}
        </a>
    </li>
    {% if part.is_template %}
    <li class='list-group-item {% if tab == "variants" %}active{% endif %}' title='{% trans "Part Variants" %}'>
        <a href='{% url "part-variants" part.id %}'>
            <span class='menu-tab-icon fas fa-shapes'></span>
            {% trans "Variants" %}
        </a>
    </li>
    {% endif %}
    <li class='list-group-item {% if tab == "stock" %}active{% endif %}' title='{% trans "Stock Items" %}'>
        <a href='{% url "part-stock" part.id %}'>
            <span class='menu-tab-icon fas fa-boxes'></span>
            {% trans "Stock" %}
        </a>
    </li>
    {% if part.component or part.salable %}
    <li class='list-group-item {% if tab == "allocation" %}active{% endif %}' title='{% trans "Allocated Stock" %}'>
        <a href='{% url "part-allocation" part.id %}'>
            <span class='menu-tab-icon fas fa-sign-out-alt'></span>
            {% trans "Allocations" %}
        </a>
    </li>
    {% endif %}
    {% if part.assembly %}
    <li class='list-group-item {% if tab == "bom" %}active{% endif %}' title='{% trans "Bill of Materials" %}'>
        <a href='{% url "part-bom" part.id %}'>
            <span class='menu-tab-icon fas fa-list'></span>
            {% trans "Bill of Materials" %}
        </a>
    </li>
    {% if roles.build.view %}
    <li class='list-group-item {% if tab == "build" %}active{% endif %}' title='{% trans "Build Orders" %}'>
        <a href='{% url "part-build" part.id %}'>
            <span class='menu-tab-icon fas fa-tools'></span>
            {% trans "Build Orders" %}
        </a>
    </li>
    {% endif %}
    {% endif %}
    {% if part.component %}
    <li class='list-group-item {% if tab == "used" %}active{% endif %}' title='{% trans "Used In" %}'>
        <a href='{% url "part-used-in" part.id %}'>
            <span class='menu-tab-icon fas fa-layer-group'></span>
            {% trans "Used In" %}
        </a>
    </li>
    {% endif %}
    {% if part.purchaseable and roles.purchase_order.view %}
    <li class='list-group-item {% if tab == "manufacturers" %}active{% endif %}' title='{% trans "Manufacturers" %}'>
        <a href='{% url "part-manufacturers" part.id %}'>
            <span class='menu-tab-icon fas fa-industry'></span>
            {% trans "Manufacturers" %}
        </a>
    </li>
    <li class='list-group-item {% if tab == "suppliers" %}active{% endif %}' title='{% trans "Suppliers" %}'>
        <a href='{% url "part-suppliers" part.id %}'>
            <span class='menu-tab-icon fas fa-building'></span>
            {% trans "Suppliers" %}
        </a>
    </li>
    <li class='list-group-item {% if tab == "orders" %}active{% endif %}' title='{% trans "Purchase Orders" %}'>
        <a href='{% url "part-orders" part.id %}'>
            <span class='menu-tab-icon fas fa-shopping-cart'></span>
            {% trans "Purchase Orders" %}
        </a>
    </li>
    {% endif %}
    {% if part.salable and roles.sales_order.view %}
    <li class='list-group-item {% if tab == "sales-prices" %}active{% endif %}' title='{% trans "Sales Price Information" %}'>
        <a href='{% url "part-sale-prices" part.id %}'>
            <span class='menu-tab-icon fas fa-dollar-sign' style='width: 20px;'></span>
            {% trans "Sale Price" %}
        </a>
    </li>
    <li class='list-group-item {% if tab == "sales-orders" %}active{% endif %}' title='{% trans "Sales Orders" %}'>
        <a href='{% url "part-sales-orders" part.id %}'>
            <span class='menu-tab-icon fas fa-truck'></span>
            {% trans "Sales Orders" %}
        </a>
    </li>
    {% endif %}
    {% if part.trackable %}
    <li class='list-group-item {% if tab == "tests" %}active{% endif %}' title='{% trans "Part Test Templates" %}'>
        <a href='{% url "part-test-templates" part.id %}'>
            <span class='menu-tab-icon fas fa-vial'></span>
            {% trans "Tests" %}
        </a>
    </li>
    {% endif %}
    <li class='list-group-item {% if tab == "related" %}active{% endif %}' title='{% trans "Related Parts" %}'>
        <a href='{% url "part-related" part.id %}'>
            <span class='menu-tab-icon fas fa-random'></span>
            {% trans "Related Parts" %}
        </a>
    </li>
    <li class='list-group-item {% if tab == "attachments" %}active{% endif %}' title='{% trans "Attachments" %}'>
        <a href='{% url "part-attachments" part.id %}'>
            <span class='menu-tab-icon fas fa-paperclip'></span>
            {% trans "Attachments" %}
        </a>
    </li>
    <li class='list-group-item {% if tab == "notes" %}active{% endif %}' title='{% trans "Part Notes" %}'>
        <a href='{% url "part-notes" part.id %}'>
            <span class='menu-tab-icon fas fa-clipboard'></span>
            {% trans "Notes" %}
        </a>
    </li>
</ul>
