diff --git a/CHANGELOG.md b/CHANGELOG.md index 8127985e..ea68a8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Release History -## Unreleased +## 78.0 (2024-08-06) -- ... +Compare: + +- [Directory search block](https://trello.com/c/09eNT1iH/6-fis-directory-search-widget-fe-and-be) ([Merge request #712](https://git.torchbox.com/buckinghamshire-council/bc/-/merge_requests/712)) ## 77.0 (2024-07-29) diff --git a/bc/blogs/migrations/0019_add_directory_search_block.py b/bc/blogs/migrations/0019_add_directory_search_block.py new file mode 100644 index 00000000..539257c3 --- /dev/null +++ b/bc/blogs/migrations/0019_add_directory_search_block.py @@ -0,0 +1,1237 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("blogs", "0018_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="blogaboutpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="blogpostpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/blogs/migrations/0020_directory_search_block__add_bucks_online_directory_option.py b/bc/blogs/migrations/0020_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..5339d13e --- /dev/null +++ b/bc/blogs/migrations/0020_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,1253 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("blogs", "0019_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="blogaboutpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="blogpostpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/cases/migrations/0026_add_directory_search_block.py b/bc/cases/migrations/0026_add_directory_search_block.py new file mode 100644 index 00000000..ae6d0ff7 --- /dev/null +++ b/bc/cases/migrations/0026_add_directory_search_block.py @@ -0,0 +1,642 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("cases", "0025_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="apteanrespondcaseformpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ( + "form_link_button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title", + help_text="The button label", + ), + ) + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/cases/migrations/0027_directory_search_block__add_bucks_online_directory_option.py b/bc/cases/migrations/0027_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..5fed5563 --- /dev/null +++ b/bc/cases/migrations/0027_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,650 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("cases", "0026_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="apteanrespondcaseformpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ( + "form_link_button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title", + help_text="The button label", + ), + ) + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/events/migrations/0034_add_directory_search_block.py b/bc/events/migrations/0034_add_directory_search_block.py new file mode 100644 index 00000000..0543234a --- /dev/null +++ b/bc/events/migrations/0034_add_directory_search_block.py @@ -0,0 +1,628 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("events", "0033_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="eventpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/events/migrations/0035_directory_search_block__add_bucks_online_directory_option.py b/bc/events/migrations/0035_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..191846ba --- /dev/null +++ b/bc/events/migrations/0035_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,636 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("events", "0034_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="eventpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/family_information/migrations/0015_add_directory_search_block.py b/bc/family_information/migrations/0015_add_directory_search_block.py new file mode 100644 index 00000000..ec94b653 --- /dev/null +++ b/bc/family_information/migrations/0015_add_directory_search_block.py @@ -0,0 +1,214 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +from django.db import migrations +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("family_information", "0014_merge_20240709_1347"), + ] + + operations = [ + migrations.AddField( + model_name="categorypage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AddField( + model_name="categorytypeonepage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AddField( + model_name="categorytypetwopage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AddField( + model_name="subsitehomepage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ) + ], + blank=True, + ), + ), + ] diff --git a/bc/family_information/migrations/0016_directory_search_block__add_bucks_online_directory_option.py b/bc/family_information/migrations/0016_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..130b7c04 --- /dev/null +++ b/bc/family_information/migrations/0016_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,245 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +from django.db import migrations, models +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("family_information", "0015_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="categorypage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="categorypage", + name="other_pages_heading", + field=models.CharField(blank=True, default="Others", max_length=255), + ), + migrations.AlterField( + model_name="categorytypeonepage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="categorytypeonepage", + name="other_pages_heading", + field=models.CharField(blank=True, default="Others", max_length=255), + ), + migrations.AlterField( + model_name="categorytypetwopage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ], + template="patterns/organisms/search-widget/search-widget.html", + ), + ) + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="categorytypetwopage", + name="other_pages_heading", + field=models.CharField(blank=True, default="Others", max_length=255), + ), + migrations.AlterField( + model_name="subsitehomepage", + name="directory_search", + field=wagtail.fields.StreamField( + [ + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ) + ], + blank=True, + ), + ), + ] diff --git a/bc/family_information/models.py b/bc/family_information/models.py index 15acdf33..e6868bb9 100644 --- a/bc/family_information/models.py +++ b/bc/family_information/models.py @@ -13,6 +13,7 @@ from ..news.models import NewsIndex from ..standardpages.models import IndexPage +from ..utils.blocks import DirectorySearchBlock from ..utils.models import BasePage, PageTopTask from .blocks import CardsBlock, ThreeCardRowBlock, TwoCardRowBlock @@ -121,6 +122,10 @@ class SubsiteHomePage(FISBannerFields, BasePage): blank=True, default="Get information, advice and guidance", max_length=255 ) + directory_search = StreamField( + [("directory_search", DirectorySearchBlock())], blank=True, max_num=1 + ) + call_to_action = models.ForeignKey( "utils.CallToActionSnippet", blank=True, @@ -161,6 +166,7 @@ class SubsiteHomePage(FISBannerFields, BasePage): ), FieldPanel("heading"), FieldPanel("highlighted_cards"), + FieldPanel("directory_search"), ] + FISBannerFields.content_panels + [FieldPanel("search_prompt_text"), FieldPanel("call_to_action")] @@ -238,7 +244,20 @@ class BaseCategoryPage(FISBannerFields, BasePage): ) # Other child pages - other_pages_heading = models.CharField(default="Others", max_length=255) + other_pages_heading = models.CharField(default="Others", max_length=255, blank=True) + + directory_search = StreamField( + [ + ( + "directory_search", + DirectorySearchBlock( + template="patterns/organisms/search-widget/search-widget.html" + ), + ) + ], + blank=True, + max_num=1, + ) content_panels = ( BasePage.content_panels @@ -266,9 +285,11 @@ class BaseCategoryPage(FISBannerFields, BasePage): " isn't displayed.)" ), ), + FieldPanel("directory_search"), ] + FISBannerFields.content_panels ) + search_fields = BasePage.search_fields + FISBannerFields.search_fields class Meta: @@ -360,6 +381,7 @@ class CategoryPage(BaseCategoryPage): " isn't displayed.)" ), ), + FieldPanel("directory_search"), ] + FISBannerFields.content_panels ) diff --git a/bc/inlineindex/migrations/0036_add_directory_search_block.py b/bc/inlineindex/migrations/0036_add_directory_search_block.py new file mode 100644 index 00000000..b5f1f1ff --- /dev/null +++ b/bc/inlineindex/migrations/0036_add_directory_search_block.py @@ -0,0 +1,1237 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("inlineindex", "0035_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="inlineindex", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="inlineindexchild", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/inlineindex/migrations/0037_directory_search_block__add_bucks_online_directory_option.py b/bc/inlineindex/migrations/0037_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..a185c4af --- /dev/null +++ b/bc/inlineindex/migrations/0037_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,1253 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("inlineindex", "0036_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="inlineindex", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="inlineindexchild", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/location/migrations/0017_add_directory_search_block.py b/bc/location/migrations/0017_add_directory_search_block.py new file mode 100644 index 00000000..ecd8402d --- /dev/null +++ b/bc/location/migrations/0017_add_directory_search_block.py @@ -0,0 +1,1850 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("location", "0016_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="locationindexpage", + name="additional_info", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="locationpage", + name="additional_info", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + help_text="Additional information about this location like opening times, facilities, etc. This will appear above the map in the template.", + ), + ), + migrations.AlterField( + model_name="locationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + help_text="Generic body content. This will appear after the map in the template.", + ), + ), + ] diff --git a/bc/location/migrations/0018_directory_search_block__add_bucks_online_directory_option.py b/bc/location/migrations/0018_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..06e519b0 --- /dev/null +++ b/bc/location/migrations/0018_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,1874 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("location", "0017_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="locationindexpage", + name="additional_info", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="locationpage", + name="additional_info", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + help_text="Additional information about this location like opening times, facilities, etc. This will appear above the map in the template.", + ), + ), + migrations.AlterField( + model_name="locationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + help_text="Generic body content. This will appear after the map in the template.", + ), + ), + ] diff --git a/bc/longform/migrations/0030_add_directory_search_block.py b/bc/longform/migrations/0030_add_directory_search_block.py new file mode 100644 index 00000000..4e57be1f --- /dev/null +++ b/bc/longform/migrations/0030_add_directory_search_block.py @@ -0,0 +1,1302 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.longform.blocks +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("longform", "0029_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="longformchapterpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "subsubheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subsubheading uses the subsubheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="H4", + template="patterns/molecules/streamfield/blocks/subsubheading_block.html", + ), + ), + ( + "numbered_heading", + bc.longform.blocks.NumberedHeadingBlock( + help_text='Adds a number to the heading if is_numbered is not enabled on the long-form content page (e.g. 1. My heading). The link to this heading will be "section-x" where x is the heading number.' + ), + ), + ( + "numbered_subheading", + bc.longform.blocks.NumberedSubheadingBlock( + help_text='Adds a number to the subheading (e.g. 1.1. My subheading). The link to this subheading will be "section-x.y" where x is the heading or chapter number, and y is the subheading number.' + ), + ), + ( + "numbered_paragraph", + bc.longform.blocks.NumberedParagraphBlock( + help_text='Adds a number before the paragraph (e.g. 1.1.1.). The link to this paragraph will be "section-x.y.z" where x is the heading or chapter number, y is the subheading number, and z is the paragraph number.' + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("bar_chart", bc.utils.blocks.BarChartBlock()), + ("line_graph", bc.utils.blocks.LineChartBlock()), + ("pie_chart", bc.utils.blocks.PieChartBlock()), + ] + ), + ), + migrations.AlterField( + model_name="longformpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "subsubheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subsubheading uses the subsubheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="H4", + template="patterns/molecules/streamfield/blocks/subsubheading_block.html", + ), + ), + ( + "numbered_heading", + bc.longform.blocks.NumberedHeadingBlock( + help_text='Adds a number to the heading if is_numbered is not enabled on the long-form content page (e.g. 1. My heading). The link to this heading will be "section-x" where x is the heading number.' + ), + ), + ( + "numbered_subheading", + bc.longform.blocks.NumberedSubheadingBlock( + help_text='Adds a number to the subheading (e.g. 1.1. My subheading). The link to this subheading will be "section-x.y" where x is the heading or chapter number, and y is the subheading number.' + ), + ), + ( + "numbered_paragraph", + bc.longform.blocks.NumberedParagraphBlock( + help_text='Adds a number before the paragraph (e.g. 1.1.1.). The link to this paragraph will be "section-x.y.z" where x is the heading or chapter number, y is the subheading number, and z is the paragraph number.' + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("bar_chart", bc.utils.blocks.BarChartBlock()), + ("line_graph", bc.utils.blocks.LineChartBlock()), + ("pie_chart", bc.utils.blocks.PieChartBlock()), + ] + ), + ), + ] diff --git a/bc/longform/migrations/0031_directory_search_block__add_bucks_online_directory_option.py b/bc/longform/migrations/0031_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..c78a19f9 --- /dev/null +++ b/bc/longform/migrations/0031_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,1318 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.longform.blocks +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("longform", "0030_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="longformchapterpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "subsubheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subsubheading uses the subsubheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="H4", + template="patterns/molecules/streamfield/blocks/subsubheading_block.html", + ), + ), + ( + "numbered_heading", + bc.longform.blocks.NumberedHeadingBlock( + help_text='Adds a number to the heading if is_numbered is not enabled on the long-form content page (e.g. 1. My heading). The link to this heading will be "section-x" where x is the heading number.' + ), + ), + ( + "numbered_subheading", + bc.longform.blocks.NumberedSubheadingBlock( + help_text='Adds a number to the subheading (e.g. 1.1. My subheading). The link to this subheading will be "section-x.y" where x is the heading or chapter number, and y is the subheading number.' + ), + ), + ( + "numbered_paragraph", + bc.longform.blocks.NumberedParagraphBlock( + help_text='Adds a number before the paragraph (e.g. 1.1.1.). The link to this paragraph will be "section-x.y.z" where x is the heading or chapter number, y is the subheading number, and z is the paragraph number.' + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("bar_chart", bc.utils.blocks.BarChartBlock()), + ("line_graph", bc.utils.blocks.LineChartBlock()), + ("pie_chart", bc.utils.blocks.PieChartBlock()), + ] + ), + ), + migrations.AlterField( + model_name="longformpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "subsubheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subsubheading uses the subsubheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="H4", + template="patterns/molecules/streamfield/blocks/subsubheading_block.html", + ), + ), + ( + "numbered_heading", + bc.longform.blocks.NumberedHeadingBlock( + help_text='Adds a number to the heading if is_numbered is not enabled on the long-form content page (e.g. 1. My heading). The link to this heading will be "section-x" where x is the heading number.' + ), + ), + ( + "numbered_subheading", + bc.longform.blocks.NumberedSubheadingBlock( + help_text='Adds a number to the subheading (e.g. 1.1. My subheading). The link to this subheading will be "section-x.y" where x is the heading or chapter number, and y is the subheading number.' + ), + ), + ( + "numbered_paragraph", + bc.longform.blocks.NumberedParagraphBlock( + help_text='Adds a number before the paragraph (e.g. 1.1.1.). The link to this paragraph will be "section-x.y.z" where x is the heading or chapter number, y is the subheading number, and z is the paragraph number.' + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("bar_chart", bc.utils.blocks.BarChartBlock()), + ("line_graph", bc.utils.blocks.LineChartBlock()), + ("pie_chart", bc.utils.blocks.PieChartBlock()), + ] + ), + ), + ] diff --git a/bc/news/migrations/0035_add_directory_search_block.py b/bc/news/migrations/0035_add_directory_search_block.py new file mode 100644 index 00000000..823a7fb5 --- /dev/null +++ b/bc/news/migrations/0035_add_directory_search_block.py @@ -0,0 +1,628 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("news", "0034_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="newspage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/news/migrations/0036_directory_search_block__add_bucks_online_directory_option.py b/bc/news/migrations/0036_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..8a3a629a --- /dev/null +++ b/bc/news/migrations/0036_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,636 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("news", "0035_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="newspage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + ] diff --git a/bc/project_styleguide/templates/patterns/atoms/image/image.html b/bc/project_styleguide/templates/patterns/atoms/image/image.html index 2b1e8928..9e91cb8c 100644 --- a/bc/project_styleguide/templates/patterns/atoms/image/image.html +++ b/bc/project_styleguide/templates/patterns/atoms/image/image.html @@ -1,5 +1,5 @@ - {{ alt }} + {{ alt }} diff --git a/bc/project_styleguide/templates/patterns/molecules/location-autocomplete/location-autocomplete.html b/bc/project_styleguide/templates/patterns/molecules/location-autocomplete/location-autocomplete.html new file mode 100644 index 00000000..50f9291c --- /dev/null +++ b/bc/project_styleguide/templates/patterns/molecules/location-autocomplete/location-autocomplete.html @@ -0,0 +1,7 @@ + + + + +
+ + diff --git a/bc/project_styleguide/templates/patterns/molecules/streamfield/blocks/search-widget.html b/bc/project_styleguide/templates/patterns/molecules/streamfield/blocks/search-widget.html new file mode 100644 index 00000000..17098807 --- /dev/null +++ b/bc/project_styleguide/templates/patterns/molecules/streamfield/blocks/search-widget.html @@ -0,0 +1 @@ +{% include 'patterns/organisms/search-widget/search-widget.html' with classes="search-widget--sf" %} diff --git a/bc/project_styleguide/templates/patterns/organisms/search-widget/search-widget.html b/bc/project_styleguide/templates/patterns/organisms/search-widget/search-widget.html new file mode 100644 index 00000000..d0788c65 --- /dev/null +++ b/bc/project_styleguide/templates/patterns/organisms/search-widget/search-widget.html @@ -0,0 +1,29 @@ +{% load wagtailimages_tags %} + +{% if directory_url %} +
+
+

{{ value.title|default:"Find activities and organisations near you" }}

+
+
+ + +
+ +
+ + {% include 'patterns/molecules/location-autocomplete/location-autocomplete.html' with location_autocomplete_id="region-search" location_autocomplete_classes="search-widget__input input" location_autocomplete_placeholder="For example, Buckingham" %} +
+ + {% for key, value in extra_query_params %} + + {% endfor %} + + +
+
+
+{% endif %} diff --git a/bc/project_styleguide/templates/patterns/organisms/search-widget/search-widget.yaml b/bc/project_styleguide/templates/patterns/organisms/search-widget/search-widget.yaml new file mode 100644 index 00000000..e69de29b diff --git a/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.html b/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.html index 9325e4e6..f5183e03 100644 --- a/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.html +++ b/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.html @@ -43,6 +43,10 @@

{% include_block page.highlighted_cards %} {% endif %} + {% if page.directory_search %} + {% include_block page.directory_search %} + {% endif %} +
{% for subpage in page.other_child_pages %} {% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-home" page=subpage %} diff --git a/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.yaml b/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.yaml index 55d0bea3..9f638f4b 100644 --- a/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.yaml +++ b/bc/project_styleguide/templates/patterns/pages/home/home_page--fis.yaml @@ -1,6 +1,7 @@ context: base_page_template: 'patterns/base_page--fis.html' page: + search_widget: true call_to_action: title: Stub content summary: Check out our awesome stub content @@ -26,6 +27,19 @@ context: listing_summary: Get help with finding childcare and early education funding - listing_title: Information, advice and support listing_summary: Parenting support, help for carers and other advice for families + child_pages: + - title: Childcare and early years + listing_summary: Get help with finding childcare and early education funding + - title: Information, advice and support + listing_summary: Parenting support, help for carers and other advice for families + - title: Young people (13 to 25 years old) + listing_summary: Support for young people, including work and education + - title: Family centres and support + listing_summary: Find family centres and contact the Family Support Service + - title: Special education needs and disabilities + listing_summary: Our local offer supports children and young people with SEND + - title: Things to do + listing_summary: Search our directory for activities and events near you tags: image: @@ -45,8 +59,17 @@ tags: target_var: retina_mobile_image raw: url: https://placekitten.com/g/900/700 + image fill-300x270 as mobile_image: + target_var: mobile_image + raw: + url: https://picsum.photos/300/270.webp + image fill-600x540 as retina_mobile_image: + target_var: retina_mobile_image + raw: + url: https://picsum.photos/600/540.webp + pageurl: - block.value.page: - raw: '#' subpage: raw: '#' + block.value.page: + raw: '#' diff --git a/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat1.html b/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat1.html index 5abcecc5..45866845 100644 --- a/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat1.html +++ b/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat1.html @@ -26,10 +26,22 @@ If content was added to the page body, use that content. If not, behave like before: display all child pages. {% endcomment %} + {% include_block page.body %} + + {% if page.body %} + {% comment %} + If content was added to page.body put the search widget under that but above the other child pages. + {% endcomment %} + {% if page.directory_search %} + {% include_block page.directory_search %} + {% endif %} + {% endif %} + {% if show_other_pages_heading %}

{{ page.other_pages_heading }}

{% endif %} +
{{ pa
+ {% if not page.body %} + {% comment %} + If content wasn't added to page.body put the search widget under child pages. + {% endcomment %} + {% if page.directory_search %} + {% include_block page.directory_search %} + {% endif %} + {% endif %} + {% include "patterns/molecules/directory-banner/directory-banner.html" with classes="directory-banner--with-space" %} {% include "patterns/molecules/search-prompt/search-prompt--fis.html" with search_prompt_text=page.get_parent.specific.search_prompt_text %} diff --git a/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat2.html b/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat2.html index e36ad94d..5360054e 100644 --- a/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat2.html +++ b/bc/project_styleguide/templates/patterns/pages/standardpages/index_page--fis-cat2.html @@ -26,8 +26,20 @@ If content was added to the page body, use that content. If not, behave like before: display all child pages. {% endcomment %} +
+ {% include_block page.body %} + + {% if page.body %} + {% comment %} + If content was added to page.body put the search widget under that but above the other child pages. + {% endcomment %} + {% if page.directory_search %} + {% include_block page.directory_search %} + {% endif %} + {% endif %} + {% if show_other_pages_heading %}

{{ page.other_pages_heading }}

{% endif %} @@ -42,6 +54,15 @@

{{ pa

+ {% if not page.body %} + {% comment %} + If content wasn't added to page.body put the search widget under child pages. + {% endcomment %} + {% if page.directory_search %} + {% include_block page.directory_search %} + {% endif %} + {% endif %} + {% include "patterns/molecules/directory-banner/directory-banner.html" with classes="directory-banner--with-space" %} diff --git a/bc/recruitment/migrations/0065_add_directory_search_block.py b/bc/recruitment/migrations/0065_add_directory_search_block.py new file mode 100644 index 00000000..8bf232f7 --- /dev/null +++ b/bc/recruitment/migrations/0065_add_directory_search_block.py @@ -0,0 +1,629 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("recruitment", "0064_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="recruitmentindexpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + ), + ), + ] diff --git a/bc/recruitment/migrations/0066_directory_search_block__add_bucks_online_directory_option.py b/bc/recruitment/migrations/0066_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..11f18384 --- /dev/null +++ b/bc/recruitment/migrations/0066_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,637 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("recruitment", "0065_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="recruitmentindexpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ], + blank=True, + ), + ), + ] diff --git a/bc/standardpages/migrations/0042_add_directory_search_block.py b/bc/standardpages/migrations/0042_add_directory_search_block.py new file mode 100644 index 00000000..bd36934f --- /dev/null +++ b/bc/standardpages/migrations/0042_add_directory_search_block.py @@ -0,0 +1,1238 @@ +# Generated by Django 4.2.11 on 2024-07-19 11:25 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("standardpages", "0041_add_ehcco_search_widget"), + ] + + operations = [ + migrations.AlterField( + model_name="informationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="wastewizardpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ("send", "SEND"), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "send", + "SEND", + ), + ( + "familyinfo", + "Family Information Service", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("waste_wizard", bc.utils.blocks.WasteWizardSnippetBlock()), + ] + ), + ), + ] diff --git a/bc/standardpages/migrations/0043_directory_search_block__add_bucks_online_directory_option.py b/bc/standardpages/migrations/0043_directory_search_block__add_bucks_online_directory_option.py new file mode 100644 index 00000000..3a080479 --- /dev/null +++ b/bc/standardpages/migrations/0043_directory_search_block__add_bucks_online_directory_option.py @@ -0,0 +1,1254 @@ +# Generated by Django 4.2.14 on 2024-07-25 15:10 + +import bc.utils.blocks +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("standardpages", "0042_add_directory_search_block"), + ] + + operations = [ + migrations.AlterField( + model_name="informationpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ] + ), + ), + migrations.AlterField( + model_name="wastewizardpage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(required=False)), + ] + ), + ), + ("embed", wagtail.embeds.blocks.EmbedBlock()), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock(label="Aylesbury Vale URL"), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock(label="Chiltern URL"), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock(label="South Bucks URL"), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock(label="Wycombe URL"), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ("caption", wagtail.blocks.TextBlock(required=False)), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock(form_classname="title"), + ), + ("link_url", wagtail.blocks.URLBlock(required=False)), + ( + "link_page", + wagtail.blocks.PageChooserBlock(required=False), + ), + ] + ), + ), + ("highlight", bc.utils.blocks.HighlightBlock()), + ("inset_text", bc.utils.blocks.InsetTextBlock()), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock(label="EHCCo Search"), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", required=True + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ("send", "SEND"), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ( + "items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Accordion title", + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this heading uses the heading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + label="Main heading", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "subheading", + wagtail.blocks.CharBlock( + form_classname="full title", + group="Heading", + help_text='The link to this subheading uses the subheading text in lowercase, with no symbols, and with the spaces replaced with hyphens. e.g. "Lorem @ 2 ipsum" becomes "lorem-2-ipsum"', + icon="title", + template="patterns/molecules/streamfield/blocks/subheading_block.html", + ), + ), + ( + "paragraph", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the information, not the picture. Leave blank if the image is purely decorative. Do not repeat captions or content already on the page.", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + required=False + ), + ), + ] + ), + ), + ( + "embed", + wagtail.embeds.blocks.EmbedBlock(), + ), + ( + "local_area_links", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.RichTextBlock( + default="

Find local information

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "introduction", + wagtail.blocks.RichTextBlock( + default="

While we finish building this new website, we’re keeping some local information on our old council websites

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + ), + ), + ( + "postcode_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Enter your postcode to help us redirect you to the right place.

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the postcode lookup input", + ), + ), + ( + "area_lookup_text", + wagtail.blocks.RichTextBlock( + default="

Select your local area to help us direct you to the right place:

", + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + help_text="The text that appears on top of the list of local area links", + ), + ), + ( + "aylesbury_vale_url", + wagtail.blocks.URLBlock( + label="Aylesbury Vale URL" + ), + ), + ( + "chiltern_url", + wagtail.blocks.URLBlock( + label="Chiltern URL" + ), + ), + ( + "south_bucks_url", + wagtail.blocks.URLBlock( + label="South Bucks URL" + ), + ), + ( + "wycombe_url", + wagtail.blocks.URLBlock( + label="Wycombe URL" + ), + ), + ] + ), + ), + ( + "plain_text_table", + bc.utils.blocks.TableBlock( + group="Table", + help_text='This table will be displayed as plain text on the page.\n You can add links to individuals cells by using the following\n syntax: [link text](www.gov.uk). This will output as\n link text', + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "left_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ( + "right_aligned_column", + wagtail.blocks.StreamBlock( + [ + ( + "numeric", + wagtail.blocks.DecimalBlock(), + ), + ( + "rich_text", + wagtail.blocks.RichTextBlock(), + ), + ] + ), + ), + ] + ), + ), + ( + "caption", + wagtail.blocks.TextBlock( + required=False + ), + ), + ], + group="Table", + ), + ), + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + form_classname="title" + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + required=False + ), + ), + ( + "link_page", + wagtail.blocks.PageChooserBlock( + required=False + ), + ), + ] + ), + ), + ( + "highlight", + bc.utils.blocks.HighlightBlock(), + ), + ( + "inset_text", + bc.utils.blocks.InsetTextBlock(), + ), + ( + "ehc_co_search", + bc.utils.blocks.EHCCoSearchBlock( + label="EHCCo Search" + ), + ), + ( + "directory_search", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title of the widget", + required=True, + ), + ), + ( + "search_placeholder", + wagtail.blocks.CharBlock( + help_text="Placeholder text for the search input", + required=False, + ), + ), + ( + "directory", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "bucks_online_directory", + "Bucks Online Directory", + ), + ( + "familyinfo", + "Family Information Service", + ), + ( + "send", + "SEND", + ), + ], + help_text="Which directory to search", + ), + ), + ( + "extra_query_params", + wagtail.blocks.CharBlock( + help_text="Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism", + required=False, + ), + ), + ] + ), + ), + ], + label="Accordion content", + ), + ), + ] + ), + label="Accordion items", + ), + ) + ] + ), + ), + ( + "detail", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + form_classname="full title", + icon="title", + label="Detail title", + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "ol", + "ul", + "link", + "document-link", + ], + label="Detail content", + ), + ), + ] + ), + ), + ("waste_wizard", bc.utils.blocks.WasteWizardSnippetBlock()), + ] + ), + ), + ] diff --git a/bc/static_src/javascript/components/location-autocomplete.js b/bc/static_src/javascript/components/location-autocomplete.js new file mode 100644 index 00000000..74cd7d33 --- /dev/null +++ b/bc/static_src/javascript/components/location-autocomplete.js @@ -0,0 +1,219 @@ +/* global google */ + +import accessibleAutocomplete from 'accessible-autocomplete'; + +class LocationAutocomplete { + static selector() { + return '[data-autocomplete-container]'; + } + + constructor(node) { + this.container = node; + this.form = node.closest('form'); + + if (!this.form) { + throw new Error('No form found for autocomplete container'); + } + this.labelId = node.dataset.labelId; + if (!this.labelId) { + throw new Error('No label ID found for autocomplete container'); + } + + this.latInput = this.form.querySelector('input[name="lat"]'); + this.lngInput = this.form.querySelector('input[name="lng"]'); + this.locationInput = this.form.querySelector('input[name="location"]'); + + this.sessionToken = LocationAutocomplete.getSessionToken(); + + this.autocompleteService = new google.maps.places.AutocompleteService(); + this.geocoder = new google.maps.Geocoder(); + + this.focusOnLocation = false; + this.locationSelected = false; + + this.bindEvents(); + + this.predictions = []; + } + + static getSessionToken() { + return new google.maps.places.AutocompleteSessionToken(); + } + + deduceOption(autocompleteInput) { + let item; + if (autocompleteInput.value.trim() === '') { + item = ''; + } else if (this.predictions.length === 0) { + autocompleteInput.value = ''; + item = ''; + } else if (this.locationSelected) { + const description = this.locationInput.value; + item = this.predictions.find((p) => p.description === description); + if (!item) { + [item] = this.predictions; + } + } else { + [item] = this.predictions; + } + this.selectElement(item); + } + + bindEvents() { + const self = this; + accessibleAutocomplete({ + element: this.container, + id: this.labelId, + source: (query, populateResults) => { + self.getLocations(query, populateResults); + }, + displayMenu: 'overlay', // displays menu as an absolute positioned div + autoSelect: true, + minLength: 3, // minimum number of characters required to trigger autocomplete + showNoOptionsFound: true, // displays a "no options found" message if no options are found + templates: { + suggestion: (item) => + `
${item.description || + item}
`, + noResults: () => + `
No results found
`, + inputValue: (item) => { + if (item) { + const placeId = item.place_id; + if (!placeId) { + return item; + } + return item.description; + } + return item; + }, + }, + onConfirm: (item) => { + if (item) { + this.selectElement(item, () => { + this.focusOnLocation = false; + }); + } + }, + }); + this.autocompleteInput = this.container.querySelector('input'); + if (!this.autocompleteInput) { + throw new Error('No input element found in autocomplete container'); + } + this.autocompleteInput.setAttribute( + 'placeholder', + this.form + .querySelector(`#${this.labelId}`) + .getAttribute('placeholder'), + ); + this.autocompleteInput.addEventListener('blur', (e) => { + this.deduceOption(e.target); + }); + this.autocompleteInput.addEventListener('focus', () => { + this.focusOnLocation = true; + }); + this.autocompleteInput.addEventListener('keydown', (e) => { + if (e.keyCode === 13) { + // enter key + e.preventDefault(); + if (this.locationSelected) { + this.form.submit(); + return; + } + this.deduceOption(e.target); + } + }); + + this.form.addEventListener('submit', (e) => { + e.preventDefault(); + this.submitForm(); + }); + } + + submitForm() { + const waitForFocusChange = () => + new Promise((resolve) => { + const interval = setInterval(() => { + if (!this.focusOnLocation) { + clearInterval(interval); + resolve(); + } + }, 10); // Check every 100 milliseconds + }); + + if (this.autocompleteInput.value.length < 3) { + this.locationInput.value = ''; + this.latInput.value = ''; + this.lngInput.value = ''; + this.form.submit(); + } else { + waitForFocusChange().then(() => { + this.form.submit(); + }); + } + } + + selectElement(item, cb) { + if (item) { + const placeId = item.place_id; + this.geocoder.geocode({ placeId }, (results, status) => { + if (status === 'OK') { + const { lat, lng } = results[0].geometry.location; + this.latInput.value = lat(); + this.lngInput.value = lng(); + this.locationInput.value = item.description; + this.autocompleteInput.value = item.description; + } else { + // eslint-disable-next-line no-console + console.log( + `Geocoder failed due to: ${status}`, + results, + placeId, + ); + } + if (cb) cb(); + }); + } else { + this.locationInput.value = ''; + this.latInput.value = ''; + this.lngInput.value = ''; + } + // regenerate a new session token after each selection + // as per https://developers.google.com/maps/documentation/javascript/place-autocomplete#session_tokens + this.sessionToken = LocationAutocomplete.getSessionToken(); + this.focusOnLocation = false; + this.locationSelected = true; + } + + getLocations(query, populateResults) { + if (!this.focusOnLocation) return; + this.locationSelected = false; + + this.autocompleteService.getPlacePredictions( + { + input: query, + sessionToken: this.sessionToken, + componentRestrictions: { + country: 'gb', + }, + types: ['geocode'], + }, + (predictions, status) => { + if (status === google.maps.places.PlacesServiceStatus.OK) { + this.predictions = predictions; + } else { + // eslint-disable-next-line no-console + console.log( + 'Autocomplete service failed: ', + status, + predictions, + ); + this.predictions = []; + } + populateResults(this.predictions); + }, + ); + } +} + +export default LocationAutocomplete; diff --git a/bc/static_src/javascript/main.js b/bc/static_src/javascript/main.js index e08d53ad..5329b636 100755 --- a/bc/static_src/javascript/main.js +++ b/bc/static_src/javascript/main.js @@ -20,6 +20,7 @@ import GoogleMap from './components/map'; import Steps from './components/steps'; import ContentsScroller from './components/contents-scroller'; import EHCCOSearch from './components/fis-ehcco-search'; +import LocationAutocomplete from './components/location-autocomplete'; // Add polyfill fix for forEach carousel import foreachPolyfill from './polyfills/foreach-polyfill'; @@ -149,6 +150,12 @@ document.addEventListener('DOMContentLoaded', () => { new EHCCOSearch(search); } + for (const locationAutocomplete of document.querySelectorAll( + LocationAutocomplete.selector(), + )) { + new LocationAutocomplete(locationAutocomplete); + } + // Test react - add a div with a data attribute of `data-test-react` to test for (const element of document.querySelectorAll('[data-test-react]')) { ReactDOM.render(, element); diff --git a/bc/static_src/sass/abstracts/_variables.scss b/bc/static_src/sass/abstracts/_variables.scss index ead592db..8ddee4d6 100755 --- a/bc/static_src/sass/abstracts/_variables.scss +++ b/bc/static_src/sass/abstracts/_variables.scss @@ -9,6 +9,7 @@ $color--red: #d4351c; $color--border: rgba($color--off-black, 0.2); $color--river: #2c2d84; +$color--river-tint: #dfe0ed; // 15% tint of $color--river $color--lake: #233b8e; $color--sky: #006ab4; $color--grape: #3e2d73; diff --git a/bc/static_src/sass/components/_location-autocomplete.scss b/bc/static_src/sass/components/_location-autocomplete.scss new file mode 100644 index 00000000..d714af59 --- /dev/null +++ b/bc/static_src/sass/components/_location-autocomplete.scss @@ -0,0 +1,25 @@ +.location-autocomplete { + position: relative; + + .autocomplete__menu { + position: absolute; + width: 100%; + border: 1px solid $color--charcoal; + z-index: 10; + + &--hidden { + display: none; + } + } + + .autocomplete__option { + padding: $grid--small; + cursor: pointer; + background-color: $color--white; + + &:hover, + &:focus { + background-color: $color--charcoal-25; + } + } +} diff --git a/bc/static_src/sass/components/_search-widget.scss b/bc/static_src/sass/components/_search-widget.scss new file mode 100644 index 00000000..1e6b2af4 --- /dev/null +++ b/bc/static_src/sass/components/_search-widget.scss @@ -0,0 +1,88 @@ +.search-widget { + $root: &; + background-color: $color--river-tint; + border-left: 5px solid $color--river; + color: $color--default; + width: 100%; + margin: $grid--large 0; + + .wrapper--desktop-reverse & { + margin: 0; + + @include media-query(tablet-landscape) { + margin: $grid--large 0 0; + } + } + + &__form { + max-width: $site-width; + padding: 20px; + + @include media-query(tablet-landscape) { + padding: 30px; + } + } + + &__heading { + margin: 0 0 $grid--small; + } + + &__button { + margin-top: 10px; + flex-grow: 0; + max-width: max-content; + + svg { + fill: transparent; + stroke: $color--white; + width: 18px; + height: 18px; + margin-right: 10px; + flex-shrink: 0; + } + } + + &__form-layout { + display: grid; + grid-gap: $grid--small; + + @include media-query(tablet-landscape) { + grid-template-columns: 1fr 1fr 1fr; + align-items: flex-end; + } + } + + &__label { + display: block; + margin-bottom: 2px; + } + + &__input { + @include font-size(s); + border-radius: 0; + border: 1px solid $color--default; + padding: 5px; + width: 100%; + max-width: 320px; + + @include media-query(tablet-portrait) { + max-width: 100%; + } + } + + &--sf { + #{$root}__form-layout { + @include media-query(tablet-landscape) { + grid-template-columns: 1fr 1fr; + } + } + } + + .template-fis-home & { + #{$root}__form-layout { + @include media-query(tablet-landscape) { + grid-template-columns: 1fr 1fr 1fr; + } + } + } +} diff --git a/bc/static_src/sass/main.scss b/bc/static_src/sass/main.scss index 6edc2199..87852363 100755 --- a/bc/static_src/sass/main.scss +++ b/bc/static_src/sass/main.scss @@ -69,6 +69,7 @@ @import 'components/search-header'; @import 'components/search-prompt'; @import 'components/search-result'; +@import 'components/search-widget'; @import 'components/section'; @import 'components/split-content'; @import 'components/skip-link'; @@ -93,6 +94,7 @@ @import 'components/fis-ehcco-search'; @import 'components/search-promotions'; @import 'components/top-tasks'; +@import 'components/location-autocomplete'; // Pages @import 'pages/blogglobalhomepage'; diff --git a/bc/utils/blocks.py b/bc/utils/blocks.py index 6c956ebd..50a8651e 100644 --- a/bc/utils/blocks.py +++ b/bc/utils/blocks.py @@ -1,7 +1,10 @@ import copy +import logging +from urllib.parse import parse_qsl from django import forms from django.core.exceptions import ValidationError +from django.db.models import TextChoices from django.forms.utils import ErrorList from django.urls import reverse from django.utils.functional import cached_property @@ -19,6 +22,8 @@ from .utils import convert_markdown_links_to_html, is_number from .widgets import BarChartInput, LineChartInput, PieChartInput +logger = logging.getLogger(__name__) + class TableBlock(BaseTableBlock): def render(self, value, context=None): @@ -578,6 +583,70 @@ def get_context(self, value, parent_context=None): context["get_corresponding_ehc_co_url"] = reverse( "family_information:get_corresponding_ehc_co" ) + + +class Directory(TextChoices): + BUCKS_ONLINE_DIRECTORY = "bucks_online_directory", "Bucks Online Directory" + FAMILYINFO = "familyinfo", "Family Information Service" + SEND = "send", "SEND" + + +def get_directory_url(directory: Directory, /) -> str: + if directory is Directory.BUCKS_ONLINE_DIRECTORY: + return "https://directory.buckinghamshire.gov.uk/" + elif any(directory is member for member in [Directory.FAMILYINFO, Directory.SEND]): + return ( + f"https://directory.{directory.value}.buckinghamshire.gov.uk/" # noqa: E231 + ) + else: + raise NotImplementedError( + f"get_directory_url is not implemented for: {repr(directory)}" + ) + + +class DirectorySearchBlock(blocks.StructBlock): + title = blocks.CharBlock(required=True, help_text="Title of the widget") + search_placeholder = blocks.CharBlock( + required=False, help_text="Placeholder text for the search input" + ) + directory = blocks.ChoiceBlock( + choices=Directory.choices, + required=True, + help_text="Which directory to search", + ) + extra_query_params = blocks.CharBlock( + required=False, + help_text=( + "Extra query parameters to add to the search, e.g. ?collection=things-to-do&needs=autism" + ), + ) + + class Meta: + template = "patterns/molecules/streamfield/blocks/search-widget.html" + icon = "search" + + def get_context(self, value, parent_context=None): + context = super().get_context(value, parent_context) + try: + directory = Directory(value["directory"]) + except ValueError: + logger.error("Invalid directory value", exc_info=True) + return context + + # Build the query params and the target URL for the directory search. + if value["extra_query_params"]: + extra_query_params = value["extra_query_params"] + if extra_query_params.startswith("?"): + extra_query_params = extra_query_params[1:] + extra_query_params = parse_qsl(extra_query_params) + context["extra_query_params"] = extra_query_params + + try: + context["directory_url"] = get_directory_url(directory) + except NotImplementedError: + logger.exception("Could not get directory URL.") + context["directory_url"] = None + return context @@ -619,6 +688,7 @@ class BaseStoryBlock(blocks.StreamBlock): highlight = HighlightBlock() inset_text = InsetTextBlock() ehc_co_search = EHCCoSearchBlock(label="EHCCo Search") + directory_search = DirectorySearchBlock() class Meta: abstract = True diff --git a/docs/location-autocomplete.md b/docs/location-autocomplete.md new file mode 100644 index 00000000..e99deed6 --- /dev/null +++ b/docs/location-autocomplete.md @@ -0,0 +1,15 @@ +# Location autocomplete widget + +Directory search widget streamfield block has a location autocomplete field. + +The HTML template of the block can be found at +[bc/project_styleguide/templates/patterns/molecules/location-autocomplete/location-autocomplete.html](https://git.torchbox.com/buckinghamshire-council/bc/-/blob/release/bc/project_styleguide/templates/patterns/molecules/location-autocomplete/location-autocomplete.html). + +The JavaScript component can be found at +[bc/static_src/javascript/components/location-autocomplete.js](https://git.torchbox.com/buckinghamshire-council/bc/-/blob/release/bc/static_src/javascript/components/location-autocomplete.js). + +It uses Google Maps API to provide location suggestions: https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service + +## Configuration + +It requires the `GOOGLE_MAPS_V3_APIKEY` environment variable to be configured. This settings is also used by different components on the website (e.g. [location maps widget](location-maps-widget.md)). diff --git a/docs/location-maps-widget.md b/docs/location-maps-widget.md index aa335def..b98ac1cb 100644 --- a/docs/location-maps-widget.md +++ b/docs/location-maps-widget.md @@ -6,4 +6,6 @@ We use [Wagtail-Geo-Widget](https://github.com/Frojd/wagtail-geo-widget/) as a w Set the environment variables -- `GOOGLE_MAPS_V3_APIKEY` ([How to retrieve the api key](https://github.com/Frojd/wagtail-geo-widget/blob/main/docs/getting-started.md#retriving-a-google-maps-api-key)) +- `GOOGLE_MAPS_V3_APIKEY` ([How to retrieve the api key](https://github.com/Frojd/wagtail-geo-widget/blob/main/docs/getting-started-with-google-maps.md#retriving-a-google-maps-api-key)) + +This variable is also used by the [location autocomplete widget](./location-autocomplete.md). diff --git a/mkdocs.yml b/mkdocs.yml index 008fab1d..bf6180e6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,7 @@ nav: - 'Recruitment site': 'recruitment-site.md' - 'Complaints and requests': 'complaints-and-requests.md' - 'Live chat client': 'live-chat-client.md' + - 'Location autocomplete': 'location-autocomplete.md' - 'Location maps widget': 'location-maps-widget.md' - 'Postcode lookup': 'postcode-lookup.md' - 'Contributing': 'contributing.md'