2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-07 12:22:11 +00:00

Add 'to_order' and 'to_build' collapsible panels

This commit is contained in:
Oliver Walters
2019-05-02 20:18:34 +10:00
parent 4d7ac870e0
commit 38100520df
8 changed files with 90 additions and 6 deletions

View File

@@ -3,9 +3,20 @@
{% block content %}
<h3>InvenTree</h3>
<p>Index!</p>
{% if to_order %}
{% include "InvenTree/parts_to_order.html" with collapse_id="order" %}
{% endif %}
{% if to_build %}
{% include "InvenTree/parts_to_build.html" with collapse_id="build" %}
{% endif %}
{% endblock %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% block js_ready %}
{{ block.super }}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "collapse.html" %}
{% block collapse_title %}
Parts to Build<span class='badge'>{{ to_build | length }}</span>
{% endblock %}
{% block collapse_heading %}
There are {{ to_build | length }} parts which need building.
{% endblock %}
{% block collapse_content %}
{% include "required_part_table.html" with parts=to_build table_id="to-build-table" %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "collapse.html" %}
{% block collapse_title %}
Parts to Order<span class='badge'>{{ to_order | length }}</span>
{% endblock %}
{% block collapse_heading %}
There are {{ to_order | length }} parts which need to be ordered.
{% endblock %}
{% block collapse_content %}
{% include "required_part_table.html" with parts=to_order table_id="to-order-table" %}
{% endblock %}

View File

@@ -1,3 +1,5 @@
{% block collapse_preamble %}
{% endblock %}
<div class='panel-group'>
<div class='panel panel-default'>
<div class='panel panel-heading'>

View File

@@ -0,0 +1,18 @@
<table class='table table-striped table-condensed' id='{{ table_id }}'>
<tr>
<th>Part</th>
<th>Description</th>
<th>In Stock</th>
<th>Allocated</th>
<th>Net Stock</th>
</tr>
{% for part in parts %}
<tr>
<td><a href="{% url 'part-detail' part.id %}">{{ part.name }}</a></td>
<td>{{ part.description }}</td>
<td>{{ part.total_stock }}</td>
<td>{{ part.allocation_count }}</td>
<td>{{ part.available_stock }}</td>
</tr>
{% endfor %}
</table>