diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index 312accb18f..ae6ea6d4d3 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -221,7 +221,10 @@ src="{% static 'img/blank_image.png' %}" {% if build.incomplete_count > 0 %} showAlertDialog( '{% trans "Incomplete Outputs" %}', - '{% trans "Build Order cannot be completed as incomplete build outputs remain" %}' + '{% trans "Build Order cannot be completed as incomplete build outputs remain" %}', + { + alert_style: 'danger', + } ); {% else %} diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index ebb37fa61c..43f8fd1110 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -133,8 +133,11 @@ function completeBuildOrder(build_id, options={}) { var html = ''; - if (options.can_complete) { - + if (options.allocated && options.completed) { + html += ` +
+ {% trans "Build order is ready to be completed" %} +
`; } else { html += `
diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index c01bb6c34a..e8697ac656 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -555,13 +555,18 @@ function renderErrorMessage(xhr) { } -function showAlertDialog(title, content) { +function showAlertDialog(title, content, options={}) { /* Display a modal dialog message box. * * title - Title text * content - HTML content of the dialog window */ + if (options.alert_style) { + // Wrap content in an alert block + content = `
${content}
`; + } + var modal = createNewModal({ title: title,