Merge pull request #405 from SchrodingersGat/yet-more-buttons

Yet more buttons
This commit is contained in:
Oliver 2019-06-19 19:40:31 +10:00 committed by GitHub
commit 7a2dbce282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 136 additions and 88 deletions

View File

@ -34,7 +34,7 @@ InvenTree | Company - {{ company.name }}
<span class='glyphicon glyphicon-cog'/>
</button>
<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>
</div>
</div>

View File

@ -121,11 +121,11 @@ InvenTree | {{ order }}
{% if order.status == OrderStatus.PENDING %}
<td>
<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()'>
<span url="{% url 'po-line-item-edit' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-edit'></span>
<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-edit'></span>
</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()'>
<span url="{% url 'po-line-item-delete' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-remove'></span>
<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-remove'></span>
</button>
</div>
</td>

View File

@ -31,8 +31,12 @@
<td>{{ attachment.comment }}</td>
<td>
<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-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>
<button type='button' class='btn btn-default btn-glyph' url="{% url 'part-attachment-edit' attachment.id %}" data-toggle='tooltip' title='Edit attachment ({{ attachment.basename }})'>
<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>
</td>
</tr>

View File

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

View File

@ -40,34 +40,41 @@
</h4>
<p><i>{{ part.description }}</i></p>
<p>
<div class='btn-group'>
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
</button>
{% if part.is_template == False %}
{% include "qr_button.html" %}
{% if part.active %}
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
</button>
{% if part.purchaseable %}
<button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'>
<span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/>
</button>
{% endif %}
{% endif %}
{% endif %}
<button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'>
<span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'>
<span id='part-edit-icon' class='glyphicon glyphicon-cog part-cog'/>
</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' style='color: #a11;'/>
</button>
{% endif %}
<div class='btn-row'>
<div class='btn-group'>
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
</button>
{% if part.is_template == False %}
{% include "qr_button.html" %}
{% if part.active %}
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
</button>
{% if not part.virtual %}
<button type='button' class='btn btn-default btn-glyph' id='part-count' title='Count part stock'>
<span class='glyphicon glyphicon-ok-circle'/>
</button>
{% endif %}
{% if part.purchaseable %}
<button type='button' class='btn btn-default btn-glyph' id='part-order' title='Order part'>
<span id='part-order-icon' class='part-order glyphicon glyphicon-shopping-cart'/>
</button>
{% endif %}
{% endif %}
{% endif %}
<button type='button' class='btn btn-default btn-glyph' id='part-duplicate' title='Duplicate part'>
<span id='part-duplicate-icon' class='part-duplicate glyphicon glyphicon-duplicate'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='part-edit' title='Edit part'>
<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>
</p>
<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() {
launchModalForm(
"{% url 'part-pricing' part.id %}",

View File

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

View File

@ -189,8 +189,8 @@ function loadBomTable(table, options) {
if (options.editable) {
cols.push({
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 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 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-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>";
}

View File

@ -16,6 +16,9 @@
<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-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'>
<span class='glyphicon glyphicon-transfer' style='color: #11a;'/>
</button>
@ -27,7 +30,7 @@
<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;'/>
<span class='glyphicon glyphicon-trash'/>
</button>
</div>
</p>
@ -124,7 +127,7 @@
{% if item.has_tracking_info %}
<hr>
<div id='table-toolbar'>
<h4>Stock Tracking Information</h4>
</div>
@ -181,7 +184,7 @@
itemAdjust("move");
});
$("#stock-stocktake").click(function() {
$("#stock-count").click(function() {
itemAdjust('count');
});

View File

@ -7,30 +7,31 @@
{% if location %}
<h3>{{ location.name }}</h3>
<p>{{ location.description }}</p>
<p>
<div class='btn-group'>
{% include "qr_button.html" %}
</div>
</p>
{% else %}
<h3>Stock</h3>
<p>All stock items</p>
{% 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 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>
</h3>
</div>
@ -91,6 +92,18 @@
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() {
launchModalForm("{% url 'stock-location-qr' location.id %}",
{