diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index a2ea29646..dbe896e68 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -7,16 +7,16 @@ TextBlock, ) from wagtail.embeds.blocks import EmbedBlock -from wagtail.images.blocks import ImageChooserBlock +from wagtail.images.blocks import ImageBlock -class ImageBlock(StructBlock): +class CaptionedImageBlock(StructBlock): """ Custom `StructBlock` for utilizing images with associated caption and attribution data """ - image = ImageChooserBlock(required=True) + image = ImageBlock(required=True) caption = CharBlock(required=False) attribution = CharBlock(required=False) diff --git a/bakerydemo/base/migrations/0021_alter_footertext_locale_alter_formpage_body_and_more.py b/bakerydemo/base/migrations/0021_alter_footertext_locale_alter_formpage_body_and_more.py new file mode 100644 index 000000000..1c7c601a9 --- /dev/null +++ b/bakerydemo/base/migrations/0021_alter_footertext_locale_alter_formpage_body_and_more.py @@ -0,0 +1,369 @@ +# Generated by Django 4.2.13 on 2024-07-26 09:59 + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("wagtailcore", "0094_alter_page_locale"), + ("base", "0020_alter_footertext_options"), + ] + + operations = [ + migrations.AlterField( + model_name="footertext", + name="locale", + field=models.ForeignKey( + editable=False, + on_delete=django.db.models.deletion.PROTECT, + related_name="+", + to="wagtailcore.locale", + verbose_name="locale", + ), + ), + migrations.AlterField( + model_name="formpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + ), + ), + migrations.AlterField( + model_name="gallerypage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Page body", + ), + ), + migrations.AlterField( + model_name="homepage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Home content block", + ), + ), + migrations.AlterField( + model_name="standardpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/blog/migrations/0007_alter_blogpage_body.py b/bakerydemo/blog/migrations/0007_alter_blogpage_body.py new file mode 100644 index 000000000..a833a039e --- /dev/null +++ b/bakerydemo/blog/migrations/0007_alter_blogpage_body.py @@ -0,0 +1,100 @@ +# Generated by Django 4.2.13 on 2024-07-26 09:59 + +from django.db import migrations +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("blog", "0006_rename_blogpeoplerelationship_person"), + ] + + operations = [ + migrations.AlterField( + model_name="blogpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/breads/migrations/0008_alter_breadpage_body.py b/bakerydemo/breads/migrations/0008_alter_breadpage_body.py new file mode 100644 index 000000000..4ec07c755 --- /dev/null +++ b/bakerydemo/breads/migrations/0008_alter_breadpage_body.py @@ -0,0 +1,100 @@ +# Generated by Django 4.2.13 on 2024-07-26 09:59 + +from django.db import migrations +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("breads", "0007_alter_breadingredient_options_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="breadpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/locations/migrations/0007_alter_locationpage_body.py b/bakerydemo/locations/migrations/0007_alter_locationpage_body.py new file mode 100644 index 000000000..6aaa5df1c --- /dev/null +++ b/bakerydemo/locations/migrations/0007_alter_locationpage_body.py @@ -0,0 +1,100 @@ +# Generated by Django 4.2.13 on 2024-07-26 09:59 + +from django.db import migrations +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("locations", "0006_alter_locationoperatinghours_day"), + ] + + operations = [ + migrations.AlterField( + model_name="locationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + verbose_name="Page body", + ), + ), + ] diff --git a/bakerydemo/recipes/blocks.py b/bakerydemo/recipes/blocks.py index 4ec0e77e8..ecd014edf 100644 --- a/bakerydemo/recipes/blocks.py +++ b/bakerydemo/recipes/blocks.py @@ -1,74 +1,73 @@ -from django import forms -from wagtail.blocks import ( - CharBlock, - ChoiceBlock, - FloatBlock, - ListBlock, - RichTextBlock, - StreamBlock, - StructBlock, -) -from wagtail.contrib.table_block.blocks import TableBlock -from wagtail.contrib.typed_table_block.blocks import TypedTableBlock -from wagtail.embeds.blocks import EmbedBlock -from wagtail.images.blocks import ImageChooserBlock - -from bakerydemo.base.blocks import BlockQuote, HeadingBlock, ImageBlock - - -class RecipeStepBlock(StructBlock): - text = RichTextBlock(features=["bold", "italic", "link"]) - difficulty = ChoiceBlock( - widget=forms.RadioSelect, - choices=[("S", "Small"), ("M", "Medium"), ("L", "Large")], - default="S", - ) - - class Meta: - template = "blocks/recipe_step_block.html" - icon = "tick" - - -class RecipeStreamBlock(StreamBlock): - """ - Define the custom blocks that `StreamField` will utilize - """ - - heading_block = HeadingBlock(group="Content") - paragraph_block = RichTextBlock( - icon="pilcrow", template="blocks/paragraph_block.html", group="Content" - ) - block_quote = BlockQuote(group="Content") - table_block = TableBlock(group="Content") - typed_table_block = TypedTableBlock( - [ - ("text", CharBlock()), - ("numeric", FloatBlock()), - ("rich_text", RichTextBlock()), - ("image", ImageChooserBlock()), - ], - group="Content", - ) - - image_block = ImageBlock(group="Media") - embed_block = EmbedBlock( - help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", - icon="media", - template="blocks/embed_block.html", - group="Media", - ) - - ingredients_list = ListBlock( - RichTextBlock(features=["bold", "italic", "link"]), - min_num=2, - max_num=10, - icon="list-ol", - group="Cooking", - ) - steps_list = ListBlock( - RecipeStepBlock(), - min_num=2, - max_num=10, - icon="tasks", - group="Cooking", - ) +from django import forms +from wagtail.blocks import ( + CharBlock, + ChoiceBlock, + FloatBlock, + ListBlock, + RichTextBlock, + StreamBlock, + StructBlock, +) +from wagtail.contrib.table_block.blocks import TableBlock +from wagtail.contrib.typed_table_block.blocks import TypedTableBlock +from wagtail.embeds.blocks import EmbedBlock + +from bakerydemo.base.blocks import BlockQuote, CaptionedImageBlock, HeadingBlock + + +class RecipeStepBlock(StructBlock): + text = RichTextBlock(features=["bold", "italic", "link"]) + difficulty = ChoiceBlock( + widget=forms.RadioSelect, + choices=[("S", "Small"), ("M", "Medium"), ("L", "Large")], + default="S", + ) + + class Meta: + template = "blocks/recipe_step_block.html" + icon = "tick" + + +class RecipeStreamBlock(StreamBlock): + """ + Define the custom blocks that `StreamField` will utilize + """ + + heading_block = HeadingBlock(group="Content") + paragraph_block = RichTextBlock( + icon="pilcrow", template="blocks/paragraph_block.html", group="Content" + ) + block_quote = BlockQuote(group="Content") + table_block = TableBlock(group="Content") + typed_table_block = TypedTableBlock( + [ + ("text", CharBlock()), + ("numeric", FloatBlock()), + ("rich_text", RichTextBlock()), + ("image", CaptionedImageBlock()), + ], + group="Content", + ) + + image_block = CaptionedImageBlock(group="Media") + embed_block = EmbedBlock( + help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + icon="media", + template="blocks/embed_block.html", + group="Media", + ) + + ingredients_list = ListBlock( + RichTextBlock(features=["bold", "italic", "link"]), + min_num=2, + max_num=10, + icon="list-ol", + group="Cooking", + ) + steps_list = ListBlock( + RecipeStepBlock(), + min_num=2, + max_num=10, + icon="tasks", + group="Cooking", + ) diff --git a/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory_alter_recipepage_body.py b/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory_alter_recipepage_body.py new file mode 100644 index 000000000..3eaeaea99 --- /dev/null +++ b/bakerydemo/recipes/migrations/0002_alter_recipepage_backstory_alter_recipepage_body.py @@ -0,0 +1,260 @@ +# Generated by Django 4.2.13 on 2024-07-26 09:59 + +from django.db import migrations +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("recipes", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="recipepage", + name="backstory", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("image_block", 7), + ("block_quote", 10), + ("embed_block", 11), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + {"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, + ), + 4: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 5: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 6: ("wagtail.blocks.CharBlock", (), {"required": False}), + 7: ( + "wagtail.blocks.StructBlock", + [[("image", 4), ("decorative", 5), ("alt_text", 6)]], + {}, + ), + 8: ("wagtail.blocks.TextBlock", (), {}), + 9: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 10: ( + "wagtail.blocks.StructBlock", + [[("text", 8), ("attribute_name", 9)]], + {}, + ), + 11: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + }, + help_text="Use only a minimum number of headings and large blocks.", + ), + ), + migrations.AlterField( + model_name="recipepage", + name="body", + field=wagtail.fields.StreamField( + [ + ("heading_block", 2), + ("paragraph_block", 3), + ("block_quote", 6), + ("table_block", 7), + ("typed_table_block", 16), + ("image_block", 17), + ("embed_block", 18), + ("ingredients_list", 20), + ("steps_list", 23), + ], + blank=True, + block_lookup={ + 0: ( + "wagtail.blocks.CharBlock", + (), + {"form_classname": "title", "required": True}, + ), + 1: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "blank": True, + "choices": [ + ("", "Select a header size"), + ("h2", "H2"), + ("h3", "H3"), + ("h4", "H4"), + ], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.StructBlock", + [[("heading_text", 0), ("size", 1)]], + {"group": "Content"}, + ), + 3: ( + "wagtail.blocks.RichTextBlock", + (), + { + "group": "Content", + "icon": "pilcrow", + "template": "blocks/paragraph_block.html", + }, + ), + 4: ("wagtail.blocks.TextBlock", (), {}), + 5: ( + "wagtail.blocks.CharBlock", + (), + {"blank": True, "label": "e.g. Mary Berry", "required": False}, + ), + 6: ( + "wagtail.blocks.StructBlock", + [[("text", 4), ("attribute_name", 5)]], + {"group": "Content"}, + ), + 7: ( + "wagtail.contrib.table_block.blocks.TableBlock", + (), + {"group": "Content"}, + ), + 8: ("wagtail.blocks.CharBlock", (), {}), + 9: ("wagtail.blocks.FloatBlock", (), {}), + 10: ("wagtail.blocks.RichTextBlock", (), {}), + 11: ( + "wagtail.images.blocks.ImageChooserBlock", + (), + {"required": True}, + ), + 12: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "label": "Image is decorative", + "required": False, + }, + ), + 13: ("wagtail.blocks.CharBlock", (), {"required": False}), + 14: ( + "wagtail.blocks.StructBlock", + [[("image", 11), ("decorative", 12), ("alt_text", 13)]], + {"required": True}, + ), + 15: ( + "wagtail.blocks.StructBlock", + [[("image", 14), ("caption", 13), ("attribution", 13)]], + {}, + ), + 16: ( + "wagtail.contrib.typed_table_block.blocks.TypedTableBlock", + [ + [ + ("text", 8), + ("numeric", 9), + ("rich_text", 10), + ("image", 15), + ] + ], + {"group": "Content"}, + ), + 17: ( + "wagtail.blocks.StructBlock", + [[("image", 14), ("caption", 13), ("attribution", 13)]], + {"group": "Media"}, + ), + 18: ( + "wagtail.embeds.blocks.EmbedBlock", + (), + { + "group": "Media", + "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", + "icon": "media", + "template": "blocks/embed_block.html", + }, + ), + 19: ( + "wagtail.blocks.RichTextBlock", + (), + {"features": ["bold", "italic", "link"]}, + ), + 20: ( + "wagtail.blocks.ListBlock", + (19,), + { + "group": "Cooking", + "icon": "list-ol", + "max_num": 10, + "min_num": 2, + }, + ), + 21: ( + "wagtail.blocks.ChoiceBlock", + [], + {"choices": [("S", "Small"), ("M", "Medium"), ("L", "Large")]}, + ), + 22: ( + "wagtail.blocks.StructBlock", + [[("text", 19), ("difficulty", 21)]], + {}, + ), + 23: ( + "wagtail.blocks.ListBlock", + (22,), + { + "group": "Cooking", + "icon": "tasks", + "max_num": 10, + "min_num": 2, + }, + ), + }, + help_text="The recipe’s step-by-step instructions and any other relevant information.", + ), + ), + ]