{% extends "collapse.html" %}
{% load i18n %}

{% if roles.stock_location.view or roles.stock.view %}
{% block collapse_title %}
{% trans '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> -->
    <span class='badge'>
    {% comment %}Translators: pluralize with counter{% endcomment %}
    {% blocktrans count counter=child.item_count %}{{ counter }} Item{% plural %}{{ counter }} Items{% endblocktrans %}
    </span>
    {% endif %}
</li>
{% endfor %}
</ul>
{% endblock %}
{% endif %}