From 399cc2682852190e21ca040b2b6bada1c977da9b Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 25 Jul 2024 23:25:51 -0400 Subject: [PATCH 1/4] more padding options --- pages/migrations/0138_alter_rootpage_body.py | 544 +++++++++++++++++++ pages/models.py | 2 + 2 files changed, 546 insertions(+) create mode 100644 pages/migrations/0138_alter_rootpage_body.py diff --git a/pages/migrations/0138_alter_rootpage_body.py b/pages/migrations/0138_alter_rootpage_body.py new file mode 100644 index 000000000..de95be1f9 --- /dev/null +++ b/pages/migrations/0138_alter_rootpage_body.py @@ -0,0 +1,544 @@ +# Generated by Django 5.0.7 on 2024-07-26 03:24 + +import pages.custom_blocks +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("pages", "0137_alter_rootpage_promote_image"), + ] + + operations = [ + migrations.AlterField( + model_name="rootpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "hero", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + required=False + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Width multiplier. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ] + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(required=True), + ), + ( + "aria_label", + wagtail.blocks.CharBlock(required=False), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ) + ] + ), + ), + ] + ), + ), + ("image", pages.custom_blocks.APIImageChooserBlock(required=False)), + ("image_alt", wagtail.blocks.CharBlock(required=False)), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "image_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("left", "Left"), + ("right", "Right"), + ("topLeft", "Top Left"), + ("topRight", "Top Right"), + ("bottomLeft", "Bottom Left"), + ("bottomRight", "Bottom Right"), + ] + ), + ), + ( + "image_size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("auto", "Auto"), + ("contain", "Contain"), + ("cover", "Cover"), + ] + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Padding multiplier. default 0.", min_value=0 + ), + ), + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="eg: #ff0000", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ], + block_counts={ + "background_color": {"max_num": 1}, + "image_alignment": {"max_num": 1}, + "image_size": {"max_num": 1}, + "padding": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + required=True + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + required=False + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Width multiplier. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ] + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(required=True), + ), + ( + "aria_label", + wagtail.blocks.CharBlock(required=False), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ) + ] + ), + ), + ] + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="eg: #ff0000", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Padding multiplier. default 0.", min_value=0 + ), + ), + ( + "padding_top", + wagtail.blocks.IntegerBlock( + help_text="Padding multiplier. default 0.", min_value=0 + ), + ), + ( + "padding_bottom", + wagtail.blocks.IntegerBlock( + help_text="Padding multiplier. default 0.", min_value=0 + ), + ), + ( + "text_alignment", + wagtail.blocks.ChoiceBlock( + choices=[("center", "Center"), ("left", "Left"), ("right", "Right")] + ), + ), + ], + block_counts={ + "background_color": {"max_num": 1}, + "padding": {"max_num": 1}, + "text_alignment": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "divider", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("content_left", "Left side of content."), + ("content_right", "Right side of content."), + ("body_left", "Left side of window."), + ("body_right", "Right side of window."), + ] + ), + ), + ( + "width", + wagtail.blocks.RegexBlock( + error_messages={ + "invalid": "must be valid css measurement. eg: 30px, 50%, 10rem" + }, + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "height", + wagtail.blocks.RegexBlock( + error_messages={ + "invalid": "must be valid css measurement. eg: 30px, 50%, 10rem" + }, + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_vertical", + wagtail.blocks.RegexBlock( + error_messages={ + "invalid": "must be valid css measurement. eg: 30px, 50%, 10rem" + }, + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_horizontal", + wagtail.blocks.RegexBlock( + error_messages={ + "invalid": "must be valid css measurement. eg: 30px, 50%, 10rem" + }, + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ], + block_counts={ + "alignment": {"max_num": 1}, + "height": {"max_num": 1}, + "offset_horizontal": {"max_num": 1}, + "offset_vertical": {"max_num": 1}, + "width": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ("html", wagtail.blocks.RawHTMLBlock()), + ], + use_json_field=True, + ), + ), + ] diff --git a/pages/models.py b/pages/models.py index 2d452c8c8..03969a72a 100644 --- a/pages/models.py +++ b/pages/models.py @@ -129,6 +129,8 @@ class RootPage(Page): error_mssages={'invalid': 'not a valid hex color.'} )), ('padding', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), + ('padding_top', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), + ('padding_bottom', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), ('text_alignment', blocks.ChoiceBlock(choices=[ ('center', 'Center'), ('left', 'Left'), From 6c3315e74b3307a8a1220688a196478c9d6f50fa Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 15 Aug 2024 14:14:08 -0400 Subject: [PATCH 2/4] adding some options and help text --- pages/models.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/pages/models.py b/pages/models.py index 03969a72a..fc6d55dfb 100644 --- a/pages/models.py +++ b/pages/models.py @@ -49,15 +49,10 @@ HERO_IMAGE_ALIGNMENT_CHOICES = [ ('left', 'Left'), ('right', 'Right'), - ('topLeft', 'Top Left'), - ('topRight', 'Top Right'), - ('bottomLeft', 'Bottom Left'), - ('bottomRight', 'Bottom Right'), -] -HERO_IMAGE_SIZE_CHOICES = [ - ('auto', 'Auto'), - ('contain', 'Contain'), - ('cover', 'Cover'), + ('top_left', 'Top Left'), + ('top_right', 'Top Right'), + ('bottom_left', 'Bottom Left'), + ('bottom_right', 'Bottom Right'), ] SECTION_CONTENT_BLOCKS = [ ('cards_block', blocks.StructBlock([ @@ -72,8 +67,8 @@ ]), )), ('config', blocks.StreamBlock([ - ('card_size', blocks.IntegerBlock(min_value=0, help_text='Width multiplier. default 27.')), - ('card_style', blocks.ChoiceBlock(choices=CARDS_STYLE_CHOICES)), + ('card_size', blocks.IntegerBlock(min_value=0, help_text='Sets the width of the individual cards. default 27.')), + ('card_style', blocks.ChoiceBlock(choices=CARDS_STYLE_CHOICES, help_text='The border style of the cards. default borderless.')), ], block_counts={ 'card_size': {'max_num': 1}, 'card_style': {'max_num': 1}, @@ -105,14 +100,20 @@ class RootPage(Page): ('image', APIImageChooserBlock(required=False)), ('image_alt', blocks.CharBlock(required=False)), ('config', blocks.StreamBlock([ - ('image_alignment', blocks.ChoiceBlock(choices=HERO_IMAGE_ALIGNMENT_CHOICES)), - ('image_size', blocks.ChoiceBlock(choices=HERO_IMAGE_SIZE_CHOICES)), - ('padding', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), + ('image_alignment', blocks.ChoiceBlock(choices=HERO_IMAGE_ALIGNMENT_CHOICES, help_text='Controls if the image is on the left or right side of the content, and if it prefers to be at the top, center, or bottom of the available space.')), ('background_color', blocks.RegexBlock( regex=r'#[a-zA-Z0-9]{6}', - help_text='eg: #ff0000', + help_text='Sets the background color of the section. value must be hex eg: #ff0000. Default grey.', error_mssages={'invalid': 'not a valid hex color.'} )), + ('padding', blocks.IntegerBlock(min_value=0, help_text='Creates space above and below this section. default 0.')), + ('padding_top', blocks.IntegerBlock(min_value=0, help_text='Creates space above this section. default 0.')), + ('padding_bottom', blocks.IntegerBlock(min_value=0, help_text='Creates space below this section. default 0.')), + ('text_alignment', blocks.ChoiceBlock(choices=[ + ('center', 'Center'), + ('left', 'Left'), + ('right', 'Right'), + ], default='left', help_text='Configures text alignment within the container. Default Left.')), ], block_counts={ 'image_alignment': {'max_num': 1}, 'image_size': {'max_num': 1}, @@ -125,17 +126,17 @@ class RootPage(Page): ('config', blocks.StreamBlock([ ('background_color', blocks.RegexBlock( regex=r'#[a-zA-Z0-9]{6}', - help_text='eg: #ff0000', + help_text='Sets the background color of the section. value must be hex eg: #ff0000. Default grey.', error_mssages={'invalid': 'not a valid hex color.'} )), - ('padding', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), - ('padding_top', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), - ('padding_bottom', blocks.IntegerBlock(min_value=0, help_text='Padding multiplier. default 0.')), + ('padding', blocks.IntegerBlock(min_value=0, help_text='Creates space above and below this section. default 0.')), + ('padding_top', blocks.IntegerBlock(min_value=0, help_text='Creates space above this section. default 0.')), + ('padding_bottom', blocks.IntegerBlock(min_value=0, help_text='Creates space below this section. default 0.')), ('text_alignment', blocks.ChoiceBlock(choices=[ ('center', 'Center'), ('left', 'Left'), ('right', 'Right'), - ], default='left')), + ], default='left', help_text='Configures text alignment within the container. Default Left.')), ], block_counts={ 'background_color': {'max_num': 1}, 'padding': {'max_num': 1}, From 2d8d3ce48d0476cabe665f75476b876451463284 Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 15 Aug 2024 14:34:42 -0400 Subject: [PATCH 3/4] more help text --- pages/custom_blocks.py | 56 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/pages/custom_blocks.py b/pages/custom_blocks.py index f6fb3e5ec..246082766 100644 --- a/pages/custom_blocks.py +++ b/pages/custom_blocks.py @@ -66,8 +66,8 @@ class Meta: label = "Link" class CTALinkBlock(LinkInfoBlock): - text = blocks.CharBlock(required=True) - aria_label = blocks.CharBlock(required=False) + text = blocks.CharBlock(required=True, help_text='Visible text of the link or button.') + aria_label = blocks.CharBlock(required=False, help_text='Accessible label for the link or button. if provided, must begin with the visible text.') target = LinkBlock(required=True) config = blocks.StreamBlock([ ('style', blocks.ChoiceBlock(choices=[ @@ -75,7 +75,7 @@ class CTALinkBlock(LinkInfoBlock): ('white', 'White'), ('blue_outline', 'Blue Outline'), ('deep_green_outline', 'Deep Green Outline'), - ], default='descending')), + ], help_text='Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.')), ], block_counts={ 'style': {'max_num': 1}, }, required=False) @@ -95,8 +95,8 @@ class LinksGroupBlock(blocks.StructBlock): ('white', 'White'), ('blue', 'Blue'), ('deep-green', 'Deep Green'), - ], default='descending')), - ('analytics_label', blocks.CharBlock(required=False)), + ], help_text="The color of the link buttons. Default white."), + ('analytics_label', blocks.CharBlock(required=False, help_text='Sets the "analytics nav" field for links within this group.')), ], block_counts={ 'color': {'max_num': 1}, 'analytics_label': {'max_num': 1}, @@ -112,7 +112,7 @@ class CTAButtonBarBlock(blocks.StructBlock): default=[], max_num=2, label='Actions' ) config = blocks.StreamBlock([ - ('analytics_label', blocks.CharBlock(required=False)), + ('analytics_label', blocks.CharBlock(required=False, help_text='Sets the "analytics nav" field for links within this group.')), ], block_counts={ 'analytics_label': {'max_num': 1}, }, required=False) @@ -140,9 +140,9 @@ def get_api_representation(self, value, context=None): class QuoteBlock(StructBlock): image = APIImageChooserBlock() - content = blocks.RichTextBlock() - name = blocks.CharBlock() - title = blocks.CharBlock(requred=False) + content = blocks.RichTextBlock(help_text="The quote content.") + name = blocks.CharBlock(help_text="The name of the person or entity to attribute the quote to.") + title = blocks.CharBlock(requred=False, help_text="Additional title or label about the quotee.") class DividerBlock(StructBlock): image = APIImageChooserBlock() @@ -153,19 +153,23 @@ class DividerBlock(StructBlock): ('content_right', 'Right side of content.'), ('body_left', 'Left side of window.'), ('body_right', 'Right side of window.'), - ], default='center')), - ('width', blocks.RegexBlock(regex=r'^[0-9]+(px|%|rem)$', required=False, error_messages={ - 'invalid': "must be valid css measurement. eg: 30px, 50%, 10rem" - })), - ('height', blocks.RegexBlock(regex=r'^[0-9]+(px|%|rem)$', required=False, error_messages={ - 'invalid': "must be valid css measurement. eg: 30px, 50%, 10rem" - })), - ('offset_vertical', blocks.RegexBlock(regex=r'^\-?[0-9]+(px|%|rem)$', required=False, error_messages={ - 'invalid': "must be valid css measurement. eg: 30px, 50%, 10rem" - })), - ('offset_horizontal', blocks.RegexBlock(regex=r'^\-?[0-9]+(px|%|rem)$', required=False, error_messages={ - 'invalid': "must be valid css measurement. eg: 30px, 50%, 10rem" - })) + ], default='center', help_text='Sets the horizontal alignment of the image. can be further customized with the "Offset..." configurations. Default is Left side of window.')), + ('width', blocks.RegexBlock(regex=r'^[0-9]+(px|%|rem)$', required=False, + help_text="Specifies the width of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + error_mssages={'invalid': 'not a valid size.'} + )), + ('height', blocks.RegexBlock(regex=r'^[0-9]+(px|%|rem)$', required=False, + help_text="Specifies the height of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + error_mssages={'invalid': 'not a valid size.'} + )), + ('offset_vertical', blocks.RegexBlock(regex=r'^\-?[0-9]+(px|%|rem)$', required=False, + help_text="Moves the image up or down. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is -50%, which moves the image up by half its width (centering it vertically on the divider).", + error_mssages={'invalid': 'not a valid size.'} + )), + ('offset_horizontal', blocks.RegexBlock(regex=r'^\-?[0-9]+(px|%|rem)$', required=False, + help_text="Moves the image left or right. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is no offset, which means the image's outer edge will align with the container's edge for left and right alignment. or it'll be perfectly centered for centered alignment.", + error_mssages={'invalid': 'not a valid size.'} + )) ], block_counts={ 'alignment': {'max_num': 1}, 'width': {'max_num': 1}, @@ -196,10 +200,10 @@ class Meta: class FAQBlock(blocks.StructBlock): - question = blocks.RichTextBlock(required=True) - slug = blocks.CharBlock(required=True) - answer = blocks.RichTextBlock(required=True) - document = DocumentChooserBlock(required=False) + question = blocks.RichTextBlock(required=True, help_text='The visible text of the question (does not collapse).') + slug = blocks.CharBlock(required=True, help_text='Not visible to user, must be unique in this FAQ.') + answer = blocks.RichTextBlock(required=True, help_text='The answer to the question, is hidden until the question is expanded.') + document = DocumentChooserBlock(required=False, help_text='Not sure this does anything.') class Meta: icon = 'bars' From 5387bbf1b4b871269b1806392058a6f338797887 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 19 Aug 2024 17:05:13 -0400 Subject: [PATCH 4/4] add help text and migrations --- news/migrations/0051_alter_pressindex_faqs.py | 59 + pages/custom_blocks.py | 10 +- ...nable_faqs_alter_faq_questions_and_more.py | 1290 +++++++++++++++++ ...ter_rootpage_body_alter_rootpage_layout.py | 1226 ++++++++++++++++ 4 files changed, 2580 insertions(+), 5 deletions(-) create mode 100644 news/migrations/0051_alter_pressindex_faqs.py create mode 100644 pages/migrations/0151_alter_assignable_faqs_alter_faq_questions_and_more.py create mode 100644 pages/migrations/0152_alter_rootpage_body_alter_rootpage_layout.py diff --git a/news/migrations/0051_alter_pressindex_faqs.py b/news/migrations/0051_alter_pressindex_faqs.py new file mode 100644 index 000000000..f5cb74bbc --- /dev/null +++ b/news/migrations/0051_alter_pressindex_faqs.py @@ -0,0 +1,59 @@ +# Generated by Django 5.0.7 on 2024-08-19 19:29 + +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("news", "0050_newsindex_display_footer_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="pressindex", + name="faqs", + field=wagtail.fields.StreamField( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", required=True + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", required=True + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", required=False + ), + ), + ] + ), + ) + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + ] diff --git a/pages/custom_blocks.py b/pages/custom_blocks.py index 246082766..798e2ad28 100644 --- a/pages/custom_blocks.py +++ b/pages/custom_blocks.py @@ -20,10 +20,10 @@ class Meta: class LinkBlock(blocks.StreamBlock): - external = blocks.URLBlock(required=False) + external = blocks.URLBlock(required=False, help_text='External links are full urls that can go anywhere') internal = blocks.PageChooserBlock(required=False) document = DocumentChooserBlock(required=False) - anchor = blocks.CharBlock(required=False) + anchor = blocks.CharBlock(required=False, help_text='Anchor links reference the ID of an element on the page, and scroll the page there.') class Meta: icon = 'link' @@ -57,8 +57,8 @@ def get_api_representation(self, value, context=None): class LinkInfoBlock(blocks.StructBlock): - text = blocks.CharBlock(required=True) - aria_label = blocks.CharBlock(required=False) + text = blocks.CharBlock(required=True, help_text='Visible text of the link or button.') + aria_label = blocks.CharBlock(required=False, help_text='Accessible label for the link or button. if provided, must begin with the visible text.') target = LinkBlock(required=True) class Meta: @@ -95,7 +95,7 @@ class LinksGroupBlock(blocks.StructBlock): ('white', 'White'), ('blue', 'Blue'), ('deep-green', 'Deep Green'), - ], help_text="The color of the link buttons. Default white."), + ], help_text="The color of the link buttons. Default white.")), ('analytics_label', blocks.CharBlock(required=False, help_text='Sets the "analytics nav" field for links within this group.')), ], block_counts={ 'color': {'max_num': 1}, diff --git a/pages/migrations/0151_alter_assignable_faqs_alter_faq_questions_and_more.py b/pages/migrations/0151_alter_assignable_faqs_alter_faq_questions_and_more.py new file mode 100644 index 000000000..ae52b4752 --- /dev/null +++ b/pages/migrations/0151_alter_assignable_faqs_alter_faq_questions_and_more.py @@ -0,0 +1,1290 @@ +# Generated by Django 5.0.7 on 2024-08-19 19:29 + +import pages.custom_blocks +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("pages", "0150_alter_rootpage_body"), + ] + + operations = [ + migrations.AlterField( + model_name="assignable", + name="faqs", + field=wagtail.fields.StreamField( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", required=True + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", required=True + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", required=False + ), + ), + ] + ), + ) + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="faq", + name="questions", + field=wagtail.fields.StreamField( + [ + ( + "question", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", required=True + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", required=True + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", required=False + ), + ), + ] + ), + ) + ], + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="k12mainpage", + name="faqs", + field=wagtail.fields.StreamField( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", required=True + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", required=True + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", required=False + ), + ), + ] + ), + ) + ], + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="rootpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "hero", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "orange", + "Orange", + ), + ( + "white", + "White", + ), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={ + "style": { + "max_num": 1 + } + }, + required=False, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Sets the width of the individual cards. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ], + help_text="The border style of the cards. default borderless.", + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("orange", "Orange"), + ("white", "White"), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={"style": {"max_num": 1}}, + required=False, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ) + ], + block_counts={"analytics_label": {"max_num": 1}}, + required=False, + ), + ), + ] + ), + ), + ( + "links_group", + wagtail.blocks.StructBlock( + [ + ( + "links", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(required=True), + ), + ( + "aria_label", + wagtail.blocks.CharBlock(required=False), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Links", + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("white", "White"), + ("blue", "Blue"), + ("deep-green", "Deep Green"), + ], + help_text="The color of the link buttons. Default white.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "color": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "content", + wagtail.blocks.RichTextBlock( + help_text="The quote content." + ), + ), + ( + "name", + wagtail.blocks.CharBlock( + help_text="The name of the person or entity to attribute the quote to." + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Additional title or label about the quotee.", + requred=False, + ), + ), + ] + ), + ), + ( + "faq", + wagtail.blocks.StreamBlock( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", + required=True, + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", + required=True, + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", + required=False, + ), + ), + ] + ), + ) + ] + ), + ), + ] + ), + ), + ("image", pages.custom_blocks.APIImageChooserBlock(required=False)), + ("image_alt", wagtail.blocks.CharBlock(required=False)), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "image_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("left", "Left"), + ("right", "Right"), + ("top_left", "Top Left"), + ("top_right", "Top Right"), + ("bottom_left", "Bottom Left"), + ("bottom_right", "Bottom Right"), + ], + help_text="Controls if the image is on the left or right side of the content, and if it prefers to be at the top, center, or bottom of the available space.", + ), + ), + ( + "id", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid id."}, + help_text="HTML id of this element. not visible to users, but is visible in urls and is used to link to a certain part of the page with an anchor link. eg: cool_section", + regex="[a-zA-Z0-9\\-_]", + ), + ), + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="Sets the background color of the section. value must be hex eg: #ff0000. Default grey.", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Creates space above and below this section. default 0.", + min_value=0, + ), + ), + ( + "padding_top", + wagtail.blocks.IntegerBlock( + help_text="Creates space above this section. default 0.", + min_value=0, + ), + ), + ( + "padding_bottom", + wagtail.blocks.IntegerBlock( + help_text="Creates space below this section. default 0.", + min_value=0, + ), + ), + ( + "text_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("left", "Left"), + ("right", "Right"), + ], + help_text="Configures text alignment within the container. Default Left.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this section.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "background_color": {"max_num": 1}, + "id": {"max_num": 1}, + "image_alignment": {"max_num": 1}, + "padding": {"max_num": 1}, + "padding_bottom": {"max_num": 1}, + "padding_top": {"max_num": 1}, + "text_alignment": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "orange", + "Orange", + ), + ( + "white", + "White", + ), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={ + "style": { + "max_num": 1 + } + }, + required=False, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Sets the width of the individual cards. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ], + help_text="The border style of the cards. default borderless.", + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("orange", "Orange"), + ("white", "White"), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={"style": {"max_num": 1}}, + required=False, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ) + ], + block_counts={"analytics_label": {"max_num": 1}}, + required=False, + ), + ), + ] + ), + ), + ( + "links_group", + wagtail.blocks.StructBlock( + [ + ( + "links", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(required=True), + ), + ( + "aria_label", + wagtail.blocks.CharBlock(required=False), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + required=False + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Links", + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("white", "White"), + ("blue", "Blue"), + ("deep-green", "Deep Green"), + ], + help_text="The color of the link buttons. Default white.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "color": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "content", + wagtail.blocks.RichTextBlock( + help_text="The quote content." + ), + ), + ( + "name", + wagtail.blocks.CharBlock( + help_text="The name of the person or entity to attribute the quote to." + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Additional title or label about the quotee.", + requred=False, + ), + ), + ] + ), + ), + ( + "faq", + wagtail.blocks.StreamBlock( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", + required=True, + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", + required=True, + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", + required=False, + ), + ), + ] + ), + ) + ] + ), + ), + ] + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "id", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid id."}, + help_text="HTML id of this element. not visible to users, but is visible in urls and is used to link to a certain part of the page with an anchor link. eg: cool_section", + regex="[a-zA-Z0-9\\-_]", + ), + ), + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="Sets the background color of the section. value must be hex eg: #ff0000. Default grey.", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Creates space above and below this section. default 0.", + min_value=0, + ), + ), + ( + "padding_top", + wagtail.blocks.IntegerBlock( + help_text="Creates space above this section. default 0.", + min_value=0, + ), + ), + ( + "padding_bottom", + wagtail.blocks.IntegerBlock( + help_text="Creates space below this section. default 0.", + min_value=0, + ), + ), + ( + "text_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("left", "Left"), + ("right", "Right"), + ], + help_text="Configures text alignment within the container. Default Left.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this section.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "background_color": {"max_num": 1}, + "id": {"max_num": 1}, + "padding": {"max_num": 1}, + "padding_bottom": {"max_num": 1}, + "padding_top": {"max_num": 1}, + "text_alignment": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "divider", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("content_left", "Left side of content."), + ("content_right", "Right side of content."), + ("body_left", "Left side of window."), + ("body_right", "Right side of window."), + ], + help_text='Sets the horizontal alignment of the image. can be further customized with the "Offset..." configurations. Default is Left side of window.', + ), + ), + ( + "width", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Specifies the width of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "height", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Specifies the height of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_vertical", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Moves the image up or down. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is -50%, which moves the image up by half its width (centering it vertically on the divider).", + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_horizontal", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Moves the image left or right. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is no offset, which means the image's outer edge will align with the container's edge for left and right alignment. or it'll be perfectly centered for centered alignment.", + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ], + block_counts={ + "alignment": {"max_num": 1}, + "height": {"max_num": 1}, + "offset_horizontal": {"max_num": 1}, + "offset_vertical": {"max_num": 1}, + "width": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ("html", wagtail.blocks.RawHTMLBlock()), + ], + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="tutormarketing", + name="faqs", + field=wagtail.fields.StreamField( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", required=True + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", required=True + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", required=False + ), + ), + ] + ), + ) + ], + use_json_field=True, + ), + ), + ] diff --git a/pages/migrations/0152_alter_rootpage_body_alter_rootpage_layout.py b/pages/migrations/0152_alter_rootpage_body_alter_rootpage_layout.py new file mode 100644 index 000000000..8fa23bba8 --- /dev/null +++ b/pages/migrations/0152_alter_rootpage_body_alter_rootpage_layout.py @@ -0,0 +1,1226 @@ +# Generated by Django 5.0.7 on 2024-08-19 21:04 + +import pages.custom_blocks +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("pages", "0151_alter_assignable_faqs_alter_faq_questions_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="rootpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "hero", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "orange", + "Orange", + ), + ( + "white", + "White", + ), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={ + "style": { + "max_num": 1 + } + }, + required=False, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Sets the width of the individual cards. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ], + help_text="The border style of the cards. default borderless.", + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("orange", "Orange"), + ("white", "White"), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={"style": {"max_num": 1}}, + required=False, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ) + ], + block_counts={"analytics_label": {"max_num": 1}}, + required=False, + ), + ), + ] + ), + ), + ( + "links_group", + wagtail.blocks.StructBlock( + [ + ( + "links", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Links", + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("white", "White"), + ("blue", "Blue"), + ("deep-green", "Deep Green"), + ], + help_text="The color of the link buttons. Default white.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "color": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "content", + wagtail.blocks.RichTextBlock( + help_text="The quote content." + ), + ), + ( + "name", + wagtail.blocks.CharBlock( + help_text="The name of the person or entity to attribute the quote to." + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Additional title or label about the quotee.", + requred=False, + ), + ), + ] + ), + ), + ( + "faq", + wagtail.blocks.StreamBlock( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", + required=True, + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", + required=True, + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", + required=False, + ), + ), + ] + ), + ) + ] + ), + ), + ] + ), + ), + ("image", pages.custom_blocks.APIImageChooserBlock(required=False)), + ("image_alt", wagtail.blocks.CharBlock(required=False)), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "image_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("left", "Left"), + ("right", "Right"), + ("top_left", "Top Left"), + ("top_right", "Top Right"), + ("bottom_left", "Bottom Left"), + ("bottom_right", "Bottom Right"), + ], + help_text="Controls if the image is on the left or right side of the content, and if it prefers to be at the top, center, or bottom of the available space.", + ), + ), + ( + "id", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid id."}, + help_text="HTML id of this element. not visible to users, but is visible in urls and is used to link to a certain part of the page with an anchor link. eg: cool_section", + regex="[a-zA-Z0-9\\-_]", + ), + ), + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="Sets the background color of the section. value must be hex eg: #ff0000. Default grey.", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Creates space above and below this section. default 0.", + min_value=0, + ), + ), + ( + "padding_top", + wagtail.blocks.IntegerBlock( + help_text="Creates space above this section. default 0.", + min_value=0, + ), + ), + ( + "padding_bottom", + wagtail.blocks.IntegerBlock( + help_text="Creates space below this section. default 0.", + min_value=0, + ), + ), + ( + "text_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("left", "Left"), + ("right", "Right"), + ], + help_text="Configures text alignment within the container. Default Left.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this section.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "background_color": {"max_num": 1}, + "id": {"max_num": 1}, + "image_alignment": {"max_num": 1}, + "padding": {"max_num": 1}, + "padding_bottom": {"max_num": 1}, + "padding_top": {"max_num": 1}, + "text_alignment": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "section", + wagtail.blocks.StructBlock( + [ + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "cards_block", + wagtail.blocks.StructBlock( + [ + ( + "cards", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + pages.custom_blocks.APIRichTextBlock(), + ), + ( + "cta_block", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "orange", + "Orange", + ), + ( + "white", + "White", + ), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={ + "style": { + "max_num": 1 + } + }, + required=False, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Call To Action", + max_num=1, + ), + ), + ] + ) + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "card_size", + wagtail.blocks.IntegerBlock( + help_text="Sets the width of the individual cards. default 27.", + min_value=0, + ), + ), + ( + "card_style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("rounded", "Rounded"), + ("square", "Square"), + ], + help_text="The border style of the cards. default borderless.", + ), + ), + ], + block_counts={ + "card_size": {"max_num": 1}, + "card_style": {"max_num": 1}, + }, + required=False, + ), + ), + ], + label="Cards Block", + ), + ), + ("text", pages.custom_blocks.APIRichTextBlock()), + ("html", wagtail.blocks.RawHTMLBlock()), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "actions", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "style", + wagtail.blocks.ChoiceBlock( + choices=[ + ("orange", "Orange"), + ("white", "White"), + ( + "blue_outline", + "Blue Outline", + ), + ( + "deep_green_outline", + "Deep Green Outline", + ), + ], + help_text="Specifies the button style. Default unspecified, meaning the first button in the block is orange and the second is white.", + ), + ) + ], + block_counts={"style": {"max_num": 1}}, + required=False, + ), + ), + ], + label="Button", + required=False, + ), + default=[], + label="Actions", + max_num=2, + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ) + ], + block_counts={"analytics_label": {"max_num": 1}}, + required=False, + ), + ), + ] + ), + ), + ( + "links_group", + wagtail.blocks.StructBlock( + [ + ( + "links", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", + required=True, + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Links", + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("white", "White"), + ("blue", "Blue"), + ("deep-green", "Deep Green"), + ], + help_text="The color of the link buttons. Default white.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this group.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "color": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "content", + wagtail.blocks.RichTextBlock( + help_text="The quote content." + ), + ), + ( + "name", + wagtail.blocks.CharBlock( + help_text="The name of the person or entity to attribute the quote to." + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Additional title or label about the quotee.", + requred=False, + ), + ), + ] + ), + ), + ( + "faq", + wagtail.blocks.StreamBlock( + [ + ( + "faq", + wagtail.blocks.StructBlock( + [ + ( + "question", + wagtail.blocks.RichTextBlock( + help_text="The visible text of the question (does not collapse).", + required=True, + ), + ), + ( + "slug", + wagtail.blocks.CharBlock( + help_text="Not visible to user, must be unique in this FAQ.", + required=True, + ), + ), + ( + "answer", + wagtail.blocks.RichTextBlock( + help_text="The answer to the question, is hidden until the question is expanded.", + required=True, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Not sure this does anything.", + required=False, + ), + ), + ] + ), + ) + ] + ), + ), + ] + ), + ), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "id", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid id."}, + help_text="HTML id of this element. not visible to users, but is visible in urls and is used to link to a certain part of the page with an anchor link. eg: cool_section", + regex="[a-zA-Z0-9\\-_]", + ), + ), + ( + "background_color", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid hex color."}, + help_text="Sets the background color of the section. value must be hex eg: #ff0000. Default grey.", + regex="#[a-zA-Z0-9]{6}", + ), + ), + ( + "padding", + wagtail.blocks.IntegerBlock( + help_text="Creates space above and below this section. default 0.", + min_value=0, + ), + ), + ( + "padding_top", + wagtail.blocks.IntegerBlock( + help_text="Creates space above this section. default 0.", + min_value=0, + ), + ), + ( + "padding_bottom", + wagtail.blocks.IntegerBlock( + help_text="Creates space below this section. default 0.", + min_value=0, + ), + ), + ( + "text_alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("left", "Left"), + ("right", "Right"), + ], + help_text="Configures text alignment within the container. Default Left.", + ), + ), + ( + "analytics_label", + wagtail.blocks.CharBlock( + help_text='Sets the "analytics nav" field for links within this section.', + required=False, + ), + ), + ], + block_counts={ + "analytics_label": {"max_num": 1}, + "background_color": {"max_num": 1}, + "id": {"max_num": 1}, + "padding": {"max_num": 1}, + "padding_bottom": {"max_num": 1}, + "padding_top": {"max_num": 1}, + "text_alignment": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ( + "divider", + wagtail.blocks.StructBlock( + [ + ("image", pages.custom_blocks.APIImageChooserBlock()), + ( + "config", + wagtail.blocks.StreamBlock( + [ + ( + "alignment", + wagtail.blocks.ChoiceBlock( + choices=[ + ("center", "Center"), + ("content_left", "Left side of content."), + ("content_right", "Right side of content."), + ("body_left", "Left side of window."), + ("body_right", "Right side of window."), + ], + help_text='Sets the horizontal alignment of the image. can be further customized with the "Offset..." configurations. Default is Left side of window.', + ), + ), + ( + "width", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Specifies the width of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "height", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Specifies the height of the image. Percentages are relative to the container (body or content, depending on alignment option). Must be valid css measurement. eg: 30px, 50%, 10rem. Default is the size of the image.", + regex="^[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_vertical", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Moves the image up or down. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is -50%, which moves the image up by half its width (centering it vertically on the divider).", + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ( + "offset_horizontal", + wagtail.blocks.RegexBlock( + error_mssages={"invalid": "not a valid size."}, + help_text="Moves the image left or right. Percentages are relative to the image size. Must be valid css measurement. eg: 30px, 50%, 10rem. Default is no offset, which means the image's outer edge will align with the container's edge for left and right alignment. or it'll be perfectly centered for centered alignment.", + regex="^\\-?[0-9]+(px|%|rem)$", + required=False, + ), + ), + ], + block_counts={ + "alignment": {"max_num": 1}, + "height": {"max_num": 1}, + "offset_horizontal": {"max_num": 1}, + "offset_vertical": {"max_num": 1}, + "width": {"max_num": 1}, + }, + required=False, + ), + ), + ] + ), + ), + ("html", wagtail.blocks.RawHTMLBlock()), + ], + use_json_field=True, + ), + ), + migrations.AlterField( + model_name="rootpage", + name="layout", + field=wagtail.fields.StreamField( + [ + ("default", wagtail.blocks.StructBlock([])), + ( + "landing", + wagtail.blocks.StructBlock( + [ + ( + "nav_links", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + help_text="Visible text of the link or button.", required=True + ), + ), + ( + "aria_label", + wagtail.blocks.CharBlock( + help_text="Accessible label for the link or button. if provided, must begin with the visible text.", + required=False, + ), + ), + ( + "target", + wagtail.blocks.StreamBlock( + [ + ( + "external", + wagtail.blocks.URLBlock( + help_text="External links are full urls that can go anywhere", + required=False, + ), + ), + ( + "internal", + wagtail.blocks.PageChooserBlock(required=False), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + required=False + ), + ), + ( + "anchor", + wagtail.blocks.CharBlock( + help_text="Anchor links reference the ID of an element on the page, and scroll the page there.", + required=False, + ), + ), + ], + required=True, + ), + ), + ], + label="Link", + required=False, + ), + default=[], + label="Nav Links", + ), + ) + ], + label="Landing Page", + ), + ), + ], + blank=True, + default=[], + use_json_field=True, + ), + ), + ]