{% load i18n %}

<ul class='nav nav-tabs'>
    <li{% if tab == 'details' %} class='active'{% endif %}>
        <a href="{% url 'company-detail' company.id %}">{% trans "Details" %}</a>
    </li>
    {% if company.is_supplier or company.is_manufacturer %}
    <li{% if tab == 'parts' %} class='active'{% endif %}>
        <a href="{% url 'company-detail-parts' company.id %}">{% trans "Parts" %} <span class='badge'>{{ company.part_count }}</span></a>
    </li>
    <li{% if tab == 'stock' %} class='active'{% endif %}>
        <a href="{% url 'company-detail-stock' company.id %}">{% trans "Stock" %} <span class='badge'>{{ company.stock_count }}</a>
    </li>
    {% endif %}
    {% if company.is_supplier %}
    <li{% if tab == 'po' %} class='active'{% endif %}>
        <a href="{% url 'company-detail-purchase-orders' company.id %}">{% trans "Purchase Orders" %} <span class='badge'>{{ company.purchase_orders.count }}</span></a>
    </li>
    {% endif %}
    {% if company.is_customer %}
    <li{% if tab == 'co' %} class='active'{% endif %}>
        <a href="{% url 'company-detail-sales-orders' company.id %}">{% trans "Sales Orders" %} <span class='badge'>{{ company.sales_orders.count }}</span></a>
    </li>
    <li{% if tab == 'assigned' %} class='active'{% endif %}>
        <a href="{% url 'company-detail-assigned-stock' company.id %}">{% trans "Assigned Stock" %}
            <span class='badge'>
            {{ company.assigned_stock.count }}
            </span>
        </a>
    </li>
    {% endif %}
    <li{% if tab == 'notes' %} class='active'{% endif %}>
        <a href="{% url 'company-notes' company.id %}">{% trans "Notes" %}{% if company.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
    </li>
</ul>
