Merge pull request #866 from SchrodingersGat/moar-buttons

Reorganize buttons for "Part" view
This commit is contained in:
Oliver 2020-06-12 18:16:06 +10:00 committed by GitHub
commit 2047b2d7d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 50 deletions

View File

@ -35,44 +35,42 @@
{% endif %}
</h3>
<p><i>{{ part.description }}</i></p>
<p>
<div class='btn-row'>
<div class='btn-group action-buttons'>
<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 %}'/>
</button>
{% if part.is_template == False %}
{% include "qr_button.html" %}
{% 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 not part.virtual %}
<button type='button' class='btn btn-default' id='part-count' title='Count part stock'>
<span class='fas fa-clipboard-list'/>
</button>
{% endif %}
{% if part.purchaseable %}
<button type='button' class='btn btn-default' id='part-order' title='Order part'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% endif %}
{% endif %}
<button type='button' class='btn btn-default' id='part-duplicate' title='Duplicate part'>
<span id='part-duplicate-icon' class='fas fa-copy'/>
</button>
<button type='button' class='btn btn-default' id='part-edit' title='Edit part'>
<span id='part-edit-icon' class='fas fa-edit icon-blue'/>
</button>
{% if not part.active %}
<button type='button' class='btn btn-default' id='part-delete' title='Delete part'>
<span id='part-delete-icon' class='fas fa-trash-alt icon-red'/>
</button>
{% endif %}
</div>
<div class='btn-group action-buttons' role='group'>
<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 %}'/>
</button>
<!-- Barcode actions menu -->
<div class='dropdown dropdown-buttons'>
<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' role='menu'>
<li><a href='#' id='show-qr-code'><span class='fas fa-qrcode'></span> {% trans "Show QR Code" %}</a></li>
<li class='disabled'><a href='#' id='print-label'><span class='fas fa-tag'></span> {% trans "Print Label" %}</a></li>
</ul>
</div>
</p>
{% 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>
<button type='button' class='btn btn-default' id='part-count' title='Count part stock'>
<span class='fas fa-clipboard-list'/>
</button>
{% if part.purchaseable %}
<button type='button' class='btn btn-default' id='part-order' title='Order part'>
<span id='part-order-icon' class='fas fa-shopping-cart'/>
</button>
{% endif %}
{% endif %}
<div class='dropdown dropdown-buttons'>
<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' role='menu'>
<li><a href='#' id='part-duplicate'><span class='fas fa-copy'></span> {% trans "Duplicate part" %}</a></li>
<li><a href='#' id='part-edit'><span class='fas fa-edit icon-blue'></span> {% trans "Edit part" %}</a></li>
{% if not part.active %}
<li><a href='#' id='part-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete part" %}</a></li>
{% endif %}
</ul>
</div>
</div>
<table class='table table-condensed'>
<col width='25'>
{% if part.IPN %}

View File

@ -140,6 +140,19 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
<a href="{% url 'part-stock' item.part.id %}">{{ item.part.full_name }}
</td>
</tr>
{% if item.serialized %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Serial Number" %}</td>
<td>{{ item.serial }}</td>
</tr>
{% else %}
<tr>
<td></td>
<td>{% trans "Quantity" %}</td>
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
</tr>
{% endif %}
{% if item.customer %}
<tr>
<td><span class='fas fa-user-tie'></span></td>
@ -183,19 +196,6 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
<td>{{ item.uid }}</td>
</tr>
{% endif %}
{% if item.serialized %}
<tr>
<td><span class='fas fa-hashtag'></span></td>
<td>{% trans "Serial Number" %}</td>
<td>{{ item.serial }}</td>
</tr>
{% else %}
<tr>
<td></td>
<td>{% trans "Quantity" %}</td>
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
</tr>
{% endif %}
{% if item.batch %}
<tr>
<td></td>