mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
More betterer buttons for stock locationdetail
This commit is contained in:
parent
1c5972e326
commit
52cc7360b3
@ -1,9 +1,9 @@
|
|||||||
function editButton(url, text='Edit') {
|
function editButton(url, text='Edit') {
|
||||||
return "<button class='btn btn-success edit-button' type='button' url='" + url + "'>" + text + "</button>";
|
return "<button class='btn btn-success edit-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteButton(url, text='Delete') {
|
function deleteButton(url, text='Delete') {
|
||||||
return "<button class='btn btn-danger delete-button' type='button' url='" + url + "'>" + text + "</button>";
|
return "<button class='btn btn-danger delete-button btn-sm' type='button' url='" + url + "'>" + text + "</button>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderLink(text, url) {
|
function renderLink(text, url) {
|
||||||
|
@ -33,7 +33,16 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class='container-fluid'>
|
<div class='container-fluid'>
|
||||||
<button class="btn btn-success" id='item-create'>Add <span class="glyphicon glyphicon-plus"></span></button>
|
<div class="dropdown" style='float: right;'>
|
||||||
|
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Selected
|
||||||
|
<span class="caret"></span></button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a href="#" id='multi-item-stocktake' title='Stocktake selected stock items'>Stocktake</a></li>
|
||||||
|
<li><a href='#' id='multi-item-move' title='Move selected stock items'>Move</a></li>
|
||||||
|
<li><a href="#" id='multi-item-delete' title='Delete selected stock items'>Delete</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-success" id='item-create'>New Stock Item</span></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'modals.html' %}
|
{% include 'modals.html' %}
|
||||||
@ -79,11 +88,45 @@
|
|||||||
launchModalForm("#modal-form",
|
launchModalForm("#modal-form",
|
||||||
"{% url 'stock-item-create' %}",
|
"{% url 'stock-item-create' %}",
|
||||||
{
|
{
|
||||||
reload: true,
|
success: function() {
|
||||||
|
$("#stock-table").bootstrapTable('refresh');
|
||||||
|
},
|
||||||
data: {
|
data: {
|
||||||
location: {{ location.id }}
|
location: {{ location.id }}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
function selectedStock() {
|
||||||
|
return $("stock-table").bootstrapTable('getSelections');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#multi-item-move").click(function() {
|
||||||
|
|
||||||
|
var items = selectedStock();
|
||||||
|
|
||||||
|
alert('Moving ' + items.length + ' items');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#multi-item-delete").click(function() {
|
||||||
|
|
||||||
|
var items = selectedStock();
|
||||||
|
|
||||||
|
alert('Deleting ' + items.length + ' items');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#multi-item-stocktake").click(function() {
|
||||||
|
var items = selectedStock();
|
||||||
|
|
||||||
|
alert('Stocktake on ' + items.length + ' items');
|
||||||
|
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
{% include 'stock/stock_table.html' with location=location %}
|
{% include 'stock/stock_table.html' with location=location %}
|
||||||
|
Loading…
Reference in New Issue
Block a user