2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 13:35:40 +00:00

Use the collapse template for the stock location list view

This commit is contained in:
Oliver Walters
2019-05-02 19:02:03 +10:00
parent fbb120da53
commit 4d7ac870e0
4 changed files with 41 additions and 57 deletions

View File

@ -33,9 +33,9 @@
</div>
</div>
{% if category %}
{% include "part/subcategories.html" with children=category.children.all %}
{% else %}
{% if category and category.children.all|length > 0 %}
{% include "part/subcategories.html" with children=category.children.all collapse_id="children"%}
{% elif children|length > 0 %}
{% include "part/subcategories.html" with children=children %}
{% endif %}
<hr>

View File

@ -1,27 +1,19 @@
{% if children|length > 0 %}
<hr>
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#collapse1">{{ children | length }} Child Categories</a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">
<ul class="list-group">
{% for child in children %}
<li class="list-group-item">
<b><a href="{% url 'category-detail' child.id %}">{{ child.name }}</a></b>
{% if child.description %}
<i> - {{ child.description }}</i>
{% endif %}
<span class='badge'>{{ child.partcount }}</span>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endif %}
{% extends "collapse.html" %}
{% block collapse_title %}
{{ children | length }} Child Categories
{% endblock %}
{% block collapse_content %}
<ul class="list-group">
{% for child in children %}
<li class="list-group-item">
<b><a href="{% url 'category-detail' child.id %}">{{ child.name }}</a></b>
{% if child.description %}
<i> - {{ child.description }}</i>
{% endif %}
<span class='badge'>{{ child.partcount }}</span>
</li>
{% endfor %}
</ul>
{% endblock %}