Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2019-06-20 21:49:19 +10:00
commit e0bfda2b14
9 changed files with 136 additions and 88 deletions

View File

@ -34,7 +34,7 @@ InvenTree | Company - {{ company.name }}
<span class='glyphicon glyphicon-cog'/> <span class='glyphicon glyphicon-cog'/>
</button> </button>
<button type='button' class='btn btn-default btn-glyph' id='company-delete' title='Delete company'> <button type='button' class='btn btn-default btn-glyph' id='company-delete' title='Delete company'>
<span class='glyphicon glyphicon-trash' style='color: #a11;'/> <span class='glyphicon glyphicon-trash'/>
</button> </button>
</div> </div>
</div> </div>

View File

@ -121,11 +121,11 @@ InvenTree | {{ order }}
{% if order.status == OrderStatus.PENDING %} {% if order.status == OrderStatus.PENDING %}
<td> <td>
<div class='btn-group'> <div class='btn-group'>
<button class='btn btn-default btn-edit' line='{{ line.id }}' id='edit-line-item-{{ line.id }} title='Edit line item' onclick='editPurchaseOrderLineItem()'> <button class='btn btn-default btn-glyph' 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> <span url="{% url 'po-line-item-edit' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-edit'></span>
</button> </button>
<button class='btn btn-default btn-remove' line='{{ line.id }}' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem()'> <button class='btn btn-default btn-glyph' 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> <span url="{% url 'po-line-item-delete' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-remove'></span>
</button> </button>
</div> </div>
</td> </td>

View File

@ -31,8 +31,12 @@
<td>{{ attachment.comment }}</td> <td>{{ attachment.comment }}</td>
<td> <td>
<div class='btn-group' style='float: right;'> <div class='btn-group' style='float: right;'>
<button type='button' class='btn btn-primary attachment-edit-button' url="{% url 'part-attachment-edit' attachment.id %}" data-toggle='tooltip' title='Edit attachment ({{ attachment.basename }})'><span class='glyphicon glyphicon-small glyphicon-edit'></span></button> <button type='button' class='btn btn-default btn-glyph' url="{% url 'part-attachment-edit' attachment.id %}" data-toggle='tooltip' title='Edit attachment ({{ attachment.basename }})'>
<button type='button' class='btn btn-danger attachment-delete-button' url="{% url 'part-attachment-delete' attachment.id %}" data-toggle='tooltip' title='Delete attachment ({{ attachment.basename }})'><span class='glyphicon glyphicon-small glyphicon-trash'></span></button> <span class='glyphicon glyphicon-edit'/>
</button>
<button type='button' class='btn btn-default btn-glyph' url="{% url 'part-attachment-delete' attachment.id %}" data-toggle='tooltip' title='Delete attachment ({{ attachment.basename }})'>
<span class='glyphicon glyphicon-trash'/>
</button>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -4,36 +4,35 @@
{% block content %} {% block content %}
<div class='row'> <div class='row'>
<div class='col-sm-6'> <div class='col-sm-6'>
{% if category %} {% if category %}
<h3>{{ category.name }}</h3> <h3>{{ category.name }}</h3>
<p>{{ category.description }}</p> <p>{{ category.description }}</p>
{% if category.default_location %} {% if category.default_location %}
<p>Default Location: <a href="{% url 'stock-location-detail' category.default-location.id }%">{{ category.default_location }}</a></p> <p>Default Location: <a href="{% url 'stock-location-detail' category.default-location.id }%">{{ category.default_location }}</a></p>
{% endif %} {% endif %}
{% else %} {% else %}
<h3>Part Categories</h3> <h3>Part Categories</h3>
{% endif %} <p>All parts</p>
</div> {% endif %}
<div class='col-sm-6'> <p>
<h3> <div class='btn-group'>
<div style='float: right;'> <button class='btn btn-default btn-glyph' id='cat-create' title='Create new part category'>
<button class='btn btn-success' id='cat-create'>New Category</button> <span class='glyphicon glyphicon-plus'/>
{% if category %} </button>
<div class="dropdown" style="float: right;"> {% if category %}
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"> <button class='btn btn-default btn-glyph' id='cat-edit' title='Edit part category'>
Options <span class='glyphicon glyphicon-cog'/>
<span class="caret"></span> </button>
</button> <button class='btn btn-default btn-glyph' id='cat-delete' title='Delete part category'>
<ul class="dropdown-menu"> <span class='glyphicon glyphicon-trash'/>
<li><a href="#" id='cat-edit' title='Edit part category'>Edit</a></li> </button>
<li><a href="#" id='cat-delete' title='Delete part category'>Delete</a></li> {% endif %}
</ul> </div>
</p>
</div> </div>
{% endif %} <div class='col-sm-6'>
</div> </div>
</h3>
</div>
</div> </div>
{% if category and category.children.all|length > 0 %} {% if category and category.children.all|length > 0 %}

View File

@ -40,34 +40,41 @@
</h4> </h4>
<p><i>{{ part.description }}</i></p> <p><i>{{ part.description }}</i></p>
<p> <p>
<div class='btn-group'> <div class='btn-row'>
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'> <div class='btn-group'>
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/> <button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
</button> <span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
{% if part.is_template == False %} </button>
{% include "qr_button.html" %} {% if part.is_template == False %}
{% if part.active %} {% include "qr_button.html" %}
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'> {% if part.active %}
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/> <button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
</button> <span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
{% if part.purchaseable %} </button>
<button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'> {% if not part.virtual %}
<span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/> <button type='button' class='btn btn-default btn-glyph' id='part-count' title='Count part stock'>
</button> <span class='glyphicon glyphicon-ok-circle'/>
{% endif %} </button>
{% endif %} {% endif %}
{% endif %} {% if part.purchaseable %}
<button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'> <button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'>
<span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/> <span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/>
</button> </button>
<button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'> {% endif %}
<span id='part-edit-icon' class='glyphicon glyphicon-cog part-cog'/> {% endif %}
</button> {% endif %}
{% if not part.active %} <button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'>
<button type='button' class='btn btn-default btn-glyph' id='part-delete' title='Delete part'> <span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/>
<span id='part-delete-icon' class='glyphicon glyphicon-trash' style='color: #a11;'/> </button>
</button> <button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'>
{% endif %} <span id='part-edit-icon' class='glyphicon glyphicon-edit'/>
</button>
{% if not part.active %}
<button type='button' class='btn btn-default btn-glyph' id='part-delete' title='Delete part'>
<span id='part-delete-icon' class='glyphicon glyphicon-trash'/>
</button>
{% endif %}
</div>
</div> </div>
</p> </p>
<table class='table table-condensed'> <table class='table table-condensed'>
@ -171,6 +178,16 @@
); );
}); });
$("#part-count").click(function() {
launchModalForm("/stock/adjust/", {
data: {
action: "count",
part: {{ part.id }},
reload: true,
}
});
});
$("#price-button").click(function() { $("#price-button").click(function() {
launchModalForm( launchModalForm(
"{% url 'part-pricing' part.id %}", "{% url 'part-pricing' part.id %}",

View File

@ -23,11 +23,23 @@
} }
.glyphicon-ok { .glyphicon-ok {
color: #5f5; color: #5C5;
}
.glyphicon-ok-circle {
color: #55c;
} }
.glyphicon-remove { .glyphicon-remove {
color: #f55; color: #C55;
}
.glyphicon-trash {
color: #C55;
}
.glyphicon-plus {
color: #5C5;
} }
/* CSS overrides for treeview */ /* CSS overrides for treeview */

View File

@ -189,8 +189,8 @@ function loadBomTable(table, options) {
if (options.editable) { if (options.editable) {
cols.push({ cols.push({
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var bEdit = "<button title='Edit BOM Item' class='btn btn-primary bom-edit-button btn-sm' type='button' url='/part/bom/" + row.pk + "/edit'><span class='glyphicon glyphicon-small glyphicon-edit'></span></button>"; var bEdit = "<button title='Edit BOM Item' class='btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/edit'><span class='glyphicon glyphicon-edit'/></button>";
var bDelt = "<button title='Delete BOM Item' class='btn btn-danger bom-delete-button btn-sm' type='button' url='/part/bom/" + row.pk + "/delete'><span class='glyphicon glyphicon-small glyphicon-trash'></span></button>"; var bDelt = "<button title='Delete BOM Item' class='btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='glyphicon glyphicon-trash'/></button>";
return "<div class='btn-group'>" + bEdit + bDelt + "</div>"; return "<div class='btn-group'>" + bEdit + bDelt + "</div>";
} }

View File

@ -16,6 +16,9 @@
<button type='button' class='btn btn-default btn-glyph' id='stock-remove' title='Take from stock'> <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;'/> <span class='glyphicon glyphicon-minus-sign' style='color: #a11;'/>
</button> </button>
<button type='button' class='btn btn-default btn-glyph' id='stock-count' title='Count stock'>
<span class='glyphicon glyphicon-ok-circle'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-move' title='Transfer stock'> <button type='button' class='btn btn-default btn-glyph' id='stock-move' title='Transfer stock'>
<span class='glyphicon glyphicon-transfer' style='color: #11a;'/> <span class='glyphicon glyphicon-transfer' style='color: #11a;'/>
</button> </button>
@ -27,7 +30,7 @@
<span class='glyphicon glyphicon-cog'/> <span class='glyphicon glyphicon-cog'/>
</button> </button>
<button type='button' class='btn btn-default btn-glyph' id='stock-delete' title='Edit stock item'> <button type='button' class='btn btn-default btn-glyph' id='stock-delete' title='Edit stock item'>
<span class='glyphicon glyphicon-trash' style='color: #a11;'/> <span class='glyphicon glyphicon-trash'/>
</button> </button>
</div> </div>
</p> </p>
@ -124,7 +127,7 @@
{% if item.has_tracking_info %} {% if item.has_tracking_info %}
<hr>
<div id='table-toolbar'> <div id='table-toolbar'>
<h4>Stock Tracking Information</h4> <h4>Stock Tracking Information</h4>
</div> </div>
@ -181,7 +184,7 @@
itemAdjust("move"); itemAdjust("move");
}); });
$("#stock-stocktake").click(function() { $("#stock-count").click(function() {
itemAdjust('count'); itemAdjust('count');
}); });

View File

@ -7,30 +7,31 @@
{% if location %} {% if location %}
<h3>{{ location.name }}</h3> <h3>{{ location.name }}</h3>
<p>{{ location.description }}</p> <p>{{ location.description }}</p>
<p>
<div class='btn-group'>
{% include "qr_button.html" %}
</div>
</p>
{% else %} {% else %}
<h3>Stock</h3> <h3>Stock</h3>
<p>All stock items</p> <p>All stock items</p>
{% endif %} {% endif %}
<p>
<div class='btn-group'>
<button class='btn btn-default btn-glyph' id='location-create' title='Create new stock location'>
<span class='glyphicon glyphicon-plus'/>
</button>
{% if location %}
{% include "qr_button.html" %}
<button class='btn btn-default btn-glyph' id='location-count' title='Count stock items'>
<span class='glyphicon glyphicon-ok-circle'/>
</button>
<button class='btn btn-default btn-glyph' id='location-edit' title='Edit stock location'>
<span class='glyphicon glyphicon-cog'/>
</button>
<button class='btn btn-default btn-glyph' id='location-delete' title='Delete stock location'>
<span class='glyphicon glyphicon-trash'/>
</button>
{% endif %}
</div>
</p>
</div> </div>
<div class='col-sm-6'> <div class='col-sm-6'>
<h3>
<div style='float: right;'>
<button class='btn btn-success' id='location-create'>New Stock Location</button>
{% if location %}
<div class="dropdown" style="float: right;">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#" id='location-edit' title='Edit stock location'>Edit</a></li>
<li><a href="#" id='location-delete' title='Delete stock location'>Delete</a></li>
</ul>
</div>
{% endif %}
</div> </div>
</h3> </h3>
</div> </div>
@ -91,6 +92,18 @@
return false; return false;
}); });
{% if location %}
$("#location-count").click(function() {
launchModalForm("/stock/adjust/", {
data: {
action: "count",
location: {{ location.id }},
reload: true,
}
});
});
{% endif %}
$('#show-qr-code').click(function() { $('#show-qr-code').click(function() {
launchModalForm("{% url 'stock-location-qr' location.id %}", launchModalForm("{% url 'stock-location-qr' location.id %}",
{ {