manual form render order

This commit is contained in:
vabene1111
2019-11-19 21:02:33 +01:00
parent 8281bb52e8
commit f8d0724daf
2 changed files with 16 additions and 12 deletions

View File

@@ -20,12 +20,18 @@
<form action="." method="post">
{% csrf_token %}
{{ form|crispy }}
<div id="ingredients-table"></div>
<br>
<div class="table-controls">
<button class="btn" id="new_empty" type="button"><i class="fas fa-plus-circle"></i></button>
</div>
{% for field in form %}
<div class="fieldWrapper">
{{ field|as_crispy_field }}
</div>
{% if field.name == 'name' %}
<div id="ingredients-table"></div>
<br>
<div class="table-controls">
<button class="btn" id="new_empty" type="button"><i class="fas fa-plus-circle"></i></button>
</div>
{% endif %}
{% endfor %}
<input type="hidden" id="ingredients_data_input" name="ingredients">
<hr>
@@ -45,9 +51,9 @@
var ingredients = {{ ingredients|safe }}
ingredients.forEach(function (cur, i) {
cur.delete = false
})
ingredients.forEach(function (cur, i) {
cur.delete = false
})
var data = ingredients