hidden field for movement
This commit is contained in:
@ -35,9 +35,11 @@ class ExternalRecipeForm(forms.ModelForm):
|
||||
|
||||
|
||||
class InternalRecipeForm(forms.ModelForm):
|
||||
table_pos = forms.CharField(show_hidden_initial=True, required=False, widget=forms.HiddenInput())
|
||||
|
||||
class Meta:
|
||||
model = Recipe
|
||||
fields = ('name', 'instructions', 'time', 'keywords')
|
||||
fields = ('name', 'table_pos', 'instructions', 'time', 'keywords')
|
||||
|
||||
labels = {
|
||||
'name': _('Name'),
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
<form action="." method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|crispy }}
|
||||
<div id="ingredients-table"></div>
|
||||
<br>
|
||||
@ -84,6 +85,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
// load initial value
|
||||
$('#ingredients_data_input').val(JSON.stringify(data))
|
||||
|
||||
document.getElementById("new_empty").addEventListener("click", function () {
|
||||
data.push({
|
||||
|
Reference in New Issue
Block a user