mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 15:15:42 +00:00 
			
		
		
		
	Fix messaging in build complete dialg
This commit is contained in:
		@@ -221,7 +221,10 @@ src="{% static 'img/blank_image.png' %}"
 | 
				
			|||||||
        {% if build.incomplete_count > 0 %}
 | 
					        {% if build.incomplete_count > 0 %}
 | 
				
			||||||
        showAlertDialog(
 | 
					        showAlertDialog(
 | 
				
			||||||
            '{% trans "Incomplete Outputs" %}',
 | 
					            '{% 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 %}
 | 
					        {% else %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -133,8 +133,11 @@ function completeBuildOrder(build_id, options={}) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    var html = '';
 | 
					    var html = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (options.can_complete) {
 | 
					    if (options.allocated && options.completed) {
 | 
				
			||||||
 | 
					        html += `
 | 
				
			||||||
 | 
					        <div class='alert alert-block alert-success'>
 | 
				
			||||||
 | 
					        {% trans "Build order is ready to be completed" %}
 | 
				
			||||||
 | 
					        </div>`;
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        html += `
 | 
					        html += `
 | 
				
			||||||
        <div class='alert alert-block alert-danger'>
 | 
					        <div class='alert alert-block alert-danger'>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -555,13 +555,18 @@ function renderErrorMessage(xhr) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function showAlertDialog(title, content) {
 | 
					function showAlertDialog(title, content, options={}) {
 | 
				
			||||||
    /* Display a modal dialog message box.
 | 
					    /* Display a modal dialog message box.
 | 
				
			||||||
     * 
 | 
					     * 
 | 
				
			||||||
     * title - Title text 
 | 
					     * title - Title text 
 | 
				
			||||||
     * content - HTML content of the dialog window
 | 
					     * content - HTML content of the dialog window
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (options.alert_style) {
 | 
				
			||||||
 | 
					        // Wrap content in an alert block
 | 
				
			||||||
 | 
					        content = `<div class='alert alert-block alert-${options.alert_style}'>${content}</div>`;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var modal = createNewModal({
 | 
					    var modal = createNewModal({
 | 
				
			||||||
        title: title,
 | 
					        title: title,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user