mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Improve status code label rendering
This commit is contained in:
@ -5,7 +5,7 @@ var {{ label }}Codes = {
|
||||
{% for opt in options %}'{{ opt.key }}': {
|
||||
key: '{{ opt.key }}',
|
||||
value: '{{ opt.value }}',{% if opt.color %}
|
||||
color: '{{ opt.color }}',{% endif %}
|
||||
label: 'label-{{ opt.color }}',{% endif %}
|
||||
},{% endfor %}
|
||||
};
|
||||
|
||||
@ -25,7 +25,7 @@ function {{ label }}StatusDisplay(key) {
|
||||
}
|
||||
|
||||
// Select the label color
|
||||
var color = {{ label }}Codes[key].color ?? '#AAA';
|
||||
var label = {{ label }}Codes[key].label ?? '';
|
||||
|
||||
return `<span class='label' style='background: ${color};'>${value}</span>`;
|
||||
return `<span class='label ${label}'>${value}</span>`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user