Added pretty buttons to stock item page

This commit is contained in:
Oliver Walters 2019-06-18 23:56:00 +10:00
parent b4833fbb7d
commit c0e66dd9a0
3 changed files with 33 additions and 31 deletions

View File

@ -62,6 +62,9 @@ InvenTree | {{ order }}
<hr>
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
{% if order.status == OrderStatus.PENDING %}
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
{% endif %}
<button type='button' class='btn btn-primary' id='edit-order'>Edit Order</button>
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
<button type='button' class='btn btn-primary' id='place-order'>Place Order</button>
@ -73,10 +76,6 @@ InvenTree | {{ order }}
<h4>Order Items</h4>
{% if order.status == OrderStatus.PENDING %}
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
{% endif %}
<table class='table table-striped table-condensed' id='po-lines-table' data-toolbar='#order-toolbar-buttons'>
<thead>
<tr>
@ -122,10 +121,10 @@ InvenTree | {{ order }}
{% if order.status == OrderStatus.PENDING %}
<td>
<div class='btn-group'>
<button class='btn btn-default btn-edit' id='edit-line-item-{{ line.id }} title='Edit line item' onclick='editPurchaseOrderLineItem()'>
<button class='btn btn-default btn-edit' line='{{ line.id }}' id='edit-line-item-{{ line.id }} title='Edit line item' onclick='editPurchaseOrderLineItem()'>
<span url="{% url 'po-line-item-edit' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-edit'></span>
</button>
<button class='btn btn-default btn-remove' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem()'>
<button class='btn btn-default btn-remove' line='{{ line.id }}' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem()'>
<span url="{% url 'po-line-item-delete' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-remove'></span>
</button>
</div>

View File

@ -2,7 +2,9 @@
{% block pre_form_content %}
Are you sure you want to delete part '{{ part.full_name }}'?
<div class='alert alert-block alert-danger'>
Are you sure you want to delete part '<b>{{ part.full_name }}</b>'?
</div>
{% if part.used_in_count %}
<hr>

View File

@ -9,32 +9,29 @@
<p>
<div class='btn-group'>
{% include "qr_button.html" %}
{% if item.in_stock %}
<button type='button' class='btn btn-default btn-glyph' id='stock-add' title='Add to stock'>
<span class='glyphicon glyphicon-plus-sign' style='color: #1a1;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-remove' title='Take from stock'>
<span class='glyphicon glyphicon-minus-sign' style='color: #a11;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-move' title='Transfer stock'>
<span class='glyphicon glyphicon-transfer' style='color: #11a;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-duplicate' title='Duplicate stock item'>
<span class='glyphicon glyphicon-duplicate'/>
</button>
{% endif %}
<button type='button' class='btn btn-default btn-glyph' id='stock-edit' title='Edit stock item'>
<span class='glyphicon glyphicon-cog'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-delete' title='Edit stock item'>
<span class='glyphicon glyphicon-trash' style='color: #a11;'/>
</button>
</div>
</p>
</div>
<div class='col-sm-6'>
<h3>
<div style='float: right;'>
<div class="dropdown" style="float: right;">
<button class='btn btn-primary' type='button' id='duplicate-item'>Copy Stock Item</button>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
{% if item.in_stock %}
<li><a href="#" id='stock-edit' title='Edit stock item'>Edit stock item</a></li>
<hr>
<li><a href='#' id='stock-add' title='Add stock'>Add to stock</a></li>
<li><a href='#' id='stock-remove' title='Take stock'>Take from stock</a></li>
<li><a href='#' id='stock-stocktake' title='Count stock'>Stocktake</a></li>
<li><a href="#" id='stock-move' title='Move stock'>Move stock item</a></li>
{% endif %}
<hr>
<li><a href="#" id='stock-delete' title='Delete stock item'>Delete stock item</a></li>
</div>
</div>
</h3>
</div>
</div>
<div class='row'>
<div class='col-sm-6'>
@ -90,6 +87,10 @@
</tr>
{% endif %}
{% if item.supplier_part %}
<tr>
<td>Supplier</td>
<td><a href="{% url 'company-detail' item.supplier_part.supplier.id %}">{{ item.supplier_part.supplier.name }}</a></td>
</tr>
<tr>
<td>Supplier Part</td>
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
@ -134,7 +135,7 @@
{% block js_ready %}
{{ block.super }}
$("#duplicate-item").click(function() {
$("#stock-duplicate").click(function() {
launchModalForm(
"{% url 'stock-item-create' %}",
{