2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Refactor manufacturer part display

This commit is contained in:
Oliver 2021-11-30 20:49:52 +11:00
parent defe80e2af
commit 1ce1710c50

View File

@ -8,7 +8,7 @@ InvenTree | {% trans "Manufacturer Part" %}
{% block sidebar %} {% block sidebar %}
{% include "company/manufacturer_part_sidebar.html" %} {% include "company/manufacturer_part_sidebar.html" %}
{% endblock %} {% endblock sidebar %}
{% block breadcrumbs %} {% block breadcrumbs %}
<li class='breadcrumb-item'><a href='{% url "manufacturer-index" %}'>{% trans "Manufacturers" %}</a></li> <li class='breadcrumb-item'><a href='{% url "manufacturer-index" %}'>{% trans "Manufacturers" %}</a></li>
@ -16,13 +16,13 @@ InvenTree | {% trans "Manufacturer Part" %}
<li class='breadcrumb-item'><a href='{% url "company-detail" part.manufacturer.id %}'>{{ part.manufacturer.name }}</a></li> <li class='breadcrumb-item'><a href='{% url "company-detail" part.manufacturer.id %}'>{{ part.manufacturer.name }}</a></li>
{% endif %} {% endif %}
<li class="breadcrumb-item active" aria-current="page"><a href='{% url "manufacturer-part-detail" part.id %}'>{{ part.MPN }}</a></li> <li class="breadcrumb-item active" aria-current="page"><a href='{% url "manufacturer-part-detail" part.id %}'>{{ part.MPN }}</a></li>
{% endblock %} {% endblock breadcrumbs %}
{% block heading %} {% block heading %}
<h4> <h4>
{% trans "Manufacturer Part" %}: {{ part.part.full_name }} {% trans "Manufacturer Part" %}: {{ part.part.full_name }}
</h4> </h4>
{% endblock %} {% endblock heading %}
{% block actions %} {% block actions %}
{% if user.is_staff and perms.company.change_company %} {% if user.is_staff and perms.company.change_company %}
@ -46,7 +46,7 @@ InvenTree | {% trans "Manufacturer Part" %}
</button> </button>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endblock %} {% endblock actions %}
{% block thumbnail %} {% block thumbnail %}
<img class='part-thumb' <img class='part-thumb'
@ -55,15 +55,11 @@ src='{{ part.part.image.url }}'
{% else %} {% else %}
src="{% static 'img/blank_image.png' %}" src="{% static 'img/blank_image.png' %}"
{% endif %}/> {% endif %}/>
{% endblock %} {% endblock thumbnail %}
{% block details %} {% block details %}
{% endblock %} <table class='table table-striped table-condensed'>
{% block details_right %}
<table class="table table-striped table-condensed">
<col width='25'> <col width='25'>
<tr> <tr>
<td><span class='fas fa-shapes'></span></td> <td><span class='fas fa-shapes'></span></td>
@ -81,6 +77,25 @@ src="{% static 'img/blank_image.png' %}"
<td>{{ part.description }}{% include "clip.html"%}</td> <td>{{ part.description }}{% include "clip.html"%}</td>
</tr> </tr>
{% endif %} {% endif %}
</table>
{% endblock details %}
{% block details_right %}
<table class="table table-striped table-condensed">
<col width='25'>
<tr>
<td><span class='fas fa-industry'></span></td>
<td>{% trans "Manufacturer" %}</td>
<td><a href="{% url 'company-detail' part.manufacturer.id %}">{{ part.manufacturer.name }}</a>{% include "clip.html"%}</td>
</tr>
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "MPN" %}</td>
<td>{{ part.MPN }}{% include "clip.html"%}</td>
</tr>
{% if part.link %} {% if part.link %}
<tr> <tr>
<td><span class='fas fa-link'></span></td> <td><span class='fas fa-link'></span></td>
@ -88,17 +103,8 @@ src="{% static 'img/blank_image.png' %}"
<td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td> <td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr>
<td><span class='fas fa-industry'></span></td>
<td>{% trans "Manufacturer" %}</td>
<td><a href="{% url 'company-detail' part.manufacturer.id %}">{{ part.manufacturer.name }}</a>{% include "clip.html"%}</td></tr>
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "MPN" %}</td>
<td>{{ part.MPN }}{% include "clip.html"%}</td>
</tr>
</table> </table>
{% endblock %} {% endblock details_right %}
{% block page_content %} {% block page_content %}