mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Add option to display "starred categories" on the index page
This commit is contained in:
@ -169,7 +169,12 @@ function inventreeDocReady() {
|
||||
html += '</span>';
|
||||
|
||||
if (user_settings.SEARCH_SHOW_STOCK_LEVELS) {
|
||||
html += partStockLabel(item.data);
|
||||
html += partStockLabel(
|
||||
item.data,
|
||||
{
|
||||
classes: 'badge-right',
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
html += '</a>';
|
||||
|
@ -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>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user