{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load inventree_extras %}

{% block page_title %}
{% if location %}
{% inventree_title %} | {% trans "Stock Location" %} - {{ location }}
{% else %}
{% inventree_title %} | {% trans "Stock" %}
{% endif %}
{% endblock %}

{% block sidenav %}
<div id='stock-tree'>
    {% trans "Loading..." %}
</div>
{% endblock %}

{% block pre_content %}
{% if item %}
{% include 'stock/loc_link.html' with location=item.location %}
{% else %}
{% include 'stock/loc_link.html' with location=location %}
{% endif %}
{% endblock %}

{% block js_ready %}
{{ block.super }}

    loadTree("{% url 'api-stock-tree' %}",
        "#stock-tree",
        {
            name: 'stock',
        }
    );

    initNavTree({
        label: 'stock',
        treeId: '#sidenav-left',
        toggleId: '#toggle-stock-tree',
    });

{% endblock %}