diff --git a/cookbook/forms.py b/cookbook/forms.py index 1990047ca..b5dca7256 100644 --- a/cookbook/forms.py +++ b/cookbook/forms.py @@ -35,11 +35,9 @@ 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', 'table_pos', 'instructions', 'time', 'keywords') + fields = ('name', 'instructions', 'time', 'keywords') labels = { 'name': _('Name'), diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 3f747f0ce..18b1cb63a 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -20,12 +20,18 @@
{% csrf_token %} - {{ form|crispy }} -
-
-
- -
+ {% for field in form %} +
+ {{ field|as_crispy_field }} +
+ {% if field.name == 'name' %} +
+
+
+ +
+ {% endif %} + {% endfor %}
@@ -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