From 1a07ae0936215f720a2f1d726f78d5a7c96c77ce Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 16 Dec 2020 15:48:41 +1100 Subject: [PATCH 1/2] Render link rather than just text --- InvenTree/templates/js/part.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/part.js b/InvenTree/templates/js/part.js index 8c00625dfc..d27c32024a 100644 --- a/InvenTree/templates/js/part.js +++ b/InvenTree/templates/js/part.js @@ -608,7 +608,9 @@ function loadPartTestTemplateTable(table, options) { return html; } else { - return '{% trans "This test is defined for a parent part" %}'; + var text = '{% trans "This test is defined for a parent part" %}'; + + return renderLink(text, `/part/${row.part}/tests/`); } } } From 6ef4325eac7e7dc34bc1822543843c8ab6c22a8d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 16 Dec 2020 15:55:42 +1100 Subject: [PATCH 2/2] Javascript formatting --- InvenTree/templates/js/part.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/InvenTree/templates/js/part.js b/InvenTree/templates/js/part.js index d27c32024a..e0f6a491f6 100644 --- a/InvenTree/templates/js/part.js +++ b/InvenTree/templates/js/part.js @@ -202,7 +202,7 @@ function loadPartVariantTable(table, partId, options={}) { showColumns: true, original: params, queryParams: filters, - formatNoMatches: function() { return "{% trans "No variants found" %}"; }, + formatNoMatches: function() { return '{% trans "No variants found" %}'; }, columns: cols, treeEnable: true, rootParentId: partId, @@ -249,7 +249,7 @@ function loadParametricPartTable(table, options={}) { if (header === 'part') { columns.push({ field: header, - title: '{% trans 'Part' %}', + title: '{% trans "Part" %}', sortable: true, sortName: 'name', formatter: function(value, row, index, field) { @@ -268,7 +268,7 @@ function loadParametricPartTable(table, options={}) { } else if (header === 'description') { columns.push({ field: header, - title: '{% trans 'Description' %}', + title: '{% trans "Description" %}', sortable: true, }); } else { @@ -288,7 +288,7 @@ function loadParametricPartTable(table, options={}) { queryParams: table_headers, groupBy: false, name: options.name || 'parametric', - formatNoMatches: function() { return "{% trans "No parts found" %}"; }, + formatNoMatches: function() { return '{% trans "No parts found" %}'; }, columns: columns, showColumns: true, data: table_data, @@ -454,7 +454,7 @@ function loadPartTable(table, url, options={}) { groupBy: false, name: options.name || 'part', original: params, - formatNoMatches: function() { return "{% trans "No parts found" %}"; }, + formatNoMatches: function() { return '{% trans "No parts found" %}'; }, columns: columns, showColumns: true, }); @@ -564,12 +564,12 @@ function loadPartTestTemplateTable(table, options) { }, { field: 'test_name', - title: "{% trans "Test Name" %}", + title: '{% trans "Test Name" %}', sortable: true, }, { field: 'description', - title: "{% trans "Description" %}", + title: '{% trans "Description" %}', }, { field: 'required', @@ -581,14 +581,14 @@ function loadPartTestTemplateTable(table, options) { }, { field: 'requires_value', - title: "{% trans "Requires Value" %}", + title: '{% trans "Requires Value" %}', formatter: function(value) { return yesNoLabel(value); } }, { field: 'requires_attachment', - title: "{% trans "Requires Attachment" %}", + title: '{% trans "Requires Attachment" %}', formatter: function(value) { return yesNoLabel(value); }