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:
@ -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>
|
||||
|
@ -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 %}
|
Reference in New Issue
Block a user