Part display tweaks

This commit is contained in:
Oliver Walters 2021-02-24 16:37:32 +11:00
parent a660578262
commit 2a7b32d4f4
2 changed files with 157 additions and 150 deletions

View File

@ -545,7 +545,7 @@
} }
.media { .media {
padding-top: 15px; //padding-top: 15px;
overflow: visible; overflow: visible;
} }
@ -811,6 +811,11 @@ input[type="submit"] {
background-color: #fafafa; background-color: #fafafa;
} }
.panel-inventree {
padding: 10px;
box-shadow: 1px 1px #DDD;
}
.float-right { .float-right {
float: right; float: right;
} }

View File

@ -26,173 +26,175 @@
</div> </div>
{% endif %} {% endif %}
<div class="row"> <div class='panel panel-default panel-inventree'>
<div class="col-sm-6"> <div class="row">
{% include "part/part_thumb.html" %} <div class="col-sm-6">
<div class="media-body"> {% include "part/part_thumb.html" %}
<h3> <div class="media-body">
{{ part.full_name }} <h3>
{% if user.is_staff and roles.part.change %} {{ part.full_name }}
<a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a> {% if user.is_staff and roles.part.change %}
{% endif %} <a href="{% url 'admin:part_part_change' part.pk %}"><span title="{% trans 'Admin view' %}" class='fas fa-user-shield'></span></a>
{% if not part.active %} {% endif %}
<div class='label label-large label-large-red'> {% if not part.active %}
{% trans 'Inactive' %} <div class='label label-large label-large-red'>
</div> {% trans 'Inactive' %}
{% endif %} </div>
</h3> {% endif %}
<p><i>{{ part.description }}</i></p> </h3>
<p><i>{{ part.description }}</i></p>
<div class='btn-group action-buttons' role='group'> <div class='btn-group action-buttons' role='group'>
<button type='button' class='btn btn-default' id='toggle-starred' title='{% trans "Star this part" %}'> <button type='button' class='btn btn-default' id='toggle-starred' title='{% trans "Star this part" %}'>
<span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/> <span id='part-star-icon' class='fas fa-star {% if starred %}icon-yellow{% endif %}'/>
</button> </button>
{% if barcodes %} {% if barcodes %}
<!-- Barcode actions menu --> <!-- Barcode actions menu -->
<div class='btn-group'> <div class='btn-group'>
<button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button> <button id='barcode-options' title='{% trans "Barcode actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-qrcode'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'> <ul class='dropdown-menu'>
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li> <li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
<li><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li> <li><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
</ul> </ul>
</div>
{% endif %}
{% if part.active %}
<button type='button' class='btn btn-default' id='price-button' title='{% trans "Show pricing information" %}'>
<span id='part-price-icon' class='fas fa-dollar-sign'/>
</button>
{% if roles.stock.change %}
<button type='button' class='btn btn-default' id='part-count' title='{% trans "Count part stock" %}'>
<span class='fas fa-clipboard-list'/>
</button>
{% endif %}
{% if part.purchaseable %}
{% if roles.purchase_order.add %}
<button type='button' class='btn btn-default' id='part-order' title='{% trans "Order part" %}'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% endif %}
{% endif %}
<!-- Part actions -->
{% if roles.part.add or roles.part.change or roles.part.delete %}
<div class='btn-group'>
<button id='part-actions' title='{% trans "Part actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'> <span class='fas fa-shapes'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
{% if roles.part.add %}
<li><a href='#' id='part-duplicate'><span class='fas fa-copy'></span> {% trans "Duplicate part" %}</a></li>
{% endif %}
{% if roles.part.change %}
<li><a href='#' id='part-edit'><span class='fas fa-edit icon-blue'></span> {% trans "Edit part" %}</a></li>
{% endif %}
{% if not part.active and roles.part.delete %}
<li><a href='#' id='part-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete part" %}</a></li>
{% endif %}
</ul>
</div>
{% endif %}
</div> </div>
{% endif %} <table class='table table-condensed'>
{% if part.active %} <col width='25'>
<button type='button' class='btn btn-default' id='price-button' title='{% trans "Show pricing information" %}'> {% if part.IPN %}
<span id='part-price-icon' class='fas fa-dollar-sign'/> <tr>
</button> <td></td>
{% if roles.stock.change %} <td>{% trans "IPN" %}</td>
<button type='button' class='btn btn-default' id='part-count' title='{% trans "Count part stock" %}'> <td>{{ part.IPN }}</td>
<span class='fas fa-clipboard-list'/> </tr>
</button> {% endif %}
{% endif %} {% if part.link %}
{% if part.purchaseable %} <tr>
{% if roles.purchase_order.add %} <td><span class='fas fa-link'></span></td>
<button type='button' class='btn btn-default' id='part-order' title='{% trans "Order part" %}'> <td>{% trans "External Link" %}</td>
<span id='part-order-icon' class='fas fa-shopping-cart'/> <td><a href="{{ part.link }}">{{ part.link }}</a></td>
</button> </tr>
{% endif %} {% endif %}
{% endif %} <tr>
{% endif %} </tr>
<!-- Part actions --> </table>
{% if roles.part.add or roles.part.change or roles.part.delete %}
<div class='btn-group'>
<button id='part-actions' title='{% trans "Part actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'> <span class='fas fa-shapes'></span> <span class='caret'></span></button>
<ul class='dropdown-menu'>
{% if roles.part.add %}
<li><a href='#' id='part-duplicate'><span class='fas fa-copy'></span> {% trans "Duplicate part" %}</a></li>
{% endif %}
{% if roles.part.change %}
<li><a href='#' id='part-edit'><span class='fas fa-edit icon-blue'></span> {% trans "Edit part" %}</a></li>
{% endif %}
{% if not part.active and roles.part.delete %}
<li><a href='#' id='part-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete part" %}</a></li>
{% endif %}
</ul>
</div>
{% endif %}
</div> </div>
<table class='table table-condensed'> </div>
</div>
<div class="col-sm-6">
<table class="table table-striped">
<col width='25'> <col width='25'>
{% if part.IPN %} <tr>
<td><span class='fas fa-boxes'></span></td>
<td>
<h4>{% trans "Available Stock" %}</h4>
</td>
<td><h4>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr>
<tr>
<td><span class='fas fa-map-marker-alt'></span></td>
<td>{% trans "In Stock" %}</td>
<td>{% include "part/stock_count.html" %}</td>
</tr>
{% if on_order > 0 %}
<tr>
<td><span class='fas fa-shopping-cart'></span></td>
<td>{% trans "On Order" %}</td>
<td>{% decimal on_order %}</td>
</tr>
{% endif %}
{% if required_build_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Build Orders" %}</td>
<td>{% decimal required_build_order_quantity %}
</tr>
{% endif %}
{% if required_sales_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Sales Orders" %}</td>
<td>{% decimal required_sales_order_quantity %}
</tr>
{% endif %}
{% if allocated > 0 %}
<tr>
<td><span class='fas fa-dolly'></span></td>
<td>{% trans "Allocated to Orders" %}</td>
<td>{% decimal allocated %}</td>
</tr>
{% endif %}
{% if not part.is_template %}
{% if part.assembly %}
<tr>
<td><span class='fas fa-tools'></span></td>
<td colspan='2'>
<b>{% trans "Build Status" %}</b>
</td>
</tr>
<tr> <tr>
<td></td> <td></td>
<td>{% trans "IPN" %}</td> <td>{% trans "Can Build" %}</td>
<td>{{ part.IPN }}</td> <td>{% decimal part.can_build %}</td>
</tr>
{% if quantity_being_built > 0 %}
<tr>
<td></td>
<td>{% trans "Building" %}</td>
<td>{% decimal quantity_being_built %}</td>
</tr> </tr>
{% endif %} {% 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 %} {% endif %}
<tr> {% endif %}
</tr>
</table> </table>
</div> </div>
</div> </div>
</div>
<div class="col-sm-6">
<table class="table table-striped">
<col width='25'>
<tr>
<td><span class='fas fa-boxes'></span></td>
<td>
<h4>{% trans "Available Stock" %}</h4>
</td>
<td><h4>{% decimal available %}{% if part.units %} {{ part.units }}{% endif %}</h4></td>
</tr>
<tr>
<td><span class='fas fa-map-marker-alt'></span></td>
<td>{% trans "In Stock" %}</td>
<td>{% include "part/stock_count.html" %}</td>
</tr>
{% if on_order > 0 %}
<tr>
<td><span class='fas fa-shopping-cart'></span></td>
<td>{% trans "On Order" %}</td>
<td>{% decimal on_order %}</td>
</tr>
{% endif %}
{% if required_build_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Build Orders" %}</td>
<td>{% decimal required_build_order_quantity %}
</tr>
{% endif %}
{% if required_sales_order_quantity > 0 %}
<tr>
<td><span class='fas fa-clipboard-list'></span></td>
<td>{% trans "Required for Sales Orders" %}</td>
<td>{% decimal required_sales_order_quantity %}
</tr>
{% endif %}
{% if allocated > 0 %}
<tr>
<td><span class='fas fa-dolly'></span></td>
<td>{% trans "Allocated to Orders" %}</td>
<td>{% decimal allocated %}</td>
</tr>
{% endif %}
{% if not part.is_template %}
{% if part.assembly %}
<tr>
<td><span class='fas fa-tools'></span></td>
<td colspan='2'>
<b>{% trans "Build Status" %}</b>
</td>
</tr>
<tr>
<td></td>
<td>{% trans "Can Build" %}</td>
<td>{% decimal part.can_build %}</td>
</tr>
{% if quantity_being_built > 0 %}
<tr>
<td></td>
<td>{% trans "Building" %}</td>
<td>{% decimal quantity_being_built %}</td>
</tr>
{% endif %}
{% endif %}
{% endif %}
</table>
</div>
</div> </div>
<hr>
<div class='container-fluid'> <div class='container-fluid'>
{% block details %} {% block details %}
<!-- Specific part details go here... --> <!-- Specific part details go here... -->
{% endblock %} {% endblock %}
</div> </div>
{% endblock %} {% endblock %}