mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 07:31:10 +00:00
Begin to add views for part models
- List BOM items - Show category listing as linked items - Fix some pathing issues with InvenTreeTree class
This commit is contained in:
7
InvenTree/part/templates/cat_link.html
Normal file
7
InvenTree/part/templates/cat_link.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div id="category-path" background="#99F">
|
||||
<a href="/part/list/">All</a> >
|
||||
{% for path_item in category.parentpath %}
|
||||
<a href="/part/list/?category={{ path_item.id }}">{{ path_item.name }}</a> >
|
||||
{% endfor %}
|
||||
<a href="/part/list/?category={{ category.id }}">{{ category.name }}</a>
|
||||
</div>
|
30
InvenTree/part/templates/detail.html
Normal file
30
InvenTree/part/templates/detail.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<h1>Part details for {{ part.name }}</h1>
|
||||
|
||||
{% include "cat_link.html" with category=part.category %}
|
||||
|
||||
<br>
|
||||
Part name: {{ part.name }}
|
||||
<br>
|
||||
Description: {{ part.description }}
|
||||
<br>
|
||||
IPN: {% if part.IPN %}{{ part.IPN }}{% else %}N/A{% endif %}
|
||||
<br>
|
||||
Stock: {{ part.stock }}
|
||||
|
||||
<br><br>
|
||||
BOM items: {{ part.bomItemCount }}<br>
|
||||
Used in {{ part.usedInCount }} other parts.<br>
|
||||
|
||||
<h2>BOM</h2>
|
||||
<ul>
|
||||
{% for bom in part.bom_items.all %}
|
||||
<li><a href="{% url 'detail' bom.sub_part.id %}">{{ bom.sub_part.name }}</a> ({{ bom.quantity }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h2>Used to make</h2>
|
||||
<ul>
|
||||
{% for p in part.used_in.all %}
|
||||
<li><a href="{% url 'detail' p.part.id %}">{{ p.part.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
27
InvenTree/part/templates/index.html
Normal file
27
InvenTree/part/templates/index.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1>Parts page!</h1>
|
||||
|
||||
{% if category %}
|
||||
{% include "cat_link.html" with category=category %}
|
||||
<h3>Child categories</h3>
|
||||
<ul>
|
||||
{% for child in category.children.all %}
|
||||
<li><a href="/part/list?category={{ child.id }}">{{ child.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
No category!
|
||||
{% endif %}
|
||||
|
||||
<b>Here is a list of all the parts:</b>
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
{% for part in parts %}
|
||||
<tr>
|
||||
<td><a href="{% url 'detail' part.id %}">{{ part.name }}</a></td>
|
||||
<td>{{ part.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user