BOM table now displays which lines have been marked as valid

This commit is contained in:
Oliver Walters 2019-09-05 14:15:58 +10:00
parent 1ea7bdf843
commit 81f5714cb1
3 changed files with 40 additions and 1 deletions

View File

@ -81,6 +81,15 @@
max-width: 250px;
}
.bomrowvalid {
color: #050;
}
.bomrowinvalid {
color: #A00;
font-style: italic;
}
/* Part image icons with full-display on mouse hover */
.hover-img-thumb {

View File

@ -113,14 +113,19 @@ function loadBomTable(table, options) {
];
if (options.editable) {
/*
// TODO - Enable multi-select functionality
cols.push({
checkbox: true,
title: 'Select',
searchable: false,
sortable: false,
});
*/
}
// Part column
cols.push(
{
@ -230,10 +235,27 @@ function loadBomTable(table, options) {
if (options.editable) {
cols.push({
formatter: function(value, row, index, field) {
var bValidate = "<button title='Validate BOM Item' class='bom-validate-button btn btn-default btn-glyph' type='button' pk='" + row.pk + "'><span class='glyphicon glyphicon-check'/></button>";
var bValid = "<span class='glyphicon glyphicon-ok'/>";
var bEdit = "<button title='Edit BOM Item' class='bom-edit-button 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='bom-delete-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='glyphicon glyphicon-trash'/></button>";
return "<div class='btn-group' role='group'>" + bEdit + bDelt + "</div>";
var html = "<div class='btn-group' role='group'>";
html += bEdit;
html += bDelt;
if (!row.validated) {
html += bValidate;
} else {
html += bValid;
}
html += "</div>";
return html;
}
});
}
@ -256,6 +278,13 @@ function loadBomTable(table, options) {
table.bootstrapTable({
sortable: true,
search: true,
rowStyle: function(row, index) {
if (row.validated) {
return {classes: 'bomrowvalid'};
} else {
return {classes: 'bomrowinvalid'};
}
},
formatNoMatches: function() { return "No BOM items found"; },
clickToSelect: true,
showFooter: true,

View File

@ -18,6 +18,7 @@ migrate:
python3 InvenTree/manage.py migrate
python3 InvenTree/manage.py migrate --run-syncdb
python3 InvenTree/manage.py check
python3 InvenTree/manage.py collectstatic
# Install all required packages
install: