Improvements for stock item test result table

This commit is contained in:
Oliver 2021-10-30 13:31:13 +11:00
parent 79434bb4e0
commit 29c913b553

View File

@ -468,11 +468,7 @@ function formatDate(row) {
var html = row.date;
if (row.user_detail) {
html += `<span class='badge'>${row.user_detail.username}</span>`;
}
if (row.attachment) {
html += `<a href='${row.attachment}'><span class='fas fa-file-alt float-right'></span></a>`;
html += `<span class='badge badge-right rounded-pill bg-secondary'>${row.user_detail.username}</span>`;
}
return html;
@ -553,6 +549,15 @@ function loadStockTestResultsTable(table, options) {
{
field: 'value',
title: '{% trans "Value" %}',
formatter: function(value, row) {
var html = value;
if (row.attachment) {
html += `<a href='${row.attachment}'><span class='fas fa-file-alt float-right'></span></a>`;
}
return html;
}
},
{
field: 'notes',