2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +00:00

Add option to display "starred categories" on the index page

This commit is contained in:
Oliver
2021-11-03 23:29:36 +11:00
parent 7567b8dd63
commit 193d6b334c
5 changed files with 28 additions and 5 deletions

View File

@ -420,12 +420,12 @@ function toggleStar(options) {
}
function partStockLabel(part) {
function partStockLabel(part, options={}) {
if (part.in_stock) {
return `<span class='badge rounded-pill bg-success'>{% trans "Stock" %}: ${part.in_stock}</span>`;
return `<span class='badge rounded-pill bg-success ${options.classes}'>{% trans "Stock" %}: ${part.in_stock}</span>`;
} else {
return `<span class='badge rounded-pill bg-danger'>{% trans "No Stock" %}</span>`;
return `<span class='badge rounded-pill bg-danger ${options.classes}'>{% trans "No Stock" %}</span>`;
}
}