From 82fe497787f5d7364423cf292c8076f5f4f7e478 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 17 May 2020 00:04:45 +1000 Subject: [PATCH] Add buttons to edit / delete a Test result - Don't do nuthin yet! --- InvenTree/build/templates/build/allocate.html | 6 +++--- .../templates/order/purchase_order_detail.html | 2 +- .../order/templates/order/sales_order_detail.html | 10 +++++----- InvenTree/templates/js/stock.html | 13 +++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/InvenTree/build/templates/build/allocate.html b/InvenTree/build/templates/build/allocate.html index b90508a7d8..61cccae1bf 100644 --- a/InvenTree/build/templates/build/allocate.html +++ b/InvenTree/build/templates/build/allocate.html @@ -198,8 +198,8 @@ InvenTree | Allocate Parts var html = `
`; {% if build.status == BuildStatus.PENDING %} - html += makeIconButton('fa-edit', 'button-allocation-edit', pk, '{% trans "Edit stock allocation" %}'); - html += makeIconButton('fa-trash-alt', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); + html += makeIconButton('fa-edit icon-blue', 'button-allocation-edit', pk, '{% trans "Edit stock allocation" %}'); + html += makeIconButton('fa-trash-alt icon-red', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); {% endif %} html += `
`; @@ -389,7 +389,7 @@ InvenTree | Allocate Parts html += makeIconButton('fa-tools', 'button-build', pk, '{% trans "Build parts" %}'); } - html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate stock" %}'); + html += makeIconButton('fa-plus icon-green', 'button-add', pk, '{% trans "Allocate stock" %}'); {% endif %} html += ''; diff --git a/InvenTree/order/templates/order/purchase_order_detail.html b/InvenTree/order/templates/order/purchase_order_detail.html index eb796b2ec1..de066500b2 100644 --- a/InvenTree/order/templates/order/purchase_order_detail.html +++ b/InvenTree/order/templates/order/purchase_order_detail.html @@ -208,7 +208,7 @@ $("#po-table").inventreeTable({ var pk = row.pk; {% if order.status == PurchaseOrderStatus.PENDING %} - html += makeIconButton('fa-edit', 'button-line-edit', pk, '{% trans "Edit line item" %}'); + html += makeIconButton('fa-edit icon-blue', 'button-line-edit', pk, '{% trans "Edit line item" %}'); html += makeIconButton('fa-trash-alt icon-red', 'button-line-delete', pk, '{% trans "Delete line item" %}'); {% endif %} diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 0ca63882b2..75c5fc3d7b 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -89,8 +89,8 @@ function showAllocationSubTable(index, row, element) { var pk = row.pk; {% if order.status == SalesOrderStatus.PENDING %} - html += makeIconButton('fa-edit', 'button-allocation-edit', pk, '{% trans "Edit stock allocation" %}'); - html += makeIconButton('fa-trash-alt', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); + html += makeIconButton('fa-edit icon-blue', 'button-allocation-edit', pk, '{% trans "Edit stock allocation" %}'); + html += makeIconButton('fa-trash-alt icon-red', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); {% endif %} html += ""; @@ -274,11 +274,11 @@ $("#so-lines-table").inventreeTable({ html += makeIconButton('fa-tools', 'button-build', row.part, '{% trans "Build parts" %}'); } - html += makeIconButton('fa-plus', 'button-add', pk, '{% trans "Allocate parts" %}'); + html += makeIconButton('fa-plus icon-green', 'button-add', pk, '{% trans "Allocate parts" %}'); } - html += makeIconButton('fa-edit', 'button-edit', pk, '{% trans "Edit line item" %}'); - html += makeIconButton('fa-trash-alt', 'button-delete', pk, '{% trans "Delete line item " %}'); + html += makeIconButton('fa-edit icon-blue', 'button-edit', pk, '{% trans "Edit line item" %}'); + html += makeIconButton('fa-trash-alt icon-red', 'button-delete', pk, '{% trans "Delete line item " %}'); html += ``; diff --git a/InvenTree/templates/js/stock.html b/InvenTree/templates/js/stock.html index 48d6cae6e0..af65782bef 100644 --- a/InvenTree/templates/js/stock.html +++ b/InvenTree/templates/js/stock.html @@ -116,6 +116,19 @@ function loadStockTestResultsTable(table, options) { }, { field: 'buttons', + formatter: function(value, row) { + + var pk = row.pk; + + var html = `
`; + + html += makeIconButton('fa-edit icon-blue', 'button-test-edit', pk, '{% trans "Edit test result" %}'); + html += makeIconButton('fa-trash-alt icon-red', 'button-test-delete', pk, '{% trans "Delete test result" %}'); + + html += `
`; + + return html; + } }, ] });