diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js index aeaa1d933d..f1c749320f 100644 --- a/InvenTree/templates/js/translated/bom.js +++ b/InvenTree/templates/js/translated/bom.js @@ -78,7 +78,7 @@ function constructBomUploadTable(data, options={}) { var buttons = `
`; - // buttons += makeIconButton('fa-file-alt', 'button-row-data', idx, '{% trans "Display row data" %}'); + buttons += makeIconButton('fa-info-circle', 'button-row-data', idx, '{% trans "Display row data" %}'); buttons += makeIconButton('fa-times icon-red', 'button-row-remove', idx, '{% trans "Remove row" %}'); buttons += `
`; @@ -129,6 +129,29 @@ function constructBomUploadTable(data, options={}) { $(`#button-row-remove-${idx}`).click(function() { $(`#items_${idx}`).remove(); }); + + // Add callback for "show data" button + $(`#button-row-data-${idx}`).click(function() { + + var modal = createNewModal({ + title: '{% trans "Row Data" %}', + cancelText: '{% trans "Close" %}', + hideSubmitButton: true + }); + + // Prettify the original import data + var pretty = JSON.stringify(row, undefined, 4); + + var html = ` +
+
${pretty}
+
`; + + modalSetContent(modal, html); + + $(modal).modal('show'); + + }); } // Request API endpoint options diff --git a/InvenTree/templates/js/translated/forms.js b/InvenTree/templates/js/translated/forms.js index 394c18a568..a93ceb42c7 100644 --- a/InvenTree/templates/js/translated/forms.js +++ b/InvenTree/templates/js/translated/forms.js @@ -1953,7 +1953,13 @@ function constructField(name, parameters, options) { html += parameters.before; } - html += `
`; + var hover_title = ''; + + if (parameters.help_text) { + hover_title = ` title='${parameters.help_text}'`; + } + + html += `
`; // Add a label if (!options.hideLabels) {