This commit is contained in:
Oliver Walters 2020-10-29 09:45:42 +11:00
parent a263d2fdcd
commit 05ce17f8df
3 changed files with 11 additions and 4 deletions

View File

@ -5,6 +5,11 @@
{{ block.super }}
{% trans "Are you sure you wish to unallocate all stock for this build?" %}
<div class='alert alert-block alert-danger'>
{% trans "Are you sure you wish to unallocate all stock for this build?" %}
<br>
{% trans "All incomplete stock allocations will be removed from the build" %}
</div>
{% endblock %}

View File

@ -887,10 +887,12 @@ class BuildItemEdit(AjaxUpdateView):
form = super(BuildItemEdit, self).get_form()
# Hide fields which we do not wish the user to edit
for field in ['build', 'stock_item', 'install_into']:
for field in ['build', 'stock_item']:
if form[field].value():
form.fields[field].widget = HiddenInput()
form.fields['install_into'].widget = HiddenInput()
return form

View File

@ -568,8 +568,8 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
var progressA = parseFloat(aA) / qA;
var progressB = parseFloat(aB) / qB;
// Handle the case where both are at 100%
if (progressA == 1.0 && progressB == 1.0) {
// Handle the case where both ratios are equal
if (progressA == progressB) {
return (qA < qB) ? 1 : -1;
}