{% extends "collapse.html" %}

{% if roles.stock.view %}
{% block collapse_title %}
Sub-Locations<span class='badge'>{{ children|length }}</span>
{% endblock %}

{% block collapse_content %}
<ul class="list-group">
{% for child in children %}
<li class="list-group-item"><a href="{% url 'stock-location-detail' child.id %}">{{ child.name }}</a> - <i>{{ child.description }}</i>
    {% if child.item_count > 0 %}
    <span class='badge'>{{ child.item_count }} Item{% if child.item_count > 1 %}s{% endif %}</span>
    {% endif %}
</li>
{% endfor %}
</ul>
{% endblock %}
{% endif %}