Added some missing data on supplier pages

This commit is contained in:
Oliver 2018-04-16 01:14:19 +10:00
parent a91ff58d84
commit a80cf0aace
3 changed files with 20 additions and 11 deletions

View File

@ -8,12 +8,17 @@
<tr>
<th>SKU</th>
<th>Supplier</th>
<th>MPN</th>
<th>URL</th>
</tr>
{% for spart in part.supplier_parts.all %}
<tr>
<td><a href="{% url 'supplier-part-detail' spart.id %}">{{ spart.SKU }}</a></td>
<td><a href="{% url 'supplier-detail' spart.supplier.id %}">{{ spart.supplier.name }}</a></td>
<td>
{% if spart.manufacturer %}{{ spart.manufacturer.name }}{% endif %}
{% if spart.MPN %} | {{ spart.MPN }}{% endif %}
</td>
<td>
{% if spart.URL %}
<a href="{{ spart.URL }}">{{ spart.URL }}</a>

View File

@ -6,12 +6,7 @@
<div class="col-sm-6">
<h3>{{ supplier.name }}</h3>
<p>{{ supplier.description }}</p>
<a href="{% url 'supplier-edit' supplier.id %}">
<button class="btn btn-info">Edit supplier details</button>
</a>
<a href="{% url 'supplier-delete' supplier.id %}">
<button class="btn btn-danger">Delete supplier</button>
</a>
<p>{{ supplier.notes }}</p>
</div>
<div class="col-sm-6">
<table class="table">
@ -48,21 +43,24 @@
<table class="table table-striped">
<tr>
<th>SKU</th>
<th>Description</th>
<th>Part</th>
<th>Manufacturer</th>
<th>MPN</th>
<th>URL</th>
</tr>
{% for part in supplier.parts.all %}
<tr>
<td><a href="{% url 'supplier-part-detail' part.id %}">{{ part.SKU }}</a></td>
<td>{{ part.description }}</td>
<td>
{% if part.part %}
<a href="{% url 'part-detail' part.part.id %}">{{ part.part.name }}</a>
{% endif %}
</td>
<td>Manufacturer name goes here</td>
<td>MPN goes here</td>
<td>
{% if part.manufacturer %}{{ part.manufacturer.name }}{% endif %}
{% if part.MPN %} | {{ part.MPN }}{% endif %}
</td>
<td>{{ part.URL }}</td>
{% endfor %}
</table>
@ -71,6 +69,12 @@
<a href="{% url 'supplier-part-create' %}?supplier={{ supplier.id }}">
<button class="btn btn-success">New Supplier Part</button>
</a>
<a href="{% url 'supplier-edit' supplier.id %}">
<button class="btn btn-info">Edit supplier details</button>
</a>
<a href="{% url 'supplier-delete' supplier.id %}">
<button class="btn btn-danger">Delete supplier</button>
</a>
</div>
{% endblock %}

View File

@ -22,8 +22,8 @@
<tr><td>Description</td><td>{{ part.description }}</td></tr>
{% endif %}
{% if part.manufacturer %}
<tr><td>Manufacturer</td><td>TODO</td></tr>
<tr><td>MPN</td><td>TODO</td></tr>
<tr><td>Manufacturer</td><td>{% if part.manufacturer %}{{ part.manufacturer.name }}{% endif %}</td></tr>
<tr><td>MPN</td><td>{{ part.MPN }}</td></tr>
{% endif %}
</table>