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,50 +55,56 @@ 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'>
<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 details %}
{% block details_right %} {% block details_right %}
<table class="table table-striped table-condensed"> <table class="table table-striped table-condensed">
<col width='25'> <col width='25'>
<tr>
<td><span class='fas fa-shapes'></span></td> <tr>
<td>{% trans "Internal Part" %}</td> <td><span class='fas fa-industry'></span></td>
<td> <td>{% trans "Manufacturer" %}</td>
{% if part.part %} <td><a href="{% url 'company-detail' part.manufacturer.id %}">{{ part.manufacturer.name }}</a>{% include "clip.html"%}</td>
<a href="{% url 'part-detail' part.part.id %}?display=part-suppliers">{{ part.part.full_name }}</a>{% include "clip.html"%} </tr>
{% endif %} <tr>
</td> <td><span class='fas fa-hashtag'></span></td>
</tr> <td>{% trans "MPN" %}</td>
{% if part.description %} <td>{{ part.MPN }}{% include "clip.html"%}</td>
<tr> </tr>
<td></td> {% if part.link %}
<td>{% trans "Description" %}</td> <tr>
<td>{{ part.description }}{% include "clip.html"%}</td> <td><span class='fas fa-link'></span></td>
</tr> <td>{% trans "External Link" %}</td>
{% endif %} <td><a href="{{ part.link }}">{{ part.link }}</a>{% include "clip.html"%}</td>
{% if part.link %} </tr>
<tr> {% endif %}
<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-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 %}