From a689b77cfbb5134f3b475cd869b1db6406a6d488 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 30 Oct 2021 13:18:11 +1100 Subject: [PATCH] More tweaks --- InvenTree/part/templates/part/bom.html | 17 -------- InvenTree/part/templates/part/detail.html | 26 ++++++++++++ InvenTree/stock/templates/stock/item.html | 42 ++++++++++++------- .../templates/js/translated/attachment.js | 8 +++- InvenTree/templates/js/translated/stock.js | 6 +-- 5 files changed, 61 insertions(+), 38 deletions(-) diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index 32be9140f1..f3591ba5a4 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -24,16 +24,6 @@
- - {% if roles.part.change %}
@@ -41,13 +31,6 @@
diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index e7c39aeece..f94c3d5f61 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -346,6 +346,32 @@

{% trans "Bill of Materials" %}

{% include "spacer.html" %}
+ + + +
+ + +
+ {% if roles.part.change %} + {% if user.is_staff %} + + {% endif %} + +
+
- {% if user.is_staff %} - - {% endif %} - -
@@ -128,13 +133,18 @@
-

{% trans "Installed Stock Items" %}

+
+

{% trans "Installed Stock Items" %}

+ {% include "spacer.html" %} +
+ +
+
-
diff --git a/InvenTree/templates/js/translated/attachment.js b/InvenTree/templates/js/translated/attachment.js index 88c73ed3e3..5ff5786588 100644 --- a/InvenTree/templates/js/translated/attachment.js +++ b/InvenTree/templates/js/translated/attachment.js @@ -27,7 +27,7 @@ function loadAttachmentTable(url, options) { return '{% trans "No attachments found" %}'; }, sortable: true, - search: false, + search: true, queryParams: options.filters || {}, onPostBody: function() { // Add callback for 'edit' button @@ -58,12 +58,16 @@ function loadAttachmentTable(url, options) { var fn = value.toLowerCase(); - if (fn.endsWith('.pdf')) { + if (fn.endsWith('.csv')) { + icon = 'fa-file-csv'; + } else if (fn.endsWith('.pdf')) { icon = 'fa-file-pdf'; } else if (fn.endsWith('.xls') || fn.endsWith('.xlsx')) { icon = 'fa-file-excel'; } else if (fn.endsWith('.doc') || fn.endsWith('.docx')) { icon = 'fa-file-word'; + } else if (fn.endsWith('.zip') || fn.endsWith('.7z')) { + icon = 'fa-file-archive'; } else { var images = ['.png', '.jpg', '.bmp', '.gif', '.svg', '.tif']; diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index 318d290305..ce351219af 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -453,14 +453,14 @@ function removeStockRow(e) { function passFailBadge(result) { if (result) { - return `{% trans "PASS" %}`; + return `{% trans "PASS" %}`; } else { - return `{% trans "FAIL" %}`; + return `{% trans "FAIL" %}`; } } function noResultBadge() { - return `{% trans "NO RESULT" %}`; + return `{% trans "NO RESULT" %}`; } function formatDate(row) {