mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-18 10:18:18 +00:00
JS cleanup
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
loadSellPricingChart,
|
||||
loadSimplePartTable,
|
||||
loadStockPricingChart,
|
||||
partStockLabel,
|
||||
toggleStar,
|
||||
*/
|
||||
|
||||
@@ -409,6 +410,18 @@ function toggleStar(options) {
|
||||
}
|
||||
|
||||
|
||||
function partStockLabel(part, options={}) {
|
||||
|
||||
var label_class = options.label_class || 'label-form';
|
||||
|
||||
if (part.in_stock) {
|
||||
return `<span class='label ${label_class} label-green'>{% trans "Stock" %}: ${part.in_stock}</span>`;
|
||||
} else {
|
||||
return `<span class='label ${label_class} label-red'>{% trans "No Stock" %}</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function makePartIcons(part) {
|
||||
/* Render a set of icons for the given part.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user