diff --git a/CHANGELOG.md b/CHANGELOG.md index 811c9d07..4690b209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Release History -## Unreleased +## 73.0 (2024-07-09) + +Compare: + +- Add new search promotional block on search page +- Add FIS EHCCo search +- Modify FIS search results view +- Modify FIS homepage +- Modify FIS category index page +- Fix accessibility issues from Silktide ## 72.01 (2024-06-26) diff --git a/bc/blogs/migrations/0018_add_ehcco_search_widget.py b/bc/blogs/migrations/0018_add_ehcco_search_widget.py new file mode 100644 index 00000000..d9f8da40 --- /dev/null +++ b/bc/blogs/migrations/0018_add_ehcco_search_widget.py @@ -0,0 +1,1070 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("blogs", "0017_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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"), + ), + ( + "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" + ), + ), + ], + 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/0025_add_ehcco_search_widget.py b/bc/cases/migrations/0025_add_ehcco_search_widget.py new file mode 100644 index 00000000..e41cd817 --- /dev/null +++ b/bc/cases/migrations/0025_add_ehcco_search_widget.py @@ -0,0 +1,559 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("cases", "0024_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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/0033_add_ehcco_search_widget.py b/bc/events/migrations/0033_add_ehcco_search_widget.py new file mode 100644 index 00000000..153a26a6 --- /dev/null +++ b/bc/events/migrations/0033_add_ehcco_search_widget.py @@ -0,0 +1,545 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("events", "0032_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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/blocks.py b/bc/family_information/blocks.py new file mode 100644 index 00000000..baf60b92 --- /dev/null +++ b/bc/family_information/blocks.py @@ -0,0 +1,46 @@ +from wagtail import blocks + + +class NCardRowBlock(blocks.StreamBlock): + card = blocks.PageChooserBlock() + + def get_context(self, value, parent_context=None): + context = super().get_context(value, parent_context) + + # Get the page's class. + context["page_class"] = parent_context["page"]._meta.object_name + + # Check if the block is preceded by a heading. + blocks_under_headings = parent_context.get("blocks_under_headings", []) + context["has_heading"] = value in blocks_under_headings + + return context + + +class CardsBlock(NCardRowBlock): + """A block that displays 3 pages per row, but accepts more than 3 pages.""" + + class Meta: + label = "Cards" + min_num = 1 + template = "patterns/molecules/streamfield/blocks/cards_block.html" + + +class TwoCardRowBlock(NCardRowBlock): + """A block that only accepts 2 pages, to display the 2 pages in one row.""" + + class Meta: + label = "Two-card row" + max_num = 2 + min_num = 2 + template = "patterns/molecules/streamfield/blocks/two_card_row_block.html" + + +class ThreeCardRowBlock(NCardRowBlock): + """A block that only accepts 3 pages, to display the 3 pages in one row.""" + + class Meta: + label = "Three-card row" + max_num = 3 + min_num = 3 + template = "patterns/molecules/streamfield/blocks/three_card_row_block.html" diff --git a/bc/family_information/migrations/0011_add_school_and_ehcco_models.py b/bc/family_information/migrations/0011_add_school_and_ehcco_models.py new file mode 100644 index 00000000..865ca203 --- /dev/null +++ b/bc/family_information/migrations/0011_add_school_and_ehcco_models.py @@ -0,0 +1,82 @@ +# Generated by Django 4.2.11 on 2024-06-07 07:54 + +import django.db.models.deletion +import wagtail.search.index +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("family_information", "0010_subsitehomepage_heading"), + ] + + operations = [ + migrations.CreateModel( + name="EHCCo", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ("email", models.EmailField(max_length=254)), + ], + options={ + "verbose_name": "EHCCo", + "verbose_name_plural": "EHCCos", + }, + bases=(wagtail.search.index.Indexed, models.Model), + ), + migrations.CreateModel( + name="School", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField()), + ( + "hub_email", + models.CharField( + blank=True, + choices=[ + ( + "sencsb@buckinghamshire.gov.uk", + "sencsb@buckinghamshire.gov.uk", + ), + ( + "senwyc@buckinghamshire.gov.uk", + "senwyc@buckinghamshire.gov.uk", + ), + ( + "Senaylesbury@buckinghamshire.gov.uk", + "Senaylesbury@buckinghamshire.gov.uk", + ), + ], + ), + ), + ( + "ehc_co", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="schools", + to="family_information.ehcco", + ), + ), + ], + bases=(wagtail.search.index.Indexed, models.Model), + ), + ] diff --git a/bc/family_information/migrations/0011_subsitehomepage_highlighted_cards_and_more.py b/bc/family_information/migrations/0011_subsitehomepage_highlighted_cards_and_more.py new file mode 100644 index 00000000..28594451 --- /dev/null +++ b/bc/family_information/migrations/0011_subsitehomepage_highlighted_cards_and_more.py @@ -0,0 +1,75 @@ +# Generated by Django 4.2.11 on 2024-06-14 09:20 + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("family_information", "0010_subsitehomepage_heading"), + ] + + operations = [ + migrations.AddField( + model_name="subsitehomepage", + name="highlighted_cards", + field=wagtail.fields.StreamField( + [ + ( + "two_card_row", + wagtail.blocks.StreamBlock( + [("card", wagtail.blocks.PageChooserBlock())] + ), + ), + ( + "three_card_row", + wagtail.blocks.StreamBlock( + [("card", wagtail.blocks.PageChooserBlock())] + ), + ), + ], + blank=True, + ), + ), + migrations.AddField( + model_name="subsitehomepage", + name="top_tasks_heading", + field=models.CharField( + blank=True, default="What do you want to do?", max_length=255 + ), + ), + migrations.CreateModel( + name="SubsiteHomePageTopTask", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ( + "source", + modelcluster.fields.ParentalKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="top_tasks", + to="family_information.subsitehomepage", + ), + ), + ], + options={ + "ordering": ["sort_order"], + "abstract": False, + }, + ), + ] diff --git a/bc/family_information/migrations/0012_subsitehomepagetoptask_top_task.py b/bc/family_information/migrations/0012_subsitehomepagetoptask_top_task.py new file mode 100644 index 00000000..c670c7e4 --- /dev/null +++ b/bc/family_information/migrations/0012_subsitehomepagetoptask_top_task.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.11 on 2024-06-14 09:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("utils", "0014_toptask"), + ("family_information", "0011_subsitehomepage_highlighted_cards_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="subsitehomepagetoptask", + name="top_task", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="utils.toptask", + ), + ), + ] diff --git a/bc/family_information/migrations/0013_categorypage_body_categorypage_top_tasks_heading_and_more.py b/bc/family_information/migrations/0013_categorypage_body_categorypage_top_tasks_heading_and_more.py new file mode 100644 index 00000000..12d53d97 --- /dev/null +++ b/bc/family_information/migrations/0013_categorypage_body_categorypage_top_tasks_heading_and_more.py @@ -0,0 +1,228 @@ +# Generated by Django 4.2.11 on 2024-06-18 11:35 + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("utils", "0014_toptask"), + ("family_information", "0012_subsitehomepagetoptask_top_task"), + ] + + operations = [ + migrations.AddField( + model_name="categorypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + icon="title", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [("card", wagtail.blocks.PageChooserBlock())] + ), + ), + ], + blank=True, + ), + ), + migrations.AddField( + model_name="categorypage", + name="top_tasks_heading", + field=models.CharField(default="What do you want to do?", max_length=255), + ), + migrations.AddField( + model_name="categorypage", + name="other_pages_heading", + field=models.CharField(default="Others", max_length=255), + ), + migrations.AddField( + model_name="categorytypeonepage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + icon="title", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [("card", wagtail.blocks.PageChooserBlock())] + ), + ), + ], + blank=True, + ), + ), + migrations.AddField( + model_name="categorytypeonepage", + name="top_tasks_heading", + field=models.CharField(default="What do you want to do?", max_length=255), + ), + migrations.AddField( + model_name="categorytypeonepage", + name="other_pages_heading", + field=models.CharField(default="Others", max_length=255), + ), + migrations.AddField( + model_name="categorytypetwopage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.CharBlock( + icon="title", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ( + "cards", + wagtail.blocks.StreamBlock( + [("card", wagtail.blocks.PageChooserBlock())] + ), + ), + ], + blank=True, + ), + ), + migrations.AddField( + model_name="categorytypetwopage", + name="top_tasks_heading", + field=models.CharField(default="What do you want to do?", max_length=255), + ), + migrations.AddField( + model_name="categorytypetwopage", + name="other_pages_heading", + field=models.CharField(default="Others", max_length=255), + ), + migrations.CreateModel( + name="CategoryTypeTwoPageTopTask", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ( + "source", + modelcluster.fields.ParentalKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="top_tasks", + to="family_information.categorytypetwopage", + ), + ), + ( + "top_task", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="utils.toptask", + ), + ), + ], + options={ + "ordering": ["sort_order"], + "abstract": False, + }, + ), + migrations.CreateModel( + name="CategoryTypeOnePageTopTask", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ( + "source", + modelcluster.fields.ParentalKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="top_tasks", + to="family_information.categorytypeonepage", + ), + ), + ( + "top_task", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="utils.toptask", + ), + ), + ], + options={ + "ordering": ["sort_order"], + "abstract": False, + }, + ), + migrations.CreateModel( + name="CategoryPageTopTask", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "sort_order", + models.IntegerField(blank=True, editable=False, null=True), + ), + ( + "source", + modelcluster.fields.ParentalKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="top_tasks", + to="family_information.categorypage", + ), + ), + ( + "top_task", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="+", + to="utils.toptask", + ), + ), + ], + options={ + "ordering": ["sort_order"], + "abstract": False, + }, + ), + ] diff --git a/bc/family_information/migrations/0013_merge_20240709_1253.py b/bc/family_information/migrations/0013_merge_20240709_1253.py new file mode 100644 index 00000000..17bedd55 --- /dev/null +++ b/bc/family_information/migrations/0013_merge_20240709_1253.py @@ -0,0 +1,13 @@ +# Generated by Django 4.2.11 on 2024-07-09 11:53 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("family_information", "0011_add_school_and_ehcco_models"), + ("family_information", "0012_subsitehomepagetoptask_top_task"), + ] + + operations = [] diff --git a/bc/family_information/migrations/0014_merge_20240709_1347.py b/bc/family_information/migrations/0014_merge_20240709_1347.py new file mode 100644 index 00000000..0e797c58 --- /dev/null +++ b/bc/family_information/migrations/0014_merge_20240709_1347.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.11 on 2024-07-09 12:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ( + "family_information", + "0013_categorypage_body_categorypage_top_tasks_heading_and_more", + ), + ("family_information", "0013_merge_20240709_1253"), + ] + + operations = [] diff --git a/bc/family_information/models.py b/bc/family_information/models.py index ce3f6325..15acdf33 100644 --- a/bc/family_information/models.py +++ b/bc/family_information/models.py @@ -3,14 +3,18 @@ from django.db import models from django.utils.functional import cached_property -from wagtail.admin.panels import FieldPanel, MultiFieldPanel +from modelcluster.fields import ParentalKey +from wagtail import blocks +from wagtail.admin.panels import FieldPanel, InlinePanel, MultiFieldPanel from wagtail.coreutils import resolve_model_string +from wagtail.fields import StreamField from wagtail.models import Page from wagtail.search import index from ..news.models import NewsIndex from ..standardpages.models import IndexPage -from ..utils.models import BasePage +from ..utils.models import BasePage, PageTopTask +from .blocks import CardsBlock, ThreeCardRowBlock, TwoCardRowBlock class FISBannerFields(models.Model): @@ -78,6 +82,10 @@ def has_banner_fields(self): ) +class SubsiteHomePageTopTask(PageTopTask): + source = ParentalKey("family_information.SubsiteHomePage", related_name="top_tasks") + + class SubsiteHomePage(FISBannerFields, BasePage): template = "patterns/pages/home/home_page--fis.html" @@ -85,6 +93,7 @@ class SubsiteHomePage(FISBannerFields, BasePage): is_pensions_site = models.BooleanField(default=False) + # Hero hero_image = models.ForeignKey( "images.CustomImage", null=True, @@ -94,6 +103,20 @@ class SubsiteHomePage(FISBannerFields, BasePage): description = models.TextField(blank=True) search_placeholder = models.CharField(max_length=100, blank=True) + # Top tasks + top_tasks_heading = models.CharField( + blank=True, default="What do you want to do?", max_length=255 + ) + + # Highlighted cards + highlighted_cards = StreamField( + [ + ("two_card_row", TwoCardRowBlock()), + ("three_card_row", ThreeCardRowBlock()), + ], + blank=True, + ) + heading = models.CharField( blank=True, default="Get information, advice and guidance", max_length=255 ) @@ -106,6 +129,7 @@ class SubsiteHomePage(FISBannerFields, BasePage): related_name="+", ) + # Footer search_prompt_text = models.TextField( blank=True, help_text="Text to prompt user to search" ) @@ -128,20 +152,32 @@ class SubsiteHomePage(FISBannerFields, BasePage): ], heading="Hero", ), + MultiFieldPanel( + [ + FieldPanel("top_tasks_heading", heading="Heading"), + InlinePanel("top_tasks", label="Tasks"), + ], + heading="Top tasks", + ), FieldPanel("heading"), + FieldPanel("highlighted_cards"), ] + FISBannerFields.content_panels + [FieldPanel("search_prompt_text"), FieldPanel("call_to_action")] ) @cached_property - def child_pages(self): - """Get child pages for the homepage listing. + def other_child_pages(self): + """Get child pages for the homepage listing excluding children that are already + in the highlighted_cards field. Returns a queryset of this page's live, public children, of the following page types - CategoryPage, CategoryTypeOnePage, CategoryTypeTwoPage, IndexPage, NewsIndex ordered by Wagtail explorer custom sort (ie. path). """ + highlighted_card_ids = [ + card.value.id for row in self.highlighted_cards for card in row.value + ] return ( Page.objects.child_of(self) .filter( @@ -154,6 +190,7 @@ def child_pages(self): ).values() ) .filter(show_in_menus=True) + .exclude(id__in=highlighted_card_ids) .live() .public() .specific() @@ -161,10 +198,77 @@ def child_pages(self): ) +class CategoryTypeOnePageTopTask(PageTopTask): + source = ParentalKey( + "family_information.CategoryTypeOnePage", related_name="top_tasks" + ) + + +class CategoryTypeTwoPageTopTask(PageTopTask): + source = ParentalKey( + "family_information.CategoryTypeTwoPage", related_name="top_tasks" + ) + + +class CategoryPageTopTask(PageTopTask): + source = ParentalKey("family_information.CategoryPage", related_name="top_tasks") + + class BaseCategoryPage(FISBannerFields, BasePage): parent_page_types = ["SubsiteHomePage"] - content_panels = BasePage.content_panels + FISBannerFields.content_panels + # Top tasks + top_tasks_heading = models.CharField( + default="What do you want to do?", max_length=255 + ) + + # Content + body = StreamField( + [ + ( + "heading", + blocks.CharBlock( + icon="title", + template="patterns/molecules/streamfield/blocks/heading_block.html", + ), + ), + ("cards", CardsBlock()), + ], + blank=True, + ) + + # Other child pages + other_pages_heading = models.CharField(default="Others", max_length=255) + + content_panels = ( + BasePage.content_panels + + [ + MultiFieldPanel( + [ + FieldPanel("top_tasks_heading", heading="Heading"), + InlinePanel("top_tasks", label="Tasks"), + ], + heading="Top tasks", + ), + FieldPanel( + "body", + help_text=( + "This replaces the full list of child pages. Any child pages not " + "listed in this field will be displayed under the 'Other pages' " + "section." + ), + ), + FieldPanel( + "other_pages_heading", + help_text=( + "Any child pages not added to the Body field will be displayed " + "below this heading. (If the Body field is blank, this heading " + " isn't displayed.)" + ), + ), + ] + + FISBannerFields.content_panels + ) search_fields = BasePage.search_fields + FISBannerFields.search_fields class Meta: @@ -177,8 +281,43 @@ def allowed_subpage_models(cls): ] @cached_property - def child_pages(self): - return self.get_children().live().public().specific().order_by("path") + def other_child_pages(self): + """Get child pages for the current category page, excluding children that are + already in the body field. + """ + selected_card_ids = [ + card.value.id + for row in self.body + for card in row.value + if row.block_type == "cards" + ] + return ( + self.get_children() + .exclude(id__in=selected_card_ids) + .live() + .public() + .specific() + .order_by("path") + ) + + def get_context(self, request, *args, **kwargs): + context = super().get_context(request, *args, **kwargs) + + # Get a list of all blocks that are below a heading block. + context["blocks_under_headings"] = [] + has_heading = False + for item in self.body: + if item.block_type == "heading": + has_heading = True + elif has_heading: + context["blocks_under_headings"].append(item.value) + + # Show the other_pages_heading field? + context["show_other_pages_heading"] = ( + self.other_pages_heading and self.body and self.other_child_pages + ) + + return context class CategoryTypeOnePage(BaseCategoryPage): @@ -192,12 +331,36 @@ class CategoryTypeTwoPage(BaseCategoryPage): class CategoryPage(BaseCategoryPage): - template = "patterns/pages/standardpages/index_page--fis-cat.html" display_banner_at_top = models.BooleanField(default=False) content_panels = ( BasePage.content_panels - + [FieldPanel("display_banner_at_top")] + + [ + FieldPanel("display_banner_at_top"), + MultiFieldPanel( + [ + FieldPanel("top_tasks_heading", heading="Heading"), + InlinePanel("top_tasks", label="Tasks"), + ], + heading="Top tasks", + ), + FieldPanel( + "body", + help_text=( + "This replaces the full list of child pages. Any child pages not " + "listed in this field will be displayed under the 'Other pages' " + "section." + ), + ), + FieldPanel( + "other_pages_heading", + help_text=( + "Any child pages not added to the Body field will be displayed " + "below this heading. (If the Body field is blank, this heading " + " isn't displayed.)" + ), + ), + ] + FISBannerFields.content_panels ) @@ -206,3 +369,59 @@ def get_template(self, request, *args, **kwargs): return "patterns/pages/standardpages/index_page--fis-cat2.html" else: return "patterns/pages/standardpages/index_page--fis-cat1.html" + + +class School(index.Indexed, models.Model): + class HubEmail(models.TextChoices): + SENSCB = "sencsb@buckinghamshire.gov.uk", "sencsb@buckinghamshire.gov.uk" + SENWYC = "senwyc@buckinghamshire.gov.uk", "senwyc@buckinghamshire.gov.uk" + SENAYLESBURY = ( + "Senaylesbury@buckinghamshire.gov.uk", + "Senaylesbury@buckinghamshire.gov.uk", + ) + + name = models.TextField() + hub_email = models.CharField( + choices=HubEmail.choices, + blank=True, + ) + ehc_co = models.ForeignKey( + "family_information.EHCCo", + on_delete=models.SET_NULL, + blank=True, + null=True, + related_name="schools", + ) + + def clean(self) -> None: + super().clean() + if not (self.hub_email or self.ehc_co): + raise ValidationError( + { + "hub_email": "Either hub email or EHCCo should be filled", + "ehc_co": "Either hub email or EHCCo should be filled", + } + ) + + search_fields = [ + index.AutocompleteField("name"), + ] + + def __str__(self): + return self.name + + +class EHCCo(index.Indexed, models.Model): + name = models.CharField(max_length=255) + email = models.EmailField() + + def __str__(self): + return self.name + + search_fields = [ + index.SearchField("name"), + ] + + class Meta: + verbose_name = "EHCCo" + verbose_name_plural = "EHCCos" diff --git a/bc/family_information/urls.py b/bc/family_information/urls.py new file mode 100644 index 00000000..5bc5fc05 --- /dev/null +++ b/bc/family_information/urls.py @@ -0,0 +1,14 @@ +from django.urls import path + +from bc.family_information.views import get_corresponding_ehc_co, get_matching_schools + +urlpatterns = [ + path("school/", get_matching_schools, name="get_matching_schools"), + path( + "ehcco/", + get_corresponding_ehc_co, + name="get_corresponding_ehc_co", + ), +] + +app_name = "family_information" diff --git a/bc/family_information/views.py b/bc/family_information/views.py new file mode 100644 index 00000000..26fa51b1 --- /dev/null +++ b/bc/family_information/views.py @@ -0,0 +1,52 @@ +from django.http import JsonResponse +from django.shortcuts import get_object_or_404 + +from wagtail.admin.viewsets.chooser import ChooserViewSet +from wagtail.search.backends import get_search_backend + +from bc.family_information.models import School + + +class EHCCoChooserViewSet(ChooserViewSet): + model = "family_information.EHCCo" + + icon = "user" + choose_one_text = "Choose an EHC Co" + choose_another_text = "Choose another EHC Co" + edit_item_text = "Edit this EHC Co" + form_fields = ["name", "email"] + url_filter_parameters = ["name", "email"] + + +ehc_co_chooser_viewset = EHCCoChooserViewSet("ehc_co_chooser") + + +def get_matching_schools(request): + """Return a list of schools that match the query string.""" + q = request.GET.get("q", "") + search_backend = get_search_backend() + + results = search_backend.autocomplete(q, School) + + return JsonResponse( + [{"id": school.id, "text": school.name} for school in results], + safe=False, + ) + + +def get_corresponding_ehc_co(request): + """Return the name and email of the EHC Co for the given school.""" + school_id = request.GET.get("school_id", "") + school = get_object_or_404(School, id=school_id) + ehc_co = school.ehc_co + if ehc_co: + context = { + "name": ehc_co.name, + "email": ehc_co.email, + } + else: + context = { + "name": "TBC", + "email": school.hub_email, + } + return JsonResponse(context) diff --git a/bc/family_information/wagtail_hooks.py b/bc/family_information/wagtail_hooks.py new file mode 100644 index 00000000..18fb1a40 --- /dev/null +++ b/bc/family_information/wagtail_hooks.py @@ -0,0 +1,34 @@ +from wagtail import hooks + +from wagtail_modeladmin.options import ModelAdmin, ModelAdminGroup, modeladmin_register + +from bc.family_information.models import EHCCo, School +from bc.family_information.views import ehc_co_chooser_viewset + + +class EHCCoModelAdmin(ModelAdmin): + model = EHCCo + menu_icon = "user" + list_display = ("name", "email") + search_fields = ("name", "email") + + +class SchoolModelAdmin(ModelAdmin): + model = School + menu_icon = "tag" + list_display = ("name", "hub_email", "ehc_co") + list_filter = ("hub_email", "ehc_co") + + +class SchoolsAdminGroup(ModelAdminGroup): + menu_label = "Schools" + items = [SchoolModelAdmin, EHCCoModelAdmin] + menu_icon = "tag" + + +modeladmin_register(SchoolsAdminGroup) + + +@hooks.register("register_admin_viewset") +def register_viewset(): + return ehc_co_chooser_viewset diff --git a/bc/inlineindex/migrations/0035_add_ehcco_search_widget.py b/bc/inlineindex/migrations/0035_add_ehcco_search_widget.py new file mode 100644 index 00000000..3a311615 --- /dev/null +++ b/bc/inlineindex/migrations/0035_add_ehcco_search_widget.py @@ -0,0 +1,1070 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("inlineindex", "0034_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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"), + ), + ( + "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" + ), + ), + ], + 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/0016_add_ehcco_search_widget.py b/bc/location/migrations/0016_add_ehcco_search_widget.py new file mode 100644 index 00000000..9ec7b61b --- /dev/null +++ b/bc/location/migrations/0016_add_ehcco_search_widget.py @@ -0,0 +1,1599 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("location", "0015_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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"), + ), + ( + "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" + ), + ), + ], + 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"), + ), + ( + "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" + ), + ), + ], + 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/0029_add_ehcco_search_widget.py b/bc/longform/migrations/0029_add_ehcco_search_widget.py new file mode 100644 index 00000000..322b7ac5 --- /dev/null +++ b/bc/longform/migrations/0029_add_ehcco_search_widget.py @@ -0,0 +1,1135 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.longform.blocks +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("longform", "0028_tableblock_help_text"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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"), + ), + ( + "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" + ), + ), + ], + 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/0034_add_ehcco_search_widget.py b/bc/news/migrations/0034_add_ehcco_search_widget.py new file mode 100644 index 00000000..0516b047 --- /dev/null +++ b/bc/news/migrations/0034_add_ehcco_search_widget.py @@ -0,0 +1,545 @@ +# Generated by Django 4.2.11 on 2024-06-07 12:39 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import bc.utils.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ("news", "0033_django_40_upgrade"), + ] + + 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"), + ), + ( + "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" + ), + ), + ], + 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/sprites/sprites.html b/bc/project_styleguide/templates/patterns/atoms/sprites/sprites.html index 87625b81..86e34940 100644 --- a/bc/project_styleguide/templates/patterns/atoms/sprites/sprites.html +++ b/bc/project_styleguide/templates/patterns/atoms/sprites/sprites.html @@ -13,10 +13,6 @@ - - - - @@ -34,6 +30,10 @@ + + + + @@ -59,8 +59,8 @@ - - + + @@ -84,4 +84,8 @@ + + + + diff --git a/bc/project_styleguide/templates/patterns/molecules/alerts/alert-message-sitewide.html b/bc/project_styleguide/templates/patterns/molecules/alerts/alert-message-sitewide.html index 81bfe69c..f63c28e2 100644 --- a/bc/project_styleguide/templates/patterns/molecules/alerts/alert-message-sitewide.html +++ b/bc/project_styleguide/templates/patterns/molecules/alerts/alert-message-sitewide.html @@ -1,7 +1,7 @@ {% load wagtailcore_tags %}
-

{{ alert.title }}

+

{{ alert.title }}

{{ alert.content|richtext }}
diff --git a/bc/project_styleguide/templates/patterns/molecules/blogs-social-section/blogs-social-section.html b/bc/project_styleguide/templates/patterns/molecules/blogs-social-section/blogs-social-section.html index d4bbdd2b..8acf421f 100644 --- a/bc/project_styleguide/templates/patterns/molecules/blogs-social-section/blogs-social-section.html +++ b/bc/project_styleguide/templates/patterns/molecules/blogs-social-section/blogs-social-section.html @@ -5,9 +5,9 @@