mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display sub-location information
This commit is contained in:
parent
7120b940f0
commit
4011d66b6f
11
InvenTree/static/css/bootstrap-table-group-by.css
vendored
Normal file
11
InvenTree/static/css/bootstrap-table-group-by.css
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
.bootstrap-table .table > tbody > tr.groupBy {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.bootstrap-table .table > tbody > tr.groupBy.expanded {
|
||||
|
||||
}
|
||||
|
||||
.bootstrap-table .table > tbody > tr.hidden + tr.detail-view {
|
||||
display: none;
|
||||
}
|
@ -153,7 +153,7 @@
|
||||
var cell = '<td>';
|
||||
|
||||
if (typeof that.options.groupByFormatter == 'function') {
|
||||
cell += that.options.groupByFormatter(col.title, item.id, item.data);
|
||||
cell += '<i>' + that.options.groupByFormatter(col.title, item.id, item.data) + "</i>";
|
||||
}
|
||||
|
||||
cell += "</td>";
|
||||
@ -177,7 +177,7 @@
|
||||
|
||||
if(item.data.length > 1) {
|
||||
|
||||
that.$body.find('tr[data-parent-index=' + item.id + ']').addClass('hidden');
|
||||
that.$body.find('tr[data-parent-index=' + item.id + ']').addClass('hidden stock-sub-group');
|
||||
|
||||
that.$body.find('tr[data-parent-index=' + item.id + ']:first').before($(html.join('')));
|
||||
}
|
||||
|
@ -404,9 +404,25 @@ function loadStockTable(table, options) {
|
||||
stock += item.quantity;
|
||||
});
|
||||
|
||||
return stock;
|
||||
}
|
||||
return stock + ' <i>(' + data.length + ' items)</i>';
|
||||
} else if (field == 'Location') {
|
||||
/* Determine how many locations */
|
||||
var locations = [];
|
||||
|
||||
data.forEach(function(item) {
|
||||
var loc = item.location;
|
||||
|
||||
if (!locations.includes(loc)) {
|
||||
locations.push(loc);
|
||||
}
|
||||
});
|
||||
|
||||
if (locations.length > 1) {
|
||||
return "In " + locations.length + " locations";
|
||||
} else {
|
||||
return renderLink(data[0].location_detail.pathstring, data[0].location_detail.url);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap-table.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/bootstrap-table-group-by.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/select2.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/select2-bootstrap.css' %}">
|
||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||
|
Loading…
Reference in New Issue
Block a user