mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Filter parts by 'is_assembly'
Also greatly improve rendering of the Part table
This commit is contained in:
parent
e1c6ad7761
commit
0f90e8f522
@ -125,6 +125,8 @@
|
||||
|
||||
.label-right {
|
||||
float: right;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/* Bootstrap table overrides */
|
||||
|
@ -140,11 +140,15 @@ function loadPartTable(table, url, options={}) {
|
||||
var display = imageHoverIcon(row.thumbnail) + renderLink(name, '/part/' + row.pk + '/');
|
||||
|
||||
if (row.is_template) {
|
||||
display = display + "<span class='label label-info' style='float: right;'>TEMPLATE</span>";
|
||||
display = display + `<span class='fas fa-clone label-right' title='Template part'></span>`;
|
||||
}
|
||||
|
||||
if (row.assembly) {
|
||||
display = display + `<span class='fas fa-tools label-right' title='Assembled part'></span>`;
|
||||
}
|
||||
|
||||
if (!row.active) {
|
||||
display = display + "<span class='label label-warning' style='float: right;'>INACTIVE</span>";
|
||||
display = display + `<span class='fas fa-times label-right' title='Inactive part'></span>`;
|
||||
}
|
||||
return display;
|
||||
}
|
||||
@ -173,7 +177,7 @@ function loadPartTable(table, url, options={}) {
|
||||
return renderLink(row.category__name, "/part/category/" + row.category + "/");
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
return 'No category';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -80,7 +80,11 @@ function getAvailableTableFilters(tableKey) {
|
||||
low_stock: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Low stock" %}',
|
||||
}
|
||||
},
|
||||
assembly: {
|
||||
type: 'bool',
|
||||
title: '{% trans "Assembly" %}',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user