diff --git a/cookbook/migrations/0072_step_show_as_header.py b/cookbook/migrations/0072_step_show_as_header.py new file mode 100644 index 000000000..ca4c1603d --- /dev/null +++ b/cookbook/migrations/0072_step_show_as_header.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2020-07-02 10:00 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0071_auto_20200701_2048'), + ] + + operations = [ + migrations.AddField( + model_name='step', + name='show_as_header', + field=models.BooleanField(default=True), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index ec6913326..6b8ed5c0c 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -168,6 +168,7 @@ class Step(models.Model): ingredients = models.ManyToManyField(Ingredient, blank=True) time = models.IntegerField(default=0, blank=True) order = models.IntegerField(default=0) + show_as_header = models.BooleanField(default=True) class Meta: ordering = ['order', 'pk'] diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 02f83a6ad..037bc007d 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -116,7 +116,7 @@ class StepSerializer(WritableNestedModelSerializer): class Meta: model = Step - fields = '__all__' + fields = ('id', 'name', 'type', 'instruction', 'ingredients', 'time', 'order', 'show_as_header') class RecipeSerializer(WritableNestedModelSerializer): diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 33dc46c19..c175ba21b 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -109,11 +109,22 @@ + + + + - - {% trans 'View Recipe' %}
diff --git a/cookbook/templates/recipe_view.html b/cookbook/templates/recipe_view.html index 936dcb1b7..5cd7b048c 100644 --- a/cookbook/templates/recipe_view.html +++ b/cookbook/templates/recipe_view.html @@ -105,7 +105,7 @@
{% endif %} -
+
@@ -116,7 +116,8 @@
- +
@@ -124,80 +125,87 @@

- -