mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bug fix for units text in part label (#4470)
- Display even if no other badges are rendered - Fixes https://github.com/inventree/InvenTree/issues/4467
This commit is contained in:
parent
2dfea9b825
commit
beac7d15df
@ -679,19 +679,19 @@ function partStockLabel(part, options={}) {
|
|||||||
bg_class = 'bg-success';
|
bg_class = 'bg-success';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display units next to stock badge
|
let output = '';
|
||||||
let unit_badge = '';
|
|
||||||
|
|
||||||
|
// Display units next to stock badge
|
||||||
if (units && !options.no_units) {
|
if (units && !options.no_units) {
|
||||||
unit_badge = `<span class='badge rounded-pill text-muted bg-muted ${classes}'>{% trans "Unit" %}: ${units}</span> `;
|
output += `<span class='badge rounded-pill text-muted bg-muted ${classes}'>{% trans "Unit" %}: ${units}</span> `;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elements.length > 0) {
|
if (elements.length > 0) {
|
||||||
let text = elements.join(' | ');
|
let text = elements.join(' | ');
|
||||||
return `${unit_badge}<span class='badge rounded-pill ${bg_class} ${classes}'>${text}</span>`;
|
output += `<span class='badge rounded-pill ${bg_class} ${classes}'>${text}</span>`;
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user