Moved 'complete build' button to the build detail page

This commit is contained in:
Oliver Walters 2019-05-10 08:44:07 +10:00
parent 932c07287b
commit 66b729d579
2 changed files with 15 additions and 12 deletions

View File

@ -20,7 +20,6 @@ InvenTree | Allocate Parts
<div class='btn-group' style='float: right;'>
<button class='btn btn-primary' type='button' title='Automatic allocation' id='auto-allocate-build'>Auto Allocate</button>
<button class='btn btn-warning' type='button' title='Unallocate build stock' id='unallocate-build'>Unallocate</button>
<button class='btn btn-success' type='button' title='Complete build' id='complete-build'>Complete Build</button>
</div>
</div>
</div>
@ -56,16 +55,6 @@ InvenTree | Allocate Parts
{% endfor %}
$("#complete-build").on('click', function() {
launchModalForm(
"{% url 'build-complete' build.id %}",
{
reload: true,
submit_text: "Complete Build",
}
);
});
$("#auto-allocate-build").on('click', function() {
launchModalForm(
"{% url 'build-auto-allocate' build.id %}",

View File

@ -17,12 +17,15 @@ InvenTree | Build - {{ build }}
<h3>
<div style='float: right;'>
<div class="dropdown" style="float: right;">
<a href="{% url 'build-allocate' build.id %}">
<button class='btn btn-info' type='button' title='Allocate Parts' id='build-allocate'>Allocate Parts</button>
</a>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href='#' id='build-edit' title='Edit build'>Edit build</a></li>
{% if build.is_active %}
<li><a href="{% url 'build-allocate' build.id %}" title='Allocate parts'>Allocate Parts</a></li>
<li><a href='#' id='build-complete' title='Complete Build'>Complete Build</a></li>
<li><a href='#' id='build-cancel' title='Cancel build'>Cancel build</a></li>
{% endif %}
</ul>
@ -127,4 +130,15 @@ InvenTree | Build - {{ build }}
submit_text: "Cancel Build",
});
});
$("#build-complete").on('click', function() {
launchModalForm(
"{% url 'build-complete' build.id %}",
{
reload: true,
submit_text: "Complete Build",
}
);
});
{% endblock %}