From 34c097c46ac846b699a172ef358f71edfce6007b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 30 Mar 2020 16:48:14 +1100 Subject: [PATCH] Display proper build status label --- InvenTree/part/templates/part/build.html | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/InvenTree/part/templates/part/build.html b/InvenTree/part/templates/part/build.html index 6f44aded08..b532ff73bf 100644 --- a/InvenTree/part/templates/part/build.html +++ b/InvenTree/part/templates/part/build.html @@ -57,6 +57,31 @@ { field: 'status', title: 'Status', + formatter: function(value, row, index, field) { + + var color = ''; + + switch (value) { + case 10: // Pending + color = 'label-info'; + break; + case 20: // Allocated + color = 'label-primary'; + break; + case 30: // Cancelled + color = 'label-danger'; + break; + case 40: // Complete + color = 'label-success'; + break; + default: + break; + } + + var html = "" + row.status_text + ""; + + return html; + } }, { field: 'completion_date',