Refactor supplier part display

This commit is contained in:
Oliver 2021-11-30 20:53:01 +11:00
parent 1ce1710c50
commit e88ea8d157

View File

@ -5,11 +5,11 @@
{% block page_title %}
{% inventree_title %} | {% trans "Supplier Part" %}
{% endblock %}
{% endblock page_title %}
{% block sidebar %}
{% include "company/supplier_part_sidebar.html" %}
{% endblock %}
{% endblock sidebar %}
{% block breadcrumbs %}
<li class='breadcrumb-item'><a href='{% url "supplier-index" %}'>{% trans "Suppliers" %}</a></li>
@ -17,13 +17,13 @@
<li class='breadcrumb-item'><a href='{% url "company-detail" part.supplier.id %}'>{{ part.supplier.name }}</a></li>
{% endif %}
<li class="breadcrumb-item active" aria-current="page"><a href='{% url "supplier-part-detail" part.id %}'>{{ part.SKU }}</a></li>
{% endblock %}
{% endblock breadcrumbs %}
{% block heading %}
<h4>
{% trans "Supplier Part" %}: {{ part.SKU }}
</h4>
{% endblock %}
{% endblock heading %}
{% block actions %}
{% if user.is_staff and perms.company.change_company %}
@ -43,7 +43,7 @@
<span class='fas fa-trash-alt icon-red'/>
</button>
{% endif %}
{% endblock %}
{% endblock actions %}
{% block thumbnail %}
<img class='part-thumb'
@ -56,39 +56,32 @@ src="{% static 'img/blank_image.png' %}"
{% block details %}
<p>
{{ part.part.full_name }}
</p>
<table class='table table-striped table-condensed'>
<col width='25'>
<tr>
<td><span class='fas fa-shapes'></span></td>
<td>{% trans "Internal Part" %}</td>
<td>
{% if part.part %}
<a href="{% url 'part-detail' part.part.id %}?display=part-suppliers">{{ part.part.full_name }}</a>{% include "clip.html"%}
{% endif %}
</td>
</tr>
{% if part.description %}
<tr>
<td></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
</tr>
{% endif %}
</table>
{% endblock %}
{% endblock details %}
{% block details_right %}
<table class="table table-striped table-condensed">
<col width='25'>
<tr>
<td><span class='fas fa-shapes'></span></td>
<td>{% trans "Internal Part" %}</td>
<td>
{% if part.part %}
<a href="{% url 'part-detail' part.part.id %}?display=part-suppliers">{{ part.part.full_name }}</a>{% include "clip.html"%}
{% endif %}
</td>
</tr>
{% if part.description %}
<tr>
<td></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.link %}
<tr>
<td><span class='fas fa-link'></span></td>
<td>{% trans "External Link" %}</td>
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-building'></span></td>
<td>{% trans "Supplier" %}</td>
@ -127,6 +120,13 @@ src="{% static 'img/blank_image.png' %}"
<td>{{ part.note }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.link %}
<tr>
<td><span class='fas fa-link'></span></td>
<td>{% trans "External Link" %}</td>
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
</tr>
{% endif %}
</table>
{% endblock %}