From 1251fbd80a68e8085910b0c97009e17fd660afc3 Mon Sep 17 00:00:00 2001 From: Erik van Velzen Date: Tue, 11 Jun 2024 09:52:02 +0200 Subject: [PATCH 01/20] Rename to text_image_block --- src/main/migrations/0071_rename_hero_block.py | 3063 +--------------- .../0072_rename_text_image_block.py | 52 + ...er_challengemodepage_storyline_and_more.py | 3079 +++++++++++++++++ .../pages/base_storyline_challengemode.py | 2 +- 4 files changed, 3142 insertions(+), 3054 deletions(-) create mode 100644 src/main/migrations/0072_rename_text_image_block.py create mode 100644 src/main/migrations/0073_alter_challengemodepage_storyline_and_more.py diff --git a/src/main/migrations/0071_rename_hero_block.py b/src/main/migrations/0071_rename_hero_block.py index fe2461b5..44c2c41d 100644 --- a/src/main/migrations/0071_rename_hero_block.py +++ b/src/main/migrations/0071_rename_hero_block.py @@ -1,3 +1,5 @@ +from datetime import datetime + from django.db import migrations from wagtail.blocks.migrations.migrate_operation import MigrateStreamData from wagtail.blocks.migrations.operations import RenameStreamChildrenOperation @@ -38,3058 +40,13 @@ class Migration(migrations.Migration): (RenameStreamChildrenOperation(old_name="heroblock", new_name="hero_block"), ""), ] ), - migrations.AlterField( - model_name="challengemodepage", - name="storyline", - field=wagtail.fields.StreamField( - [ - ( - "header_full_image_block", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "image_selector", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=True - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ] - ), - ), - ( - "text_and_media", - wagtail.blocks.StructBlock( - [ - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "column_order", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Default (Text left, Media right)"), - ( - "invert", - "Invert columns (Media left, Text right)", - ), - ], - required=False, - ), - ), - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - help_text="Add your text", - required=True, - rows=15, - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - help_text="Youtube url of vimeo url", - required=False, - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "section", - wagtail.blocks.StructBlock( - [ - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "text_label_national", - wagtail.blocks.CharBlock( - default="Nationaal", required=True - ), - ), - ( - "text_label_intermediate", - wagtail.blocks.CharBlock( - default="Regionaal", required=True - ), - ), - ( - "text_label_local", - wagtail.blocks.CharBlock( - default="Lokaal", required=True - ), - ), - ( - "content", - wagtail.blocks.StreamBlock( - [ - ( - "text", - main.blocks.rich_text_block.RichtextBlock(), - ), - ( - "interactive_input", - wagtail.blocks.StructBlock( - [ - ( - "interactive_input", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "display", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "checkbox_radio", - "Show as checkboxe(s) or radiobutton(s)", - ), - ( - "dropdown", - "Show as dropdown", - ), - ], - required=False, - ), - ), - ( - "visible", - wagtail.blocks.BooleanBlock( - default=True, - required=False, - ), - ), - ( - "locked", - wagtail.blocks.BooleanBlock( - required=False - ), - ), - ( - "default_value", - wagtail.blocks.CharBlock( - help_text="Type the default value exactly as it's shown on the website page", - required=False, - ), - ), - ( - "target_value", - wagtail.blocks.CharBlock( - help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", - required=False, - ), - ), - ] - ), - ), - ( - "static_image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "holarchy_feedback_image", - wagtail.blocks.StructBlock( - [ - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "conditions", - wagtail.blocks.StreamBlock( - [ - ( - "interactive_input_condition", - wagtail.blocks.StructBlock( - [ - ( - "parameter", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "operator", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bigger", - "Bigger", - ), - ( - "biggerequal", - "Bigger or Equal", - ), - ( - "equal", - "Equal", - ), - ( - "notequal", - "Not Equal", - ), - ( - "lower", - "Lower", - ), - ( - "lowerequal", - "Lower or Equal", - ), - ], - help_text="Set the operator of this condition", - max_length=50, - ), - ), - ( - "value", - wagtail.blocks.CharBlock( - help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", - max_length=255, - required=True, - ), - ), - ] - ), - ) - ], - block_counts={}, - help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", - use_json_field=True, - ), - ), - ] - ), - ), - ( - "legend_items", - wagtail.blocks.StructBlock( - [ - ( - "legend_items", - wagtail.blocks.StreamBlock( - [ - ( - "item", - wagtail.blocks.StructBlock( - [ - ( - "label", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "image_selector", - main.blocks.legend_item.LegendaImageChooserBlock( - required=True - ), - ), - ( - "type", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "line", - "Line", - ), - ( - "color", - "Color", - ), - ], - required=False, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add Legend items", - use_json_field=True, - ), - ) - ] - ), - ), - ], - block_counts={"static_image": {"max_num": 1}}, - ), - ), - ] - ), - ), - ( - "hero_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ( - "title", - wagtail.blocks.CharBlock( - form_classname="title", required=True - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=True - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - required=False - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "title_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=False - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "card_block", - wagtail.blocks.StructBlock( - [ - ( - "cards", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - required=False - ), - ), - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "description", - wagtail.blocks.CharBlock( - max_length=255, required=False - ), - ), - ( - "card_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("card__bg-gold", "Gold"), - ("card__bg-blue", "Blue"), - ("card__bg-gray", "Gray"), - ( - "card__bg-purple", - "Purple", - ), - ("card__bg-pink", "Pink"), - ( - "card__bg-orange", - "Orange", - ), - ], - required=False, - ), - ), - ( - "item_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the card to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the card should link externally", - required=False, - ), - ), - ], - help_text="Optional: add an internal or external link to the card", - max_num=1, - required=False, - ), - ), - ] - ) - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - null=True, - use_json_field=True, - ), - ), - migrations.AlterField( - model_name="sandboxpage", - name="storyline", - field=wagtail.fields.StreamField( - [ - ( - "header_full_image_block", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "image_selector", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=True - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ] - ), - ), - ( - "text_and_media", - wagtail.blocks.StructBlock( - [ - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "column_order", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Default (Text left, Media right)"), - ( - "invert", - "Invert columns (Media left, Text right)", - ), - ], - required=False, - ), - ), - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - help_text="Add your text", - required=True, - rows=15, - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - help_text="Youtube url of vimeo url", - required=False, - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "section", - wagtail.blocks.StructBlock( - [ - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "text_label_national", - wagtail.blocks.CharBlock( - default="Nationaal", required=True - ), - ), - ( - "text_label_intermediate", - wagtail.blocks.CharBlock( - default="Regionaal", required=True - ), - ), - ( - "text_label_local", - wagtail.blocks.CharBlock( - default="Lokaal", required=True - ), - ), - ( - "content", - wagtail.blocks.StreamBlock( - [ - ( - "text", - main.blocks.rich_text_block.RichtextBlock(), - ), - ( - "interactive_input", - wagtail.blocks.StructBlock( - [ - ( - "interactive_input", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "display", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "checkbox_radio", - "Show as checkboxe(s) or radiobutton(s)", - ), - ( - "dropdown", - "Show as dropdown", - ), - ], - required=False, - ), - ), - ( - "visible", - wagtail.blocks.BooleanBlock( - default=True, - required=False, - ), - ), - ( - "locked", - wagtail.blocks.BooleanBlock( - required=False - ), - ), - ( - "default_value", - wagtail.blocks.CharBlock( - help_text="Type the default value exactly as it's shown on the website page", - required=False, - ), - ), - ( - "target_value", - wagtail.blocks.CharBlock( - help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", - required=False, - ), - ), - ] - ), - ), - ( - "static_image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "holarchy_feedback_image", - wagtail.blocks.StructBlock( - [ - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "conditions", - wagtail.blocks.StreamBlock( - [ - ( - "interactive_input_condition", - wagtail.blocks.StructBlock( - [ - ( - "parameter", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "operator", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bigger", - "Bigger", - ), - ( - "biggerequal", - "Bigger or Equal", - ), - ( - "equal", - "Equal", - ), - ( - "notequal", - "Not Equal", - ), - ( - "lower", - "Lower", - ), - ( - "lowerequal", - "Lower or Equal", - ), - ], - help_text="Set the operator of this condition", - max_length=50, - ), - ), - ( - "value", - wagtail.blocks.CharBlock( - help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", - max_length=255, - required=True, - ), - ), - ] - ), - ) - ], - block_counts={}, - help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", - use_json_field=True, - ), - ), - ] - ), - ), - ( - "legend_items", - wagtail.blocks.StructBlock( - [ - ( - "legend_items", - wagtail.blocks.StreamBlock( - [ - ( - "item", - wagtail.blocks.StructBlock( - [ - ( - "label", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "image_selector", - main.blocks.legend_item.LegendaImageChooserBlock( - required=True - ), - ), - ( - "type", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "line", - "Line", - ), - ( - "color", - "Color", - ), - ], - required=False, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add Legend items", - use_json_field=True, - ), - ) - ] - ), - ), - ], - block_counts={"static_image": {"max_num": 1}}, - ), - ), - ] - ), - ), - ( - "hero_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ( - "title", - wagtail.blocks.CharBlock( - form_classname="title", required=True - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=True - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - required=False - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "title_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=False - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "card_block", - wagtail.blocks.StructBlock( - [ - ( - "cards", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - required=False - ), - ), - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "description", - wagtail.blocks.CharBlock( - max_length=255, required=False - ), - ), - ( - "card_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("card__bg-gold", "Gold"), - ("card__bg-blue", "Blue"), - ("card__bg-gray", "Gray"), - ( - "card__bg-purple", - "Purple", - ), - ("card__bg-pink", "Pink"), - ( - "card__bg-orange", - "Orange", - ), - ], - required=False, - ), - ), - ( - "item_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the card to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the card should link externally", - required=False, - ), - ), - ], - help_text="Optional: add an internal or external link to the card", - max_num=1, - required=False, - ), - ), - ] - ) - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - null=True, - use_json_field=True, - ), - ), - migrations.AlterField( - model_name="storylinepage", - name="storyline", - field=wagtail.fields.StreamField( - [ - ( - "header_full_image_block", - wagtail.blocks.StructBlock( - [ - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "image_selector", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=True - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ] - ), - ), - ( - "text_and_media", - wagtail.blocks.StructBlock( - [ - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "column_order", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Default (Text left, Media right)"), - ( - "invert", - "Invert columns (Media left, Text right)", - ), - ], - required=False, - ), - ), - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - help_text="Add your text", - required=True, - rows=15, - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - help_text="Youtube url of vimeo url", - required=False, - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "section", - wagtail.blocks.StructBlock( - [ - ( - "background", - wagtail.blocks.StructBlock( - [ - ( - "color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("block__bg-white", "White"), - ("block__bg-gray", "Pale gray"), - ( - "block__bg-purple", - "Pale purple", - ), - ] - ), - ), - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bg__full", - "Full backgroundcolor", - ), - ( - "bg__left", - "Only backgroundcolor in the left block", - ), - ] - ), - ), - ] - ), - ), - ( - "grid_layout", - wagtail.blocks.StructBlock( - [ - ( - "grid", - wagtail.blocks.ChoiceBlock( - choices=[ - ("33_66", "33% - 66%"), - ("50_50", "50% - 50%"), - ("66_33", "66% - 33%"), - ] - ), - ) - ], - required=True, - ), - ), - ( - "text_label_national", - wagtail.blocks.CharBlock( - default="Nationaal", required=True - ), - ), - ( - "text_label_intermediate", - wagtail.blocks.CharBlock( - default="Regionaal", required=True - ), - ), - ( - "text_label_local", - wagtail.blocks.CharBlock( - default="Lokaal", required=True - ), - ), - ( - "content", - wagtail.blocks.StreamBlock( - [ - ( - "text", - main.blocks.rich_text_block.RichtextBlock(), - ), - ( - "interactive_input", - wagtail.blocks.StructBlock( - [ - ( - "interactive_input", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "display", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "checkbox_radio", - "Show as checkboxe(s) or radiobutton(s)", - ), - ( - "dropdown", - "Show as dropdown", - ), - ], - required=False, - ), - ), - ( - "visible", - wagtail.blocks.BooleanBlock( - default=True, - required=False, - ), - ), - ( - "locked", - wagtail.blocks.BooleanBlock( - required=False - ), - ), - ( - "default_value", - wagtail.blocks.CharBlock( - help_text="Type the default value exactly as it's shown on the website page", - required=False, - ), - ), - ( - "target_value", - wagtail.blocks.CharBlock( - help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", - required=False, - ), - ), - ] - ), - ), - ( - "static_image", - main.blocks.holon_image_chooser.HolonImageChooserBlock( - required=False - ), - ), - ( - "holarchy_feedback_image", - wagtail.blocks.StructBlock( - [ - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "conditions", - wagtail.blocks.StreamBlock( - [ - ( - "interactive_input_condition", - wagtail.blocks.StructBlock( - [ - ( - "parameter", - wagtailmodelchooser.blocks.ModelChooserBlock( - help_text="Choose an Interactive Element of type `Single select` or `Continuous`", - target_model="holon.interactiveelement", - ), - ), - ( - "operator", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "bigger", - "Bigger", - ), - ( - "biggerequal", - "Bigger or Equal", - ), - ( - "equal", - "Equal", - ), - ( - "notequal", - "Not Equal", - ), - ( - "lower", - "Lower", - ), - ( - "lowerequal", - "Lower or Equal", - ), - ], - help_text="Set the operator of this condition", - max_length=50, - ), - ), - ( - "value", - wagtail.blocks.CharBlock( - help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", - max_length=255, - required=True, - ), - ), - ] - ), - ) - ], - block_counts={}, - help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", - use_json_field=True, - ), - ), - ] - ), - ), - ( - "legend_items", - wagtail.blocks.StructBlock( - [ - ( - "legend_items", - wagtail.blocks.StreamBlock( - [ - ( - "item", - wagtail.blocks.StructBlock( - [ - ( - "label", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "image_selector", - main.blocks.legend_item.LegendaImageChooserBlock( - required=True - ), - ), - ( - "type", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "line", - "Line", - ), - ( - "color", - "Color", - ), - ], - required=False, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add Legend items", - use_json_field=True, - ), - ) - ] - ), - ), - ], - block_counts={"static_image": {"max_num": 1}}, - ), - ), - ] - ), - ), - ( - "hero_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ( - "title", - wagtail.blocks.CharBlock( - form_classname="title", required=True - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=True - ), - ), - ( - "media", - wagtail.blocks.StreamBlock( - [ - ( - "image", - main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( - required=False - ), - ), - ( - "video", - wagtail.embeds.blocks.EmbedBlock( - required=False - ), - ), - ], - help_text="Choose an image or paste an embed url", - max_num=1, - ), - ), - ( - "alt_text", - wagtail.blocks.CharBlock( - help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", - required=False, - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "title_block", - wagtail.blocks.StructBlock( - [ - ( - "background_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("", "Default color"), - ("block__bg-gray", "Pale gray"), - ("block__bg-purple", "Pale purple"), - ], - required=False, - ), - ), - ("title", wagtail.blocks.CharBlock(required=True)), - ( - "size", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ("", "Select header size"), - ("h1", "H1"), - ("h2", "H2"), - ], - ), - ), - ( - "text", - main.blocks.rich_text_block.RichtextBlock( - required=False - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ( - "card_block", - wagtail.blocks.StructBlock( - [ - ( - "cards", - wagtail.blocks.ListBlock( - wagtail.blocks.StructBlock( - [ - ( - "title", - wagtail.blocks.CharBlock( - required=False - ), - ), - ( - "image_selector", - main.blocks.holon_image_chooser.HolonImageChooserBlock(), - ), - ( - "description", - wagtail.blocks.CharBlock( - max_length=255, required=False - ), - ), - ( - "card_color", - wagtail.blocks.ChoiceBlock( - choices=[ - ("card__bg-gold", "Gold"), - ("card__bg-blue", "Blue"), - ("card__bg-gray", "Gray"), - ( - "card__bg-purple", - "Purple", - ), - ("card__bg-pink", "Pink"), - ( - "card__bg-orange", - "Orange", - ), - ], - required=False, - ), - ), - ( - "item_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the card to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the card should link externally", - required=False, - ), - ), - ], - help_text="Optional: add an internal or external link to the card", - max_num=1, - required=False, - ), - ), - ] - ) - ), - ), - ( - "button_block", - wagtail.blocks.StreamBlock( - [ - ( - "buttons", - wagtail.blocks.StructBlock( - [ - ( - "buttons_align", - wagtail.blocks.ChoiceBlock( - choices=[ - ( - "btn-left", - "left", - ), - ( - "btn-center", - "center", - ), - ( - "btn-right", - "right", - ), - ], - required=False, - ), - ), - ( - "buttons", - wagtail.blocks.StreamBlock( - [ - ( - "button", - wagtail.blocks.StructBlock( - [ - ( - "button_style", - wagtail.blocks.ChoiceBlock( - blank=True, - choices=[ - ( - "dark", - "Default (Dark blue)", - ), - ( - "arrow", - "Dark blue with arrow", - ), - ( - "light", - "light", - ), - ], - required=False, - ), - ), - ( - "button_text", - wagtail.blocks.CharBlock( - required=True - ), - ), - ( - "button_link", - wagtail.blocks.StreamBlock( - [ - ( - "intern", - main.blocks.page_chooser_block.PageChooserBlock( - helptext="Choose if you want the button to link to a page internally", - required=False, - ), - ), - ( - "extern", - wagtail.blocks.URLBlock( - helptext="Fill in if the button should link externally", - required=False, - ), - ), - ], - help_text="Where do you want the button to link to", - max_num=1, - ), - ), - ], - required=True, - ), - ) - ], - help_text="Add a button", - min_num=1, - ), - ), - ], - required=False, - ), - ) - ], - required=False, - ), - ), - ] - ), - ), - ], - blank=True, - null=True, - use_json_field=True, - ), + MigrateStreamData( + app_name="main", + model_name="SandboxPage", + field_name="storyline", + revisions_from=datetime.fromisoformat('2024-01-01'), + operations_and_block_paths=[ + (RenameStreamChildrenOperation(old_name="heroblock", new_name="hero_block"), ""), + ] ), ] diff --git a/src/main/migrations/0072_rename_text_image_block.py b/src/main/migrations/0072_rename_text_image_block.py new file mode 100644 index 00000000..59a82970 --- /dev/null +++ b/src/main/migrations/0072_rename_text_image_block.py @@ -0,0 +1,52 @@ +from datetime import datetime + +from django.db import migrations +from wagtail.blocks.migrations.migrate_operation import MigrateStreamData +from wagtail.blocks.migrations.operations import RenameStreamChildrenOperation +import main.blocks.holon_header_image_chooser +import main.blocks.legend_item +import main.blocks.page_chooser_block +import main.blocks.rich_text_block +import wagtail.embeds.blocks +import wagtail.fields +import wagtailmodelchooser.blocks + + + +class Migration(migrations.Migration): + """ + Rename text_and_media to text_image_block to align with the frontend + and with the other entities. + """ + + dependencies = [ + ("main", "0071_rename_hero_block"), + ] + + operations = [ + MigrateStreamData( + app_name="main", + model_name="ChallengeModePage", + field_name="storyline", + operations_and_block_paths=[ + (RenameStreamChildrenOperation(old_name="text_and_media", new_name="text_image_block"), ""), + ] + ), + MigrateStreamData( + app_name="main", + model_name="StorylinePage", + field_name="storyline", + operations_and_block_paths=[ + (RenameStreamChildrenOperation(old_name="text_and_media", new_name="text_image_block"), ""), + ] + ), + MigrateStreamData( + app_name="main", + model_name="SandboxPage", + field_name="storyline", + revisions_from=datetime.fromisoformat('2024-01-01'), + operations_and_block_paths=[ + (RenameStreamChildrenOperation(old_name="text_and_media", new_name="text_image_block"), ""), + ] + ), + ] diff --git a/src/main/migrations/0073_alter_challengemodepage_storyline_and_more.py b/src/main/migrations/0073_alter_challengemodepage_storyline_and_more.py new file mode 100644 index 00000000..31398fe1 --- /dev/null +++ b/src/main/migrations/0073_alter_challengemodepage_storyline_and_more.py @@ -0,0 +1,3079 @@ +# Generated by Django 4.2.13 on 2024-06-11 08:34 + +from django.db import migrations +import main.blocks.holon_header_image_chooser +import main.blocks.holon_image_chooser +import main.blocks.legend_item +import main.blocks.page_chooser_block +import main.blocks.rich_text_block +import wagtail.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtailmodelchooser.blocks + + +class Migration(migrations.Migration): + """ + This is to sync up, don't know where the discrepancy is. + """ + + dependencies = [ + ("main", "0072_rename_text_image_block"), + ] + + operations = [ + migrations.AlterField( + model_name="challengemodepage", + name="storyline", + field=wagtail.fields.StreamField( + [ + ( + "header_full_image_block", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "image_selector", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ] + ), + ), + ( + "text_image_block", + wagtail.blocks.StructBlock( + [ + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "column_order", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Default (Text left, Media right)"), + ( + "invert", + "Invert columns (Media left, Text right)", + ), + ], + required=False, + ), + ), + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + help_text="Add your text", + required=True, + rows=15, + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + help_text="Youtube url of vimeo url", + required=False, + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "text_label_national", + wagtail.blocks.CharBlock( + default="Nationaal", required=True + ), + ), + ( + "text_label_intermediate", + wagtail.blocks.CharBlock( + default="Regionaal", required=True + ), + ), + ( + "text_label_local", + wagtail.blocks.CharBlock( + default="Lokaal", required=True + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + main.blocks.rich_text_block.RichtextBlock(), + ), + ( + "interactive_input", + wagtail.blocks.StructBlock( + [ + ( + "interactive_input", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "display", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "checkbox_radio", + "Show as checkboxe(s) or radiobutton(s)", + ), + ( + "dropdown", + "Show as dropdown", + ), + ], + required=False, + ), + ), + ( + "visible", + wagtail.blocks.BooleanBlock( + default=True, + required=False, + ), + ), + ( + "locked", + wagtail.blocks.BooleanBlock( + required=False + ), + ), + ( + "default_value", + wagtail.blocks.CharBlock( + help_text="Type the default value exactly as it's shown on the website page", + required=False, + ), + ), + ( + "target_value", + wagtail.blocks.CharBlock( + help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", + required=False, + ), + ), + ] + ), + ), + ( + "static_image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "holarchy_feedback_image", + wagtail.blocks.StructBlock( + [ + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "conditions", + wagtail.blocks.StreamBlock( + [ + ( + "interactive_input_condition", + wagtail.blocks.StructBlock( + [ + ( + "parameter", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "operator", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bigger", + "Bigger", + ), + ( + "biggerequal", + "Bigger or Equal", + ), + ( + "equal", + "Equal", + ), + ( + "notequal", + "Not Equal", + ), + ( + "lower", + "Lower", + ), + ( + "lowerequal", + "Lower or Equal", + ), + ], + help_text="Set the operator of this condition", + max_length=50, + ), + ), + ( + "value", + wagtail.blocks.CharBlock( + help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", + max_length=255, + required=True, + ), + ), + ] + ), + ) + ], + block_counts={}, + help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", + use_json_field=True, + ), + ), + ] + ), + ), + ( + "legend_items", + wagtail.blocks.StructBlock( + [ + ( + "legend_items", + wagtail.blocks.StreamBlock( + [ + ( + "item", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "image_selector", + main.blocks.legend_item.LegendaImageChooserBlock( + required=True + ), + ), + ( + "type", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "line", + "Line", + ), + ( + "color", + "Color", + ), + ], + required=False, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add Legend items", + use_json_field=True, + ), + ) + ] + ), + ), + ], + block_counts={"static_image": {"max_num": 1}}, + ), + ), + ] + ), + ), + ( + "hero_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=True + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + required=False + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "title_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=False + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "card_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + required=False + ), + ), + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "description", + wagtail.blocks.CharBlock( + max_length=255, required=False + ), + ), + ( + "card_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("card__bg-gold", "Gold"), + ("card__bg-blue", "Blue"), + ("card__bg-gray", "Gray"), + ( + "card__bg-purple", + "Purple", + ), + ("card__bg-pink", "Pink"), + ( + "card__bg-orange", + "Orange", + ), + ], + required=False, + ), + ), + ( + "item_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the card to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the card should link externally", + required=False, + ), + ), + ], + help_text="Optional: add an internal or external link to the card", + max_num=1, + required=False, + ), + ), + ] + ) + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="sandboxpage", + name="storyline", + field=wagtail.fields.StreamField( + [ + ( + "header_full_image_block", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "image_selector", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ] + ), + ), + ( + "text_image_block", + wagtail.blocks.StructBlock( + [ + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "column_order", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Default (Text left, Media right)"), + ( + "invert", + "Invert columns (Media left, Text right)", + ), + ], + required=False, + ), + ), + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + help_text="Add your text", + required=True, + rows=15, + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + help_text="Youtube url of vimeo url", + required=False, + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "text_label_national", + wagtail.blocks.CharBlock( + default="Nationaal", required=True + ), + ), + ( + "text_label_intermediate", + wagtail.blocks.CharBlock( + default="Regionaal", required=True + ), + ), + ( + "text_label_local", + wagtail.blocks.CharBlock( + default="Lokaal", required=True + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + main.blocks.rich_text_block.RichtextBlock(), + ), + ( + "interactive_input", + wagtail.blocks.StructBlock( + [ + ( + "interactive_input", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "display", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "checkbox_radio", + "Show as checkboxe(s) or radiobutton(s)", + ), + ( + "dropdown", + "Show as dropdown", + ), + ], + required=False, + ), + ), + ( + "visible", + wagtail.blocks.BooleanBlock( + default=True, + required=False, + ), + ), + ( + "locked", + wagtail.blocks.BooleanBlock( + required=False + ), + ), + ( + "default_value", + wagtail.blocks.CharBlock( + help_text="Type the default value exactly as it's shown on the website page", + required=False, + ), + ), + ( + "target_value", + wagtail.blocks.CharBlock( + help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", + required=False, + ), + ), + ] + ), + ), + ( + "static_image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "holarchy_feedback_image", + wagtail.blocks.StructBlock( + [ + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "conditions", + wagtail.blocks.StreamBlock( + [ + ( + "interactive_input_condition", + wagtail.blocks.StructBlock( + [ + ( + "parameter", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "operator", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bigger", + "Bigger", + ), + ( + "biggerequal", + "Bigger or Equal", + ), + ( + "equal", + "Equal", + ), + ( + "notequal", + "Not Equal", + ), + ( + "lower", + "Lower", + ), + ( + "lowerequal", + "Lower or Equal", + ), + ], + help_text="Set the operator of this condition", + max_length=50, + ), + ), + ( + "value", + wagtail.blocks.CharBlock( + help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", + max_length=255, + required=True, + ), + ), + ] + ), + ) + ], + block_counts={}, + help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", + use_json_field=True, + ), + ), + ] + ), + ), + ( + "legend_items", + wagtail.blocks.StructBlock( + [ + ( + "legend_items", + wagtail.blocks.StreamBlock( + [ + ( + "item", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "image_selector", + main.blocks.legend_item.LegendaImageChooserBlock( + required=True + ), + ), + ( + "type", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "line", + "Line", + ), + ( + "color", + "Color", + ), + ], + required=False, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add Legend items", + use_json_field=True, + ), + ) + ] + ), + ), + ], + block_counts={"static_image": {"max_num": 1}}, + ), + ), + ] + ), + ), + ( + "hero_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=True + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + required=False + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "title_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=False + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "card_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + required=False + ), + ), + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "description", + wagtail.blocks.CharBlock( + max_length=255, required=False + ), + ), + ( + "card_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("card__bg-gold", "Gold"), + ("card__bg-blue", "Blue"), + ("card__bg-gray", "Gray"), + ( + "card__bg-purple", + "Purple", + ), + ("card__bg-pink", "Pink"), + ( + "card__bg-orange", + "Orange", + ), + ], + required=False, + ), + ), + ( + "item_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the card to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the card should link externally", + required=False, + ), + ), + ], + help_text="Optional: add an internal or external link to the card", + max_num=1, + required=False, + ), + ), + ] + ) + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="storylinepage", + name="storyline", + field=wagtail.fields.StreamField( + [ + ( + "header_full_image_block", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "image_selector", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ] + ), + ), + ( + "text_image_block", + wagtail.blocks.StructBlock( + [ + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "column_order", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Default (Text left, Media right)"), + ( + "invert", + "Invert columns (Media left, Text right)", + ), + ], + required=False, + ), + ), + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + help_text="Add your text", + required=True, + rows=15, + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + help_text="Youtube url of vimeo url", + required=False, + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "background", + wagtail.blocks.StructBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("block__bg-white", "White"), + ("block__bg-gray", "Pale gray"), + ( + "block__bg-purple", + "Pale purple", + ), + ] + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bg__full", + "Full backgroundcolor", + ), + ( + "bg__left", + "Only backgroundcolor in the left block", + ), + ] + ), + ), + ] + ), + ), + ( + "grid_layout", + wagtail.blocks.StructBlock( + [ + ( + "grid", + wagtail.blocks.ChoiceBlock( + choices=[ + ("33_66", "33% - 66%"), + ("50_50", "50% - 50%"), + ("66_33", "66% - 33%"), + ] + ), + ) + ], + required=True, + ), + ), + ( + "text_label_national", + wagtail.blocks.CharBlock( + default="Nationaal", required=True + ), + ), + ( + "text_label_intermediate", + wagtail.blocks.CharBlock( + default="Regionaal", required=True + ), + ), + ( + "text_label_local", + wagtail.blocks.CharBlock( + default="Lokaal", required=True + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + main.blocks.rich_text_block.RichtextBlock(), + ), + ( + "interactive_input", + wagtail.blocks.StructBlock( + [ + ( + "interactive_input", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "display", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "checkbox_radio", + "Show as checkboxe(s) or radiobutton(s)", + ), + ( + "dropdown", + "Show as dropdown", + ), + ], + required=False, + ), + ), + ( + "visible", + wagtail.blocks.BooleanBlock( + default=True, + required=False, + ), + ), + ( + "locked", + wagtail.blocks.BooleanBlock( + required=False + ), + ), + ( + "default_value", + wagtail.blocks.CharBlock( + help_text="Type the default value exactly as it's shown on the website page", + required=False, + ), + ), + ( + "target_value", + wagtail.blocks.CharBlock( + help_text="Type a target value if this value needs to be added to all underlying sections. Type the value exactly as it's shown on the website page. Seperate multiple values by a comma (no whitespaces)", + required=False, + ), + ), + ] + ), + ), + ( + "static_image", + main.blocks.holon_image_chooser.HolonImageChooserBlock( + required=False + ), + ), + ( + "holarchy_feedback_image", + wagtail.blocks.StructBlock( + [ + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "conditions", + wagtail.blocks.StreamBlock( + [ + ( + "interactive_input_condition", + wagtail.blocks.StructBlock( + [ + ( + "parameter", + wagtailmodelchooser.blocks.ModelChooserBlock( + help_text="Choose an Interactive Element of type `Single select` or `Continuous`", + target_model="holon.interactiveelement", + ), + ), + ( + "operator", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bigger", + "Bigger", + ), + ( + "biggerequal", + "Bigger or Equal", + ), + ( + "equal", + "Equal", + ), + ( + "notequal", + "Not Equal", + ), + ( + "lower", + "Lower", + ), + ( + "lowerequal", + "Lower or Equal", + ), + ], + help_text="Set the operator of this condition", + max_length=50, + ), + ), + ( + "value", + wagtail.blocks.CharBlock( + help_text="Set the value of this condition to compare to, this is the value of the slider or the value of the radio/checkbox (field 'Option' within Interactive Element )", + max_length=255, + required=True, + ), + ), + ] + ), + ) + ], + block_counts={}, + help_text="Image will only be shown when ALL conditions of a holarchy feedback image are true", + use_json_field=True, + ), + ), + ] + ), + ), + ( + "legend_items", + wagtail.blocks.StructBlock( + [ + ( + "legend_items", + wagtail.blocks.StreamBlock( + [ + ( + "item", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "image_selector", + main.blocks.legend_item.LegendaImageChooserBlock( + required=True + ), + ), + ( + "type", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "line", + "Line", + ), + ( + "color", + "Color", + ), + ], + required=False, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add Legend items", + use_json_field=True, + ), + ) + ] + ), + ), + ], + block_counts={"static_image": {"max_num": 1}}, + ), + ), + ] + ), + ), + ( + "hero_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + form_classname="title", required=True + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=True + ), + ), + ( + "media", + wagtail.blocks.StreamBlock( + [ + ( + "image", + main.blocks.holon_header_image_chooser.HolonHeaderImageChooserBlock( + required=False + ), + ), + ( + "video", + wagtail.embeds.blocks.EmbedBlock( + required=False + ), + ), + ], + help_text="Choose an image or paste an embed url", + max_num=1, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Fill in this alt-text only when you want to describe the image (for screenreaders and SEO)", + required=False, + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "title_block", + wagtail.blocks.StructBlock( + [ + ( + "background_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "Default color"), + ("block__bg-gray", "Pale gray"), + ("block__bg-purple", "Pale purple"), + ], + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(required=True)), + ( + "size", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ("", "Select header size"), + ("h1", "H1"), + ("h2", "H2"), + ], + ), + ), + ( + "text", + main.blocks.rich_text_block.RichtextBlock( + required=False + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "card_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + required=False + ), + ), + ( + "image_selector", + main.blocks.holon_image_chooser.HolonImageChooserBlock(), + ), + ( + "description", + wagtail.blocks.CharBlock( + max_length=255, required=False + ), + ), + ( + "card_color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("card__bg-gold", "Gold"), + ("card__bg-blue", "Blue"), + ("card__bg-gray", "Gray"), + ( + "card__bg-purple", + "Purple", + ), + ("card__bg-pink", "Pink"), + ( + "card__bg-orange", + "Orange", + ), + ], + required=False, + ), + ), + ( + "item_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the card to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the card should link externally", + required=False, + ), + ), + ], + help_text="Optional: add an internal or external link to the card", + max_num=1, + required=False, + ), + ), + ] + ) + ), + ), + ( + "button_block", + wagtail.blocks.StreamBlock( + [ + ( + "buttons", + wagtail.blocks.StructBlock( + [ + ( + "buttons_align", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "btn-left", + "left", + ), + ( + "btn-center", + "center", + ), + ( + "btn-right", + "right", + ), + ], + required=False, + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "button_style", + wagtail.blocks.ChoiceBlock( + blank=True, + choices=[ + ( + "dark", + "Default (Dark blue)", + ), + ( + "arrow", + "Dark blue with arrow", + ), + ( + "light", + "light", + ), + ], + required=False, + ), + ), + ( + "button_text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "button_link", + wagtail.blocks.StreamBlock( + [ + ( + "intern", + main.blocks.page_chooser_block.PageChooserBlock( + helptext="Choose if you want the button to link to a page internally", + required=False, + ), + ), + ( + "extern", + wagtail.blocks.URLBlock( + helptext="Fill in if the button should link externally", + required=False, + ), + ), + ], + help_text="Where do you want the button to link to", + max_num=1, + ), + ), + ], + required=True, + ), + ) + ], + help_text="Add a button", + min_num=1, + ), + ), + ], + required=False, + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + ] diff --git a/src/main/pages/base_storyline_challengemode.py b/src/main/pages/base_storyline_challengemode.py index 1174c192..0fa8a234 100644 --- a/src/main/pages/base_storyline_challengemode.py +++ b/src/main/pages/base_storyline_challengemode.py @@ -98,7 +98,7 @@ class BaseStorylineChallengeMode(HeadlessPreviewMixin, BaseCard): storyline = StreamField( [ ("header_full_image_block", HeaderFullImageBlock()), - ("text_and_media", TextAndMediaBlock()), + ("text_image_block", TextAndMediaBlock()), ("section", StorylineSectionBlock()), ("hero_block", HeroBlock()), ("title_block", TitleBlock()), From a62564d1b972bb77e2f6bf6b70d7334658fb3516 Mon Sep 17 00:00:00 2001 From: Erik van Velzen Date: Wed, 12 Jun 2024 10:43:07 +0200 Subject: [PATCH 02/20] Reduce padding of main menu header closes #986 --- frontend/components/Header/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/components/Header/Header.tsx b/frontend/components/Header/Header.tsx index 6794d474..79838982 100644 --- a/frontend/components/Header/Header.tsx +++ b/frontend/components/Header/Header.tsx @@ -11,7 +11,7 @@ export default function Header({ navigation }: { navigation: NavItem[] }) { }; return ( -