Cleaner part details

This commit is contained in:
eeintech 2021-07-15 14:52:33 -04:00
parent bb60eed897
commit bfc421c50b

View File

@ -18,19 +18,14 @@
<div class="media-body"> <div class="media-body">
<h3> <h3>
{{ part.full_name }} {{ part.full_name }}
</h3>
<p>
<h3>
<!-- Admin View -->
{% if user.is_staff and roles.part.change %} {% if user.is_staff and roles.part.change %}
<a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a> <a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
{% endif %} {% endif %}
{% if not part.active %} <!-- Properties -->
<div class='label label-large label-large-red'>
{% trans 'Inactive' %}
</div>
{% endif %}
</h3>
{% if part.description %}
<p><em>{{ part.description }}</em></p>
{% endif %}
<p>
<div id='part-properties' class='btn-group' role='group'> <div id='part-properties' class='btn-group' role='group'>
{% if part.virtual %} {% if part.virtual %}
<span class='fas fa-ghost' title='{% trans "Part is virtual (not a physical part)" %}'></span> <span class='fas fa-ghost' title='{% trans "Part is virtual (not a physical part)" %}'></span>
@ -54,6 +49,13 @@
<span class='fas fa-dollar-sign' title='{% trans "Part can be sold to customers" %}'></span> <span class='fas fa-dollar-sign' title='{% trans "Part can be sold to customers" %}'></span>
{% endif %} {% endif %}
</div> </div>
<!-- Part active -->
{% if not part.active %}
<div class='label label-large label-large-red'>
{% trans 'Inactive' %}
</div>
{% endif %}
</h3>
</p> </p>
<div class='btn-group action-buttons' role='group'> <div class='btn-group action-buttons' role='group'>
@ -122,40 +124,6 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
<table class='table table-condensed'>
<col width='25'>
{% if part.keywords %}
<tr>
<td><span class='fas fa-key'></span></td>
<td>{% trans "Keywords" %}</td>
<td>{{ part.keywords }}</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></td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Creation Date" %}</td>
<td>
{{ part.creation_date }}
{% if part.creation_user %}
<span class='badge'>{{ part.creation_user }}</span>
{% endif %}
</td>
</tr>
{% if part.trackable and part.getLatestSerialNumber %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Latest Serial Number" %}</td>
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
</tr>
{% endif %}
</table>
</div> </div>
</div> </div>
@ -174,14 +142,69 @@
</div> </div>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<table class="table table-striped"> <table class='table table-condensed table-striped'>
<col width='25'> <col width='25'>
{% if part.description %}
<td><span class='fas fa-info-circle'></span></td>
<td>{% trans "Description" %}</td>
<td>{{ part.description }}{% include "clip.html"%}</td>
{% endif %}
{% if part.revision %}
<tr>
<td><span class='fas fa-code-branch'></span></td>
<td>{% trans "Revision" %}</td>
<td>{{ part.revision }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.keywords %}
<tr>
<td><span class='fas fa-key'></span></td>
<td>{% trans "Keywords" %}</td>
<td>{{ part.keywords }}{% 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-calendar-alt'></span></td>
<td>{% trans "Creation Date" %}</td>
<td>
{{ part.creation_date }}
{% if part.creation_user %}
<span class='badge'>{{ part.creation_user }}</span>
{% endif %}
</td>
</tr>
{% if part.trackable and part.getLatestSerialNumber %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Latest Serial Number" %}</td>
<td>{{ part.getLatestSerialNumber }}{% include "clip.html"%}</td>
</tr>
{% endif %}
{% if part.default_location %}
<tr>
<td><span class='fas fa-search-location'></span></td>
<td>{% trans "Default Location" %}</td>
<td>{{ part.default_location }}</td>
</tr>
{% endif %}
{% if part.default_supplier %}
<tr>
<td><span class='fas fa-building'></span></td>
<td>{% trans "Default Supplier" %}</td>
<td>{{ part.default_supplier }}</td>
</tr>
{% endif %}
<tr> <tr>
<td><span class='fas fa-boxes'></span></td> <td><span class='fas fa-boxes'></span></td>
<td> <td>{% trans "Available Stock" %}</td>
<h4>{% trans "Available Stock" %}</h4> <td>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</td>
</td>
<td><h4>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr> </tr>
<tr> <tr>
<td><span class='fas fa-map-marker-alt'></span></td> <td><span class='fas fa-map-marker-alt'></span></td>