" for p in o.description_text])))
-
- # Lazy Values
- description_text = description_faker
diff --git a/network-api/networkapi/donate/factory/help_page.py b/network-api/networkapi/donate/factory/help_page.py
index b5c927b34f3..985a0e2da11 100644
--- a/network-api/networkapi/donate/factory/help_page.py
+++ b/network-api/networkapi/donate/factory/help_page.py
@@ -1,8 +1,7 @@
-import wagtail_factories
from factory import Faker, SubFactory
from wagtail_factories import PageFactory
-from networkapi.donate.factory.customblocks.notice_block import NoticeBlockFactory
+from networkapi.donate.factory.snippets.help_page_notice import HelpPageNoticeFactory
from networkapi.donate.models import DonateHelpPage, DonateLandingPage
from networkapi.utility.faker import StreamfieldProvider
from networkapi.utility.faker.helpers import reseed
@@ -18,7 +17,7 @@ class Meta:
title = Faker("sentence", nb_words=2)
body = Faker("streamfield", fields=streamfield_fields)
- notice = wagtail_factories.StreamFieldFactory({"notice": SubFactory(NoticeBlockFactory)})
+ notice = SubFactory(HelpPageNoticeFactory)
def generate(seed):
@@ -26,4 +25,4 @@ def generate(seed):
print("Generating a Help page")
home_page = DonateLandingPage.objects.get(title="Donate Now")
- DonateHelpPageFactory(parent=home_page, title="Donate Help", slug="help", notice__0="notice")
+ DonateHelpPageFactory(parent=home_page, title="Donate Help", slug="help")
diff --git a/network-api/networkapi/donate/tests/customblocks/__init__.py b/network-api/networkapi/donate/factory/snippets/__init__.py
similarity index 100%
rename from network-api/networkapi/donate/tests/customblocks/__init__.py
rename to network-api/networkapi/donate/factory/snippets/__init__.py
diff --git a/network-api/networkapi/donate/factory/snippets/help_page_notice.py b/network-api/networkapi/donate/factory/snippets/help_page_notice.py
new file mode 100644
index 00000000000..7ecce5f3952
--- /dev/null
+++ b/network-api/networkapi/donate/factory/snippets/help_page_notice.py
@@ -0,0 +1,22 @@
+import factory
+from factory import Faker, LazyAttribute
+from wagtail.rich_text import RichText
+from wagtail_factories import ImageFactory
+
+from networkapi.donate.snippets.help_page_notice import HelpPageNotice
+
+notice_text_contents = Faker("paragraph", nb_sentences=3, variable_nb_sentences=False)
+
+
+class HelpPageNoticeFactory(factory.django.DjangoModelFactory):
+ class Meta:
+ model = HelpPageNotice
+ exclude = ("notice_text",)
+
+ name = Faker("sentence", nb_words=3)
+ text = LazyAttribute(lambda o: RichText(f"
{o.notice_text}
"))
+ notice_image = factory.SubFactory(ImageFactory)
+ notice_image_alt_text = Faker("sentence", nb_words=4)
+
+ # Lazy Values
+ notice_text = notice_text_contents
diff --git a/network-api/networkapi/donate/factory/ways_to_give_page.py b/network-api/networkapi/donate/factory/ways_to_give_page.py
new file mode 100644
index 00000000000..ddf69ef3bff
--- /dev/null
+++ b/network-api/networkapi/donate/factory/ways_to_give_page.py
@@ -0,0 +1,28 @@
+from factory import Faker
+from wagtail_factories import PageFactory
+
+from networkapi.donate.models import DonateLandingPage
+from networkapi.utility.faker import StreamfieldProvider
+from networkapi.utility.faker.helpers import reseed
+from networkapi.wagtailpages.models import OpportunityPage
+
+Faker.add_provider(StreamfieldProvider)
+
+streamfield_fields = ["paragraph", "linkbutton", "spacer", "quote"]
+
+
+class DonateWaysToGivePageFactory(PageFactory):
+ class Meta:
+ # Using OpportunityPage AKA "Default Page" model
+ model = OpportunityPage
+
+ title = Faker("sentence", nb_words=2)
+ body = Faker("streamfield", fields=streamfield_fields)
+
+
+def generate(seed):
+ reseed(seed)
+
+ print('Generating a Donate "Ways to give" page')
+ donate_home_page = DonateLandingPage.objects.get(title="Donate Now")
+ DonateWaysToGivePageFactory(parent=donate_home_page, title="Ways to Give", header="", slug="ways-to-give")
diff --git a/network-api/networkapi/donate/migrations/0006_add_linkblock_to_linkbuttonblock.py b/network-api/networkapi/donate/migrations/0006_add_linkblock_to_linkbuttonblock.py
index 7c3426592b1..b8a7500dff5 100644
--- a/network-api/networkapi/donate/migrations/0006_add_linkblock_to_linkbuttonblock.py
+++ b/network-api/networkapi/donate/migrations/0006_add_linkblock_to_linkbuttonblock.py
@@ -344,9 +344,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
@@ -1179,7 +1177,7 @@ class Migration(migrations.Migration):
max_length=300,
required=False,
validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
],
),
),
diff --git a/network-api/networkapi/donate/migrations/0008_remove_old_url_fields_from_linkblock.py b/network-api/networkapi/donate/migrations/0008_remove_old_url_fields_from_linkblock.py
index 89a1044505c..7b0e6cf1fa0 100644
--- a/network-api/networkapi/donate/migrations/0008_remove_old_url_fields_from_linkblock.py
+++ b/network-api/networkapi/donate/migrations/0008_remove_old_url_fields_from_linkblock.py
@@ -344,9 +344,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
@@ -1178,7 +1176,7 @@ class Migration(migrations.Migration):
max_length=300,
required=False,
validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
],
),
),
diff --git a/network-api/networkapi/donate/migrations/0009_set_relative_url_on_linkblock.py b/network-api/networkapi/donate/migrations/0009_set_relative_url_on_linkblock.py
new file mode 100644
index 00000000000..d79fdd784de
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0009_set_relative_url_on_linkblock.py
@@ -0,0 +1,33 @@
+# Generated by Django 4.2.10 on 2024-02-27 12:28
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_linkbuttonblock(source_block):
+ source_block["value"]["relative_url"] = ""
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0008_remove_old_url_fields_from_linkblock"),
+ ("wagtailcore", "0089_log_entry_data_json_null_to_object"),
+ ]
+
+ operations = [
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock),
+ "block_with_aside.aside",
+ ),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0010_make_link_to_required_in_link_block.py b/network-api/networkapi/donate/migrations/0010_make_link_to_required_in_link_block.py
new file mode 100644
index 00000000000..1c00567c80b
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0010_make_link_to_required_in_link_block.py
@@ -0,0 +1,1348 @@
+# Generated by Django 4.2.10 on 2024-03-21 18:45
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0009_set_relative_url_on_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0011_update_donatehelppage_notice.py b/network-api/networkapi/donate/migrations/0011_update_donatehelppage_notice.py
new file mode 100644
index 00000000000..01b06bde38f
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0011_update_donatehelppage_notice.py
@@ -0,0 +1,68 @@
+# Generated by Django 4.2.11 on 2024-05-22 22:22
+
+import uuid
+
+import django.db.models.deletion
+import wagtail.fields
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0010_make_link_to_required_in_link_block"),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name="donatehelppage",
+ name="notice",
+ ),
+ migrations.CreateModel(
+ name="HelpPageNotice",
+ fields=[
+ ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
+ ("translation_key", models.UUIDField(default=uuid.uuid4, editable=False)),
+ ("name", models.CharField(help_text="What will this notice be called in the CMS?", max_length=50)),
+ ("text", wagtail.fields.RichTextField()),
+ (
+ "notice_image_alt_text",
+ models.CharField(blank=True, help_text="Image description (for screen readers).", max_length=50),
+ ),
+ (
+ "locale",
+ models.ForeignKey(
+ editable=False,
+ on_delete=django.db.models.deletion.PROTECT,
+ related_name="+",
+ to="wagtailcore.locale",
+ ),
+ ),
+ (
+ "notice_image",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ to="wagtailimages.image",
+ verbose_name="Notice Image",
+ ),
+ ),
+ ],
+ options={
+ "abstract": False,
+ "unique_together": {("translation_key", "locale")},
+ },
+ ),
+ migrations.AddField(
+ model_name="donatehelppage",
+ name="notice",
+ field=models.ForeignKey(
+ blank=True,
+ help_text="Optional notice that will render at the top of the page.",
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ to="donate.helppagenotice",
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0012_update_annotatedimageblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0012_update_annotatedimageblock_with_linkblock.py
new file mode 100644
index 00000000000..20e841cd322
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0012_update_annotatedimageblock_with_linkblock.py
@@ -0,0 +1,2863 @@
+# Generated by Django 4.2.11 on 2024-06-12 21:42
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_block(source_block):
+ new_value = {
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText", ""),
+ "caption": source_block["value"].get("caption", ""),
+ "caption_url": [],
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"]["captionURL"],
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0011_update_donatehelppage_notice"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image", operation=migrate_image_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0013_update_iframeblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0013_update_iframeblock_with_linkblock.py
new file mode 100644
index 00000000000..f55e9ac769d
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0013_update_iframeblock_with_linkblock.py
@@ -0,0 +1,3019 @@
+# Generated by Django 4.2.11 on 2024-06-24 21:38
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_iframe_block(source_block):
+ new_value = {
+ "url": source_block["value"].get("url"),
+ "height": source_block["value"].get("height"),
+ "caption": source_block["value"].get("caption"),
+ "caption_url": [],
+ "iframe_width": source_block["value"].get("iframe_width"),
+ "disable_scroll": source_block["value"].get("disable_scroll"),
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"].get("captionURL"),
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0012_update_annotatedimageblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="iframe", operation=migrate_iframe_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0014_update_imagetextblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0014_update_imagetextblock_with_linkblock.py
new file mode 100644
index 00000000000..5657bcf4dbb
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0014_update_imagetextblock_with_linkblock.py
@@ -0,0 +1,1632 @@
+# Generated by Django 4.2.11 on 2024-06-27 22:53
+
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_text_block(source_block):
+ new_value = {
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText"),
+ "text": source_block["value"].get("text"),
+ "url": [],
+ "top_divider": source_block["value"].get("top_divider", False),
+ "bottom_divider": source_block["value"].get("bottom_divider", False),
+ }
+
+ old_url = source_block["value"].get("url")
+
+ # Regex patterns for detecting URLs and emails
+ url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+ email_pattern = re.compile(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")
+
+ if old_url:
+ if url_pattern.match(old_url):
+ new_value["url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+ elif email_pattern.match(old_url):
+ new_value["url"] = [
+ {
+ "link_to": "email",
+ "email": old_url,
+ "new_window": False,
+ }
+ ]
+
+ source_block["value"] = new_value
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0013_update_iframeblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image_text", operation=migrate_image_text_block), ""),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0015_update_videoblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0015_update_videoblock_with_linkblock.py
new file mode 100644
index 00000000000..7b4aaabfed0
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0015_update_videoblock_with_linkblock.py
@@ -0,0 +1,3526 @@
+# Generated by Django 4.2.11 on 2024-07-03 00:30
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_video_block(source_block):
+ new_value = {
+ "url": source_block["value"].get("url"),
+ "caption": source_block["value"].get("caption"),
+ "caption_url": [],
+ "video_width": source_block["value"].get("video_width"),
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"].get("captionURL"),
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0014_update_imagetextblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="donatehelppage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="video", operation=migrate_video_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0016_update_imageteaserblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0016_update_imageteaserblock_with_linkblock.py
new file mode 100644
index 00000000000..9b38e5bf730
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0016_update_imageteaserblock_with_linkblock.py
@@ -0,0 +1,3699 @@
+# Generated by Django 4.2.14 on 2024-07-15 23:38
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_teaser_block(source_block):
+ new_value = {
+ "title": source_block["value"].get("title", ""),
+ "text": source_block["value"].get("text", ""),
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText", ""),
+ "link": [],
+ "styling": source_block["value"].get("styling", "btn-primary"),
+ "top_divider": source_block["value"].get("top_divider", False),
+ "bottom_divider": source_block["value"].get("bottom_divider", False),
+ }
+ if "url" in source_block["value"] and source_block["value"]["url"]:
+ new_value["link_button"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"]["url"],
+ "label": source_block["value"].get("url_label", ""),
+ "new_window": True,
+ "styling": source_block["value"].get("styling", "btn-primary"),
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0015_update_videoblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_teaser_block", operation=migrate_image_teaser_block
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0017_update_grouplistingblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0017_update_grouplistingblock_with_linkblock.py
new file mode 100644
index 00000000000..994d4a27ad2
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0017_update_grouplistingblock_with_linkblock.py
@@ -0,0 +1,3843 @@
+# Generated by Django 4.2.14 on 2024-07-17 01:24
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_group_listing_block_cards(source_block):
+
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+
+ old_url = card["value"].get("url")
+ if old_url:
+ card["value"]["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0016_update_imageteaserblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="group_listing_block", operation=migrate_group_listing_block_cards
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0018_update_imagegridblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0018_update_imagegridblock_with_linkblock.py
new file mode 100644
index 00000000000..eadf4000392
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0018_update_imagegridblock_with_linkblock.py
@@ -0,0 +1,4020 @@
+# Generated by Django 4.2.14 on 2024-07-17 22:52
+
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+# Regex pattern for detecting URLs (including those without protocol)
+url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+# Regex pattern for detecting emails
+email_pattern = re.compile(r"^mailto:")
+
+
+def migrate_image_grid_block(source_block):
+ if "grid_items" in source_block["value"]:
+ for item in source_block["value"]["grid_items"]:
+ item_value = item.get("value", item)
+ old_url = item_value.get("url")
+ if old_url:
+ if url_pattern.match(old_url):
+ item_value["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+ elif email_pattern.match(old_url):
+ email_address = old_url.replace("mailto:", "")
+ item_value["link"] = [
+ {
+ "link_to": "email",
+ "email": email_address,
+ "new_window": False,
+ }
+ ]
+ elif old_url.startswith("/"):
+ item_value["link"] = [
+ {
+ "link_to": "relative_url",
+ "relative_url": old_url,
+ "new_window": False,
+ }
+ ]
+ item = item_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0017_update_grouplistingblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="donatehelppage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image_grid", operation=migrate_image_grid_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0019_update_listingblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0019_update_listingblock_with_linkblock.py
new file mode 100644
index 00000000000..005d694b80f
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0019_update_listingblock_with_linkblock.py
@@ -0,0 +1,4357 @@
+# Generated by Django 4.2.14 on 2024-07-19 00:13
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_listing_card_links(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+ new_link = []
+
+ link_page = card_value.get("link_page")
+ if link_page:
+ new_link.append(
+ {
+ "link_to": "page",
+ "page": link_page,
+ "new_window": False,
+ }
+ )
+
+ link_url = card_value.get("link_url")
+ if link_url:
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ }
+ )
+
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0018_update_imagegridblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="donatehelppage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="listing", operation=migrate_listing_card_links), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="listing", operation=migrate_listing_card_links),
+ "block_with_aside.content",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0020_update_textonlyteaserblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0020_update_textonlyteaserblock_with_linkblock.py
new file mode 100644
index 00000000000..cb35cac39a3
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0020_update_textonlyteaserblock_with_linkblock.py
@@ -0,0 +1,4486 @@
+# Generated by Django 4.2.14 on 2024-07-19 02:44
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_text_only_teaser_block(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+
+ # Prepare the new link field
+ new_link = []
+
+ # Migrate link_page to the new link field
+ link_page = card_value.get("link_page")
+ if link_page:
+ new_link.append({"link_to": "page", "page": link_page, "new_window": False})
+
+ # Migrate link_url to the new link field
+ link_url = card_value.get("link_url")
+ if link_url:
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ }
+ )
+
+ # Update the card value with the new link
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0019_update_listingblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="text_only_teaser", operation=migrate_text_only_teaser_block
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0021_format_linkblock_empty_values.py b/network-api/networkapi/donate/migrations/0021_format_linkblock_empty_values.py
new file mode 100644
index 00000000000..85e42e4ce4b
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0021_format_linkblock_empty_values.py
@@ -0,0 +1,73 @@
+# Generated by Django 4.2.14 on 2024-07-22 14:02
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def format_image_grid_block_items_empty_values(source_block):
+ if "grid_items" in source_block["value"]:
+ for item in source_block["value"]["grid_items"]:
+ item_value = item.get("value", item)
+ link_value = item_value.get("link", None)
+
+ if not link_value:
+ item_value["link"] = []
+
+ return source_block
+
+
+def format_image_teaser_block_empty_value(source_block):
+ link_button_value = source_block["value"].get("link_button", None)
+
+ if not link_button_value:
+ source_block["value"]["link_button"] = []
+
+ return source_block
+
+
+def format_group_listing_block_cards_empty_values(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+ link_value = card_value.get("link", None)
+
+ if not link_value:
+ card_value["link"] = []
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0020_update_textonlyteaserblock_with_linkblock"),
+ ]
+
+ operations = [
+ MigrateStreamData(
+ app_name="donate",
+ model_name="donatehelppage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_grid", operation=format_image_grid_block_items_empty_values
+ ),
+ "",
+ ),
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_teaser_block", operation=format_image_teaser_block_empty_value
+ ),
+ "",
+ ),
+ (
+ AlterStreamChildBlockDataOperation(
+ block="group_listing_block", operation=format_group_listing_block_cards_empty_values
+ ),
+ "",
+ ),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0022_update_baselinkblock_relative_link_validation.py b/network-api/networkapi/donate/migrations/0022_update_baselinkblock_relative_link_validation.py
new file mode 100644
index 00000000000..5fcffe324a9
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0022_update_baselinkblock_relative_link_validation.py
@@ -0,0 +1,2225 @@
+# Generated by Django 4.2.14 on 2024-07-23 01:17
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0021_format_linkblock_empty_values"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0023_update_cardgridblock_with_linkblock.py b/network-api/networkapi/donate/migrations/0023_update_cardgridblock_with_linkblock.py
new file mode 100644
index 00000000000..76e8574d481
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0023_update_cardgridblock_with_linkblock.py
@@ -0,0 +1,4637 @@
+# Generated by Django 4.2.14 on 2024-07-23 01:40
+
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+# Regex pattern for detecting URLs (including those without protocol)
+url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+
+
+def migrate_card_grid_block_cards(source_block):
+
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+
+ card_value = card.get("value", card)
+ new_link = []
+
+ link_url = card_value.get("link_url")
+ link_label = card_value.get("link_label")
+
+ if link_url and link_label:
+ if url_pattern.match(link_url):
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ "label": link_label,
+ }
+ )
+ else:
+ new_link.append(
+ {
+ "link_to": "relative_url",
+ "relative_url": link_url,
+ "new_window": False,
+ "label": link_label,
+ }
+ )
+
+ # Update the card value with the new link
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("donate", "0022_update_baselinkblock_relative_link_validation"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="donate",
+ model_name="DonateHelpPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="card_grid", operation=migrate_card_grid_block_cards), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "typeform",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "embed_id",
+ wagtail.blocks.CharBlock(
+ help_text="The embed id of your Typeform page (e.g. if the form is on admin.typeform.com/form/e8zScc6t, the id will be: e8zScc6t)",
+ required=True,
+ ),
+ ),
+ (
+ "button_type",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "button_text",
+ wagtail.blocks.CharBlock(
+ help_text="This is a text prompt for users to open the typeform content",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/migrations/0024_alter_donatehelppage_body.py b/network-api/networkapi/donate/migrations/0024_alter_donatehelppage_body.py
new file mode 100644
index 00000000000..11c01785e8e
--- /dev/null
+++ b/network-api/networkapi/donate/migrations/0024_alter_donatehelppage_body.py
@@ -0,0 +1,2266 @@
+# Generated by Django 4.2.15 on 2024-08-12 23:42
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("donate", "0023_update_cardgridblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="donatehelppage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "pulse_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "search_terms",
+ wagtail.blocks.CharBlock(
+ help_text="Test your search at mozillapulse.org/search",
+ label="Search",
+ required=False,
+ ),
+ ),
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=6,
+ help_text="Choose 1-12. If you want visitors to see more, link to a search or tag on Pulse.",
+ max_value=12,
+ min_value=0,
+ required=True,
+ ),
+ ),
+ (
+ "only_featured_entries",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Featured items are selected by Pulse moderators.",
+ label="Display only featured entries",
+ required=False,
+ ),
+ ),
+ (
+ "newest_first",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("True", "Show newer entries first"),
+ ("False", "Show older entries first"),
+ ],
+ label="Sort",
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "issues",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Decentralization", "Decentralization"),
+ ("Digital Inclusion", "Digital Inclusion"),
+ ("Online Privacy & Security", "Online Privacy & Security"),
+ ("Open Innovation", "Open Innovation"),
+ ("Web Literacy", "Web Literacy"),
+ ]
+ ),
+ ),
+ (
+ "help",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("all", "All"),
+ ("Attend", "Attend"),
+ ("Create content", "Create content"),
+ ("Code", "Code"),
+ ("Design", "Design"),
+ ("Fundraise", "Fundraise"),
+ ("Join community", "Join community"),
+ ("Localize & translate", "Localize & translate"),
+ ("Mentor", "Mentor"),
+ ("Plan & organize", "Plan & organize"),
+ ("Promote", "Promote"),
+ ("Take action", "Take action"),
+ ("Test & feedback", "Test & feedback"),
+ ("Write documentation", "Write documentation"),
+ ],
+ label="Type of help needed",
+ ),
+ ),
+ (
+ "direct_link",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text="Checked: user goes to project link. Unchecked: user goes to pulse entry",
+ label="Direct link",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "airtable",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="Copied from the Airtable embed code. The word 'embed' will be in the url"
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ default=533,
+ help_text="The pixel height on desktop view, usually copied from the Airtable embed code",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "article_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "article",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ page_type=["wagtailpages.ArticlePage"],
+ required=False,
+ ),
+ )
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ blank=True,
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/donate/pagemodels/customblocks/notice_block.py b/network-api/networkapi/donate/pagemodels/customblocks/notice_block.py
deleted file mode 100644
index 022fc110346..00000000000
--- a/network-api/networkapi/donate/pagemodels/customblocks/notice_block.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from django.forms.utils import ErrorList
-from wagtail import blocks
-from wagtail.blocks.struct_block import StructBlockValidationError
-from wagtail.images.blocks import ImageChooserBlock
-
-from networkapi.wagtailpages.pagemodels.customblocks.base_rich_text_options import (
- base_rich_text_options,
-)
-
-
-class NoticeBlock(blocks.StructBlock):
- image = ImageChooserBlock(required=False)
- image_alt_text = blocks.CharBlock(required=False, help_text="Image description (for screen readers).")
- text = blocks.RichTextBlock(features=base_rich_text_options)
-
- class Meta:
- icon = "doc-full"
- template = "donate/blocks/notice_block.html"
-
- def clean(self, value):
- cleaned_data = super().clean(value)
- errors = {}
-
- if cleaned_data["image"] and not cleaned_data["image_alt_text"]:
- errors["image"] = ErrorList(["Image must include alt text."])
- if cleaned_data["image_alt_text"] and not cleaned_data["image"]:
- errors["image_alt_text"] = ErrorList(["Alt text must have an associated image."])
- if errors:
- raise StructBlockValidationError(block_errors=errors)
-
- return cleaned_data
diff --git a/network-api/networkapi/donate/pagemodels/help_page.py b/network-api/networkapi/donate/pagemodels/help_page.py
index c4a32ed2f52..c7a7b4272fb 100644
--- a/network-api/networkapi/donate/pagemodels/help_page.py
+++ b/network-api/networkapi/donate/pagemodels/help_page.py
@@ -1,12 +1,13 @@
from urllib.parse import urlencode
+from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from wagtail.models import Page
from wagtail_localize.fields import SynchronizedField, TranslatableField
from networkapi.donate.models import BaseDonationPage
-from networkapi.donate.pagemodels.customblocks.notice_block import NoticeBlock
+from networkapi.donate.snippets.help_page_notice import HelpPageNotice
from networkapi.wagtailpages.pagemodels.customblocks.base_fields import base_fields
@@ -19,12 +20,12 @@ class DonateHelpPage(BaseDonationPage):
max_count = 1
- notice = StreamField(
- [("notice", NoticeBlock())],
- help_text="Optional notice that will render at the top of the page.",
+ notice = models.ForeignKey(
+ HelpPageNotice,
+ null=True,
blank=True,
- max_num=1,
- use_json_field=True,
+ on_delete=models.SET_NULL,
+ help_text="Optional notice that will render at the top of the page.",
)
body = StreamField(base_fields, blank=True, use_json_field=True)
diff --git a/network-api/networkapi/donate/snippets/__init__.py b/network-api/networkapi/donate/snippets/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/network-api/networkapi/donate/snippets/help_page_notice.py b/network-api/networkapi/donate/snippets/help_page_notice.py
new file mode 100644
index 00000000000..fd1bb3e2386
--- /dev/null
+++ b/network-api/networkapi/donate/snippets/help_page_notice.py
@@ -0,0 +1,53 @@
+from django.core.exceptions import ValidationError
+from django.db import models
+from wagtail.admin.panels import FieldPanel
+from wagtail.fields import RichTextField
+from wagtail.models import TranslatableMixin
+from wagtail_localize.fields import SynchronizedField, TranslatableField
+
+from networkapi.wagtailpages.pagemodels.customblocks.base_rich_text_options import (
+ base_rich_text_options,
+)
+
+
+class HelpPageNotice(TranslatableMixin, models.Model):
+ name = models.CharField(max_length=50, help_text="What will this notice be called in the CMS?")
+
+ text = RichTextField(
+ features=base_rich_text_options,
+ blank=False,
+ )
+ notice_image = models.ForeignKey(
+ "wagtailimages.Image",
+ null=True,
+ blank=True,
+ on_delete=models.SET_NULL,
+ verbose_name="Notice Image",
+ )
+ notice_image_alt_text = models.CharField(
+ max_length=50, blank=True, help_text="Image description (for screen readers)."
+ )
+
+ panels = [
+ FieldPanel("name"),
+ FieldPanel("text"),
+ FieldPanel("notice_image"),
+ FieldPanel("notice_image_alt_text"),
+ ]
+
+ translatable_fields = [
+ SynchronizedField("name"),
+ TranslatableField("text"),
+ SynchronizedField("notice_image"),
+ TranslatableField("notice_image_alt_text"),
+ ]
+
+ def __str__(self):
+ return self.name
+
+ def clean(self):
+ super().clean()
+ if self.notice_image and not self.notice_image_alt_text:
+ raise ValidationError({"notice_image_alt_text": "Image must include alt text."})
+ if self.notice_image_alt_text and not self.notice_image:
+ raise ValidationError({"notice_image": "Alt text must have an associated image."})
diff --git a/network-api/networkapi/donate/tests/customblocks/test_notice_block.py b/network-api/networkapi/donate/tests/customblocks/test_notice_block.py
deleted file mode 100644
index 2445dbf54d6..00000000000
--- a/network-api/networkapi/donate/tests/customblocks/test_notice_block.py
+++ /dev/null
@@ -1,95 +0,0 @@
-from django.test import TestCase
-from wagtail import rich_text
-from wagtail.blocks.struct_block import StructBlockValidationError
-from wagtail.images.tests.utils import Image, get_test_image_file
-
-from networkapi.donate.factory.customblocks.notice_block import NoticeBlockFactory
-from networkapi.donate.pagemodels.customblocks.notice_block import NoticeBlock
-
-
-class NoticeBlockTest(TestCase):
- def setUp(self):
- self.notice_block = NoticeBlock()
-
- def test_notice_block_factory(self):
- """
- Testing that the factory can successfully create a valid NoticeBlock.
- """
- notice_block_factory_default_values = NoticeBlockFactory()
-
- is_valid = self.notice_block.clean(notice_block_factory_default_values)
-
- self.assertTrue(is_valid)
-
- def test_valid_notice_block(self):
- """
- Testing that a notice block with all fields is valid.
- """
- value = {
- "image": Image.objects.create(title="Test Image", file=get_test_image_file()),
- "image_alt_text": "Alt text",
- "text": rich_text.RichText("
Some content
"),
- }
-
- is_valid = self.notice_block.clean(value)
-
- self.assertTrue(is_valid)
-
- def test_image_without_alt_text_raises_error(self):
- """
- Testing that a notice block with an image but no alt text is invalid.
- """
- value = {
- "image": Image.objects.create(title="Test Image", file=get_test_image_file()),
- "image_alt_text": "",
- "text": rich_text.RichText("
Some content
"),
- }
-
- with self.assertRaises(StructBlockValidationError) as catcher:
- self.notice_block.clean(value)
- exceptions = catcher.exception.as_json_data()["blockErrors"]
- self.assertCountEqual(exceptions["image"]["messages"], ["Image must include alt text."])
-
- def test_alt_text_without_image_raises_error(self):
- """
- Testing that a notice block with alt text but no image is invalid.
- """
- value = {
- "image": None,
- "image_alt_text": "Alt text",
- "text": rich_text.RichText("
Some content
"),
- }
-
- with self.assertRaises(StructBlockValidationError) as catcher:
- self.notice_block.clean(value)
- exceptions = catcher.exception.as_json_data()["blockErrors"]
- self.assertCountEqual(exceptions["image_alt_text"]["messages"], ["Alt text must have an associated image."])
-
- def test_notice_text_field_is_required(self):
- """
- Testing that a notice block with no body text is invalid.
- """
- value = {
- "image": Image.objects.create(title="Test Image", file=get_test_image_file()),
- "image_alt_text": "Alt text",
- "text": rich_text.RichText(""),
- }
-
- with self.assertRaises(StructBlockValidationError) as catcher:
- self.notice_block.clean(value)
- exceptions = catcher.exception.as_json_data()["blockErrors"]
- self.assertCountEqual(exceptions["text"]["messages"], ["This field is required."])
-
- def test_valid_block_without_image_and_alt_text(self):
- """
- Testing that a notice block with only text is valid.
- """
- value = {
- "image": None,
- "image_alt_text": "",
- "text": rich_text.RichText("
Some content
"),
- }
-
- is_valid = self.notice_block.clean(value)
-
- self.assertTrue(is_valid)
diff --git a/network-api/networkapi/donate/tests/snippets/__init__.py b/network-api/networkapi/donate/tests/snippets/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/network-api/networkapi/donate/tests/snippets/test_help_page_notice.py b/network-api/networkapi/donate/tests/snippets/test_help_page_notice.py
new file mode 100644
index 00000000000..16b3ea92e2b
--- /dev/null
+++ b/network-api/networkapi/donate/tests/snippets/test_help_page_notice.py
@@ -0,0 +1,78 @@
+from django.core.exceptions import ValidationError
+from django.test import TestCase
+
+from networkapi.donate.factory.snippets.help_page_notice import HelpPageNoticeFactory
+from networkapi.donate.snippets.help_page_notice import HelpPageNotice
+from networkapi.wagtailpages.factory.image_factory import ImageFactory
+
+
+class HelpPageNoticeTest(TestCase):
+ def setUp(self):
+ self.notice = HelpPageNotice()
+
+ def test_help_page_notice_factory(self):
+ """
+ Testing that the factory can successfully create a valid HelpPageNotice.
+ """
+ HelpPageNoticeFactory()
+
+ def test_valid_help_page_notice(self):
+ """
+ Testing that a HelpPageNotice with all fields is valid.
+ """
+ notice = HelpPageNotice(
+ name="Test Notice",
+ text="
Some content
",
+ notice_image=ImageFactory(),
+ notice_image_alt_text="Alt text",
+ )
+
+ # Clean should not raise any validation error
+ notice.full_clean()
+
+ def test_image_without_alt_text_raises_error(self):
+ """
+ Testing that a HelpPageNotice with an image but no alt text is invalid.
+ """
+ notice = HelpPageNotice(
+ name="Test Notice", text="
Some content
", notice_image=ImageFactory(), notice_image_alt_text=""
+ )
+
+ with self.assertRaises(ValidationError) as context:
+ notice.full_clean()
+ self.assertIn("Image must include alt text.", str(context.exception))
+
+ def test_alt_text_without_image_raises_error(self):
+ """
+ Testing that a HelpPageNotice with alt text but no image is invalid.
+ """
+ notice = HelpPageNotice(
+ name="Test Notice", text="
Some content
", notice_image=None, notice_image_alt_text="Alt text"
+ )
+
+ with self.assertRaises(ValidationError) as context:
+ notice.full_clean()
+ self.assertIn("Alt text must have an associated image.", str(context.exception))
+
+ def test_valid_notice_without_image_and_alt_text(self):
+ """
+ Testing that a HelpPageNotice with only text is valid.
+ """
+ notice = HelpPageNotice(
+ name="Test Notice", text="
Some content
", notice_image=None, notice_image_alt_text=""
+ )
+
+ # Clean should not raise any validation error
+ notice.full_clean()
+
+ def test_notice_text_field_is_required(self):
+ """
+ Testing that a HelpPageNotice with no body text is invalid.
+ """
+ notice = HelpPageNotice(
+ name="Test Notice", text="", notice_image=ImageFactory(), notice_image_alt_text="Alt text"
+ )
+
+ with self.assertRaises(ValidationError) as context:
+ notice.full_clean()
+ self.assertIn("This field cannot be blank.", str(context.exception))
diff --git a/network-api/networkapi/donate/tests/test_help_page.py b/network-api/networkapi/donate/tests/test_help_page.py
index 02835454aad..3d809b19570 100644
--- a/network-api/networkapi/donate/tests/test_help_page.py
+++ b/network-api/networkapi/donate/tests/test_help_page.py
@@ -2,6 +2,9 @@
from networkapi.donate import models as pagemodels
from networkapi.donate.factory import help_page as help_page_factories
+from networkapi.donate.factory.snippets import (
+ help_page_notice as help_page_notice_factories,
+)
from networkapi.wagtailpages.tests import base as test_base
@@ -22,7 +25,6 @@ def setUpTestData(cls):
)
cls.donate_help_page = help_page_factories.DonateHelpPageFactory(
parent=cls.donate_landing_page,
- notice__0="notice",
)
def test_parent_page_types(self):
@@ -66,12 +68,6 @@ def test_template(self):
template_name="donate/pages/help_page.html",
)
- def test_help_page_notice_field(self):
- """
- Asserts that a 'notice' block was created in the 'notice' field by the factory.
- """
- self.assertEqual(self.donate_help_page.notice[0].block_type, "notice")
-
def test_thank_you_url(self):
"""
Testing that the "thank_you_url" is correctly added to the page context.
@@ -94,3 +90,17 @@ def test_thank_you_url_with_existing_query_params(self):
expected_thank_you_url = page_url + "&thank_you=true"
self.assertEqual(response.context["thank_you_url"], expected_thank_you_url)
+
+ def test_page_displays_help_page_notice(self):
+ """
+ Test that the DonateHelpPage correctly displays the HelpPageNotice.
+ """
+ notice_text_content = "
Test Notice Content
"
+ help_page_notice = help_page_notice_factories.HelpPageNoticeFactory(text=notice_text_content)
+ self.donate_help_page.notice = help_page_notice
+ self.donate_help_page.save()
+
+ url = self.donate_help_page.get_url()
+ response = self.client.get(url)
+
+ self.assertContains(response, notice_text_content)
diff --git a/network-api/networkapi/donate/wagtail_hooks.py b/network-api/networkapi/donate/wagtail_hooks.py
index fea028a8097..8e4c997a2f4 100644
--- a/network-api/networkapi/donate/wagtail_hooks.py
+++ b/network-api/networkapi/donate/wagtail_hooks.py
@@ -3,6 +3,7 @@
from wagtail.snippets.models import register_snippet
from wagtail.snippets.views.snippets import SnippetViewSet, SnippetViewSetGroup
+from networkapi.donate.snippets.help_page_notice import HelpPageNotice
from networkapi.donate_banner.models import DonateBanner
from networkapi.wagtailcustomization.views.snippet_chooser import (
DefaultLocaleSnippetChooserViewSet,
@@ -42,6 +43,21 @@ def register_donate_banner_chooser_viewset():
)
+class HelpPageNoticeViewSet(SnippetViewSet):
+ model = HelpPageNotice
+ icon = "form"
+ menu_label = "Help Page Notices"
+ list_display = (
+ "name",
+ UpdatedAtColumn(),
+ )
+ search_fields = (
+ "name",
+ "text",
+ )
+ ordering = ("name",)
+
+
class DonationModalSnippetViewSet(SnippetViewSet):
model = DonationModal
icon = "newspaper"
@@ -65,6 +81,7 @@ class DonateViewSetGroup(SnippetViewSetGroup):
items = (
DonateBannerViewSet,
DonationModalSnippetViewSet,
+ HelpPageNoticeViewSet,
)
menu_icon = "heart"
menu_label = "Donate"
diff --git a/network-api/networkapi/donate_banner/tests.py b/network-api/networkapi/donate_banner/tests.py
index aa20d27a884..56a73578132 100644
--- a/network-api/networkapi/donate_banner/tests.py
+++ b/network-api/networkapi/donate_banner/tests.py
@@ -1,7 +1,7 @@
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
-from wagtail.admin.viewsets import viewsets
+from wagtail.admin.viewsets import viewsets as wagtail_admin_viewsets
from wagtail.admin.viewsets.chooser import ChooserViewSet
from wagtail.models import Locale
from wagtail.test.utils import WagtailTestUtils
@@ -17,7 +17,8 @@ def is_donate_banner_chooser_viewset(self, viewset):
def get_chooser_viewset(self):
# Get the last registered ChooserViewSet for the DonateBanner model.
# Note: There can be multiple ChooserViewSets registered for a model.
- model_viewsets = [x for x in viewsets.viewsets if self.is_donate_banner_chooser_viewset(x)]
+ wagtail_admin_viewsets.populate()
+ model_viewsets = [x for x in wagtail_admin_viewsets.viewsets if self.is_donate_banner_chooser_viewset(x)]
return model_viewsets[-1]
def setUp(self):
diff --git a/network-api/networkapi/management/commands/load_fake_data.py b/network-api/networkapi/management/commands/load_fake_data.py
index 45e6400007a..a2f6f56ad69 100644
--- a/network-api/networkapi/management/commands/load_fake_data.py
+++ b/network-api/networkapi/management/commands/load_fake_data.py
@@ -11,6 +11,7 @@
import networkapi.donate.factory as donate_factory
import networkapi.highlights.factory as highlights_factory
import networkapi.mozfest.factory as mozfest_factory
+import networkapi.nav.factories as nav_factory
import networkapi.news.factory as news_factory
import networkapi.wagtailpages.factory as wagtailpages_factory
from networkapi.utility.faker.helpers import reseed
@@ -89,6 +90,7 @@ def handle(self, *args, **options):
wagtailpages_factory,
mozfest_factory,
donate_factory,
+ nav_factory,
]
]
diff --git a/network-api/networkapi/management/commands/makemessages.py b/network-api/networkapi/management/commands/makemessages.py
index 56f8a9b2cc3..7fb214dcdc6 100644
--- a/network-api/networkapi/management/commands/makemessages.py
+++ b/network-api/networkapi/management/commands/makemessages.py
@@ -2,4 +2,4 @@
class Command(makemessages.Command):
- msgmerge_options = ["--no-fuzzy-matching"]
+ msgmerge_options = makemessages.Command.msgmerge_options + ["--no-fuzzy-matching"]
diff --git a/network-api/networkapi/mozfest/blocks/carousel_text_block.py b/network-api/networkapi/mozfest/blocks/carousel_text_block.py
index 3f8536feda7..ee6662cd577 100644
--- a/network-api/networkapi/mozfest/blocks/carousel_text_block.py
+++ b/network-api/networkapi/mozfest/blocks/carousel_text_block.py
@@ -6,11 +6,7 @@
class CarouselTextBlock(blocks.StructBlock):
heading = blocks.CharBlock(help_text="Heading for the block.", required=False)
text = blocks.RichTextBlock(features=["bold", "italic", "link"])
- # Use specific link fields for the CTA on the block as opposed to the
- # common.link_blocks.LabelledExternalLinkBlock so it can be marked as
- # required=False.
- link_url = blocks.URLBlock(help_text="A CTA URL for a link displayed", required=False)
- link_label = blocks.CharBlock(help_text="Label for the CTA link.", required=False)
+ link = blocks.ListBlock(customblocks.LinkBlock(), min_num=0, max_num=1, help_text="A CTA Link for the carousel")
carousel_images = blocks.ListBlock(customblocks.ImageBlock(), max_num=4)
class Meta:
diff --git a/network-api/networkapi/mozfest/blocks/mixed_content_block.py b/network-api/networkapi/mozfest/blocks/mixed_content_block.py
index f12d8cdb208..ec006ef9e08 100644
--- a/network-api/networkapi/mozfest/blocks/mixed_content_block.py
+++ b/network-api/networkapi/mozfest/blocks/mixed_content_block.py
@@ -1,9 +1,8 @@
-from django.forms.utils import ErrorList
from wagtail import blocks
-from wagtail.blocks import struct_block
from wagtail.images import blocks as image_blocks
from networkapi.wagtailpages.pagemodels.customblocks import listing as listing_blocks
+from networkapi.wagtailpages.pagemodels.customblocks.link_block import LinkBlock
class VideoBlock(blocks.StructBlock):
@@ -39,26 +38,12 @@ class Meta:
class MixedContentBlock(blocks.StructBlock):
video = VideoBlock()
cards = blocks.ListBlock(listing_blocks.ListingCard(), min_num=1, max_num=4)
- link_url = blocks.URLBlock(required=False)
- link_text = blocks.CharBlock(required=False, max_length=50)
-
- def clean(self, value):
- result = super().clean(value)
- errors = {}
-
- link_url = value.get("link_url")
- link_text = value.get("link_text")
-
- if link_url and not link_text:
- errors["link_text"] = ErrorList(["Please add a text value for the link."])
-
- if link_text and not link_url:
- errors["link_url"] = ErrorList(["Please add a URL value for the link."])
-
- if errors:
- raise struct_block.StructBlockValidationError(block_errors=errors)
-
- return result
+ link = blocks.ListBlock(
+ LinkBlock(),
+ min_num=0,
+ max_num=1,
+ help_text="Optional link that this mixed content block should link out to.",
+ )
class Meta:
template = "fragments/blocks/mixed_content_block.html"
diff --git a/network-api/networkapi/mozfest/migrations/0046_add_target_linkblock_to_linkbuttonblock_and_ctablock.py b/network-api/networkapi/mozfest/migrations/0046_add_target_linkblock_to_linkbuttonblock_and_ctablock.py
index 47d833604bf..3bdcf693de9 100644
--- a/network-api/networkapi/mozfest/migrations/0046_add_target_linkblock_to_linkbuttonblock_and_ctablock.py
+++ b/network-api/networkapi/mozfest/migrations/0046_add_target_linkblock_to_linkbuttonblock_and_ctablock.py
@@ -333,9 +333,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
@@ -952,7 +950,7 @@ class Migration(migrations.Migration):
max_length=300,
required=False,
validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
],
),
),
@@ -1676,9 +1674,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
diff --git a/network-api/networkapi/mozfest/migrations/0048_remove_old_url_fields_from_linkblock.py b/network-api/networkapi/mozfest/migrations/0048_remove_old_url_fields_from_linkblock.py
index d98a3e6c1a9..49ac6cd8b38 100644
--- a/network-api/networkapi/mozfest/migrations/0048_remove_old_url_fields_from_linkblock.py
+++ b/network-api/networkapi/mozfest/migrations/0048_remove_old_url_fields_from_linkblock.py
@@ -345,9 +345,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
@@ -973,7 +971,7 @@ class Migration(migrations.Migration):
max_length=300,
required=False,
validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
],
),
),
@@ -1696,9 +1694,7 @@ class Migration(migrations.Migration):
help_text='An id attribute of an element on the current page. For example, "#section-1"',
max_length=300,
required=False,
- validators=[
- networkapi.wagtailpages.pagemodels.customblocks.common.base_link_block.AnchorLinkValidator()
- ],
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
),
),
("email", wagtail.blocks.EmailBlock(required=False)),
diff --git a/network-api/networkapi/mozfest/migrations/0049_set_relative_url_on_linkblock.py b/network-api/networkapi/mozfest/migrations/0049_set_relative_url_on_linkblock.py
new file mode 100644
index 00000000000..6a89b7d8857
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0049_set_relative_url_on_linkblock.py
@@ -0,0 +1,60 @@
+# Generated by Django 4.2.10 on 2024-02-27 12:28
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_linkbuttonblock(source_block):
+ source_block["value"]["relative_url"] = ""
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0048_remove_old_url_fields_from_linkblock"),
+ ("wagtailcore", "0089_log_entry_data_json_null_to_object"),
+ ]
+
+ operations = [
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="MozfestPrimaryPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock),
+ "block_with_aside.aside",
+ ),
+ (AlterStreamChildBlockDataOperation(block="cta", operation=migrate_linkbuttonblock), ""),
+ ],
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="MozfestHomepage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock),
+ "block_with_aside.aside",
+ ),
+ (AlterStreamChildBlockDataOperation(block="cta", operation=migrate_linkbuttonblock), ""),
+ ],
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="MozfestLandingPage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="linkbutton", operation=migrate_linkbuttonblock),
+ "block_with_aside.aside",
+ ),
+ (AlterStreamChildBlockDataOperation(block="cta", operation=migrate_linkbuttonblock), ""),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0050_make_link_to_required_in_link_block.py b/network-api/networkapi/mozfest/migrations/0050_make_link_to_required_in_link_block.py
new file mode 100644
index 00000000000..8b8efa80bf0
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0050_make_link_to_required_in_link_block.py
@@ -0,0 +1,1814 @@
+# Generated by Django 4.2.10 on 2024-03-21 18:45
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0049_set_relative_url_on_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0051_alter_mozfestprimarypage_body.py b/network-api/networkapi/mozfest/migrations/0051_alter_mozfestprimarypage_body.py
new file mode 100644
index 00000000000..ffb9151c22a
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0051_alter_mozfestprimarypage_body.py
@@ -0,0 +1,1814 @@
+# Generated by Django 4.2.11 on 2024-04-04 18:19
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0050_make_link_to_required_in_link_block"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0052_update_annotatedimageblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0052_update_annotatedimageblock_with_linkblock.py
new file mode 100644
index 00000000000..36384224372
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0052_update_annotatedimageblock_with_linkblock.py
@@ -0,0 +1,3794 @@
+# Generated by Django 4.2.11 on 2024-06-12 21:42
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_block(source_block):
+ new_value = {
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText", ""),
+ "caption": source_block["value"].get("caption", ""),
+ "caption_url": [],
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"]["captionURL"],
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0051_alter_mozfestprimarypage_body"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image", operation=migrate_image_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0053_update_iframeblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0053_update_iframeblock_with_linkblock.py
new file mode 100644
index 00000000000..5a8f850e25d
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0053_update_iframeblock_with_linkblock.py
@@ -0,0 +1,3950 @@
+# Generated by Django 4.2.11 on 2024-06-24 21:38
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_iframe_block(source_block):
+ new_value = {
+ "url": source_block["value"].get("url"),
+ "height": source_block["value"].get("height"),
+ "caption": source_block["value"].get("caption"),
+ "caption_url": [],
+ "iframe_width": source_block["value"].get("iframe_width"),
+ "disable_scroll": source_block["value"].get("disable_scroll"),
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"].get("captionURL"),
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0052_update_annotatedimageblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this caption should link out to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="iframe", operation=migrate_iframe_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this image should link out to.", required=False
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0054_update_imagetextblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0054_update_imagetextblock_with_linkblock.py
new file mode 100644
index 00000000000..65df468dd50
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0054_update_imagetextblock_with_linkblock.py
@@ -0,0 +1,2098 @@
+# Generated by Django 4.2.11 on 2024-06-27 22:53
+
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_text_block(source_block):
+ new_value = {
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText"),
+ "text": source_block["value"].get("text"),
+ "url": [],
+ "top_divider": source_block["value"].get("top_divider", False),
+ "bottom_divider": source_block["value"].get("bottom_divider", False),
+ }
+
+ old_url = source_block["value"].get("url")
+
+ # Regex patterns for detecting URLs and emails
+ url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+ email_pattern = re.compile(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")
+
+ if old_url:
+ if url_pattern.match(old_url):
+ new_value["url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+ elif email_pattern.match(old_url):
+ new_value["url"] = [
+ {
+ "link_to": "email",
+ "email": old_url,
+ "new_window": False,
+ }
+ ]
+
+ source_block["value"] = new_value
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0053_update_iframeblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image_text", operation=migrate_image_text_block), ""),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0055_update_videoblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0055_update_videoblock_with_linkblock.py
new file mode 100644
index 00000000000..b43ecc5edd7
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0055_update_videoblock_with_linkblock.py
@@ -0,0 +1,4457 @@
+# Generated by Django 4.2.11 on 2024-07-03 00:44
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_video_block(source_block):
+ new_value = {
+ "url": source_block["value"].get("url"),
+ "caption": source_block["value"].get("caption"),
+ "caption_url": [],
+ "video_width": source_block["value"].get("video_width"),
+ }
+ if "captionURL" in source_block["value"] and source_block["value"]["captionURL"]:
+ new_value["caption_url"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"].get("captionURL"),
+ "new_window": True,
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0054_update_imagetextblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.", required=False
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "captionURL",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL for caption to link to.",
+ required=False,
+ ),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="video", operation=migrate_video_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0056_update_imageteaserblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0056_update_imageteaserblock_with_linkblock.py
new file mode 100644
index 00000000000..538bc82d26f
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0056_update_imageteaserblock_with_linkblock.py
@@ -0,0 +1,4630 @@
+# Generated by Django 4.2.14 on 2024-07-15 23:38
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_image_teaser_block(source_block):
+ new_value = {
+ "title": source_block["value"].get("title", ""),
+ "text": source_block["value"].get("text", ""),
+ "image": source_block["value"].get("image"),
+ "altText": source_block["value"].get("altText", ""),
+ "link": [],
+ "styling": source_block["value"].get("styling", "btn-primary"),
+ "top_divider": source_block["value"].get("top_divider", False),
+ "bottom_divider": source_block["value"].get("bottom_divider", False),
+ }
+ if "url" in source_block["value"] and source_block["value"]["url"]:
+ new_value["link_button"] = [
+ {
+ "link_to": "external_url",
+ "external_url": source_block["value"]["url"],
+ "label": source_block["value"].get("url_label", ""),
+ "new_window": True,
+ "styling": source_block["value"].get("styling", "btn-primary"),
+ }
+ ]
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0055_update_videoblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("url_label", wagtail.blocks.CharBlock(required=False)),
+ ("url", wagtail.blocks.CharBlock(required=False)),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_teaser_block", operation=migrate_image_teaser_block
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0057_update_grouplistingblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0057_update_grouplistingblock_with_linkblock.py
new file mode 100644
index 00000000000..336ceb0f1c0
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0057_update_grouplistingblock_with_linkblock.py
@@ -0,0 +1,4774 @@
+# Generated by Django 4.2.14 on 2024-07-17 01:24
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_group_listing_block_cards(source_block):
+
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+
+ old_url = card["value"].get("url")
+ if old_url:
+ card["value"]["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0056_update_imageteaserblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="The URL this card should link to.", required=False
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="group_listing_block", operation=migrate_group_listing_block_cards
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0058_update_imagegridblock_with_listingblock.py b/network-api/networkapi/mozfest/migrations/0058_update_imagegridblock_with_listingblock.py
new file mode 100644
index 00000000000..173e229eb24
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0058_update_imagegridblock_with_listingblock.py
@@ -0,0 +1,4950 @@
+# Generated by Django 4.2.14 on 2024-07-17 22:52
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+# Regex pattern for detecting URLs (including those without protocol)
+url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+# Regex pattern for detecting emails
+email_pattern = re.compile(r"^mailto:")
+
+
+def migrate_image_grid_block(source_block):
+ if "grid_items" in source_block["value"]:
+ for item in source_block["value"]["grid_items"]:
+ item_value = item.get("value", item)
+ old_url = item_value.get("url")
+ if old_url:
+ if url_pattern.match(old_url):
+ item_value["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": old_url,
+ "new_window": True,
+ }
+ ]
+ elif email_pattern.match(old_url):
+ email_address = old_url.replace("mailto:", "")
+ item_value["link"] = [
+ {
+ "link_to": "email",
+ "email": email_address,
+ "new_window": False,
+ }
+ ]
+ elif old_url.startswith("/"):
+ item_value["link"] = [
+ {
+ "link_to": "relative_url",
+ "relative_url": old_url,
+ "new_window": False,
+ }
+ ]
+ item = item_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0057_update_grouplistingblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this figure should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="image_grid", operation=migrate_image_grid_block), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0059_update_carouseltextblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0059_update_carouseltextblock_with_linkblock.py
new file mode 100644
index 00000000000..ce6a3156dc4
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0059_update_carouseltextblock_with_linkblock.py
@@ -0,0 +1,5100 @@
+# Generated by Django 4.2.14 on 2024-07-17 23:47
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_carousel_text_block(source_block):
+ new_value = {
+ "heading": source_block["value"].get("heading"),
+ "text": source_block["value"].get("text"),
+ "link": [],
+ "carousel_images": source_block["value"].get("carousel_images"),
+ }
+
+ link_url = source_block["value"].get("link_url")
+ link_label = source_block["value"].get("link_label")
+ if link_url:
+ if "www.mozillafestival.org" in link_url:
+ new_value["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "label": link_label,
+ "new_window": False,
+ }
+ ]
+ else:
+ new_value["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "label": link_label,
+ "new_window": False,
+ }
+ ]
+
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0058_update_imagegridblock_with_listingblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link_url",
+ wagtail.blocks.URLBlock(
+ help_text="A CTA URL for a link displayed", required=False
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(help_text="Label for the CTA link.", required=False),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="carousel_and_text", operation=migrate_carousel_text_block
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0060_update_listingblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0060_update_listingblock_with_linkblock.py
new file mode 100644
index 00000000000..d533377dfa3
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0060_update_listingblock_with_linkblock.py
@@ -0,0 +1,5593 @@
+# Generated by Django 4.2.14 on 2024-07-19 00:13
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_listing_card_links(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+ new_link = []
+
+ link_page = card_value.get("link_page")
+ if link_page:
+ new_link.append(
+ {
+ "link_to": "page",
+ "page": link_page,
+ "new_window": False,
+ }
+ )
+
+ link_url = card_value.get("link_url")
+ if link_url:
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ }
+ )
+
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0059_update_carouseltextblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to.", required=False
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="listing", operation=migrate_listing_card_links), ""),
+ (
+ AlterStreamChildBlockDataOperation(block="listing", operation=migrate_listing_card_links),
+ "block_with_aside.content",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0061_update_textonlyteaserblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0061_update_textonlyteaserblock_with_linkblock.py
new file mode 100644
index 00000000000..e623fed8f98
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0061_update_textonlyteaserblock_with_linkblock.py
@@ -0,0 +1,5709 @@
+# Generated by Django 4.2.14 on 2024-07-19 02:44
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_text_only_teaser_block(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+
+ # Prepare the new link field
+ new_link = []
+
+ # Migrate link_page to the new link field
+ link_page = card_value.get("link_page")
+ if link_page:
+ new_link.append({"link_to": "page", "page": link_page, "new_window": False})
+
+ # Migrate link_url to the new link field
+ link_url = card_value.get("link_url")
+ if link_url:
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ }
+ )
+
+ # Update the card value with the new link
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0060_update_listingblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "link_page",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the header should link out to.",
+ required=False,
+ ),
+ ),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that the header should link out to.",
+ required=False,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="text_only_teaser", operation=migrate_text_only_teaser_block
+ ),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0062_format_linkblock_empty_values.py b/network-api/networkapi/mozfest/migrations/0062_format_linkblock_empty_values.py
new file mode 100644
index 00000000000..3f12626fc34
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0062_format_linkblock_empty_values.py
@@ -0,0 +1,73 @@
+# Generated by Django 4.2.14 on 2024-07-22 14:02
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def format_image_grid_block_items_empty_values(source_block):
+ if "grid_items" in source_block["value"]:
+ for item in source_block["value"]["grid_items"]:
+ item_value = item.get("value", item)
+ link_value = item_value.get("link", None)
+
+ if not link_value:
+ item_value["link"] = []
+
+ return source_block
+
+
+def format_image_teaser_block_empty_value(source_block):
+ link_button_value = source_block["value"].get("link_button", None)
+
+ if not link_button_value:
+ source_block["value"]["link_button"] = []
+
+ return source_block
+
+
+def format_group_listing_block_cards_empty_values(source_block):
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+ card_value = card.get("value", card)
+ link_value = card_value.get("link", None)
+
+ if not link_value:
+ card_value["link"] = []
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0061_update_textonlyteaserblock_with_linkblock"),
+ ]
+
+ operations = [
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_grid", operation=format_image_grid_block_items_empty_values
+ ),
+ "",
+ ),
+ (
+ AlterStreamChildBlockDataOperation(
+ block="image_teaser_block", operation=format_image_teaser_block_empty_value
+ ),
+ "",
+ ),
+ (
+ AlterStreamChildBlockDataOperation(
+ block="group_listing_block", operation=format_group_listing_block_cards_empty_values
+ ),
+ "",
+ ),
+ ],
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0063_update_mixedcontentblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0063_update_mixedcontentblock_with_linkblock.py
new file mode 100644
index 00000000000..66f3775599a
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0063_update_mixedcontentblock_with_linkblock.py
@@ -0,0 +1,5883 @@
+# Generated by Django 4.2.14 on 2024-07-19 17:16
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+
+def migrate_mixed_content_block(source_block):
+ new_value = {
+ "video": source_block["value"].get("video"),
+ "cards": source_block["value"].get("cards"),
+ "link_url": source_block["value"].get("link_url"),
+ "link_text": source_block["value"].get("link_text"),
+ "link": [],
+ }
+
+ link_url = source_block["value"].get("link_url")
+ link_text = source_block["value"].get("link_text")
+
+ if link_url and link_text:
+ new_value["link"] = [
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "label": link_text,
+ "new_window": False,
+ }
+ ]
+
+ for card in new_value["cards"]:
+ card_value = card.get("value", card)
+ new_link = []
+
+ link_page = card_value.get("link_page")
+ if link_page:
+ new_link.append(
+ {
+ "link_to": "page",
+ "page": link_page,
+ "new_window": False,
+ }
+ )
+
+ link_url = card_value.get("link_url")
+ if link_url:
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": False,
+ }
+ )
+
+ card_value["link"] = new_link
+ card = card_value
+
+ return {
+ **source_block,
+ "value": new_value,
+ }
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0062_format_linkblock_empty_values"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ ("link_url", wagtail.blocks.URLBlock(required=False)),
+ ("link_text", wagtail.blocks.CharBlock(max_length=50, required=False)),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this mixed content block should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (
+ AlterStreamChildBlockDataOperation(block="mixed_content", operation=migrate_mixed_content_block),
+ "",
+ ),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar"',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this mixed content block should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0064_update_baselinkblock_relative_link_validation.py b/network-api/networkapi/mozfest/migrations/0064_update_baselinkblock_relative_link_validation.py
new file mode 100644
index 00000000000..717ceddc51b
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0064_update_baselinkblock_relative_link_validation.py
@@ -0,0 +1,2919 @@
+# Generated by Django 4.2.14 on 2024-07-23 01:17
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0063_update_mixedcontentblock_with_linkblock"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this mixed content block should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/migrations/0065_update_cardgridblock_with_linkblock.py b/network-api/networkapi/mozfest/migrations/0065_update_cardgridblock_with_linkblock.py
new file mode 100644
index 00000000000..9f5855a8944
--- /dev/null
+++ b/network-api/networkapi/mozfest/migrations/0065_update_cardgridblock_with_linkblock.py
@@ -0,0 +1,6024 @@
+# Generated by Django 4.2.14 on 2024-07-23 01:40
+
+import re
+
+import wagtail.blocks
+import wagtail.blocks.static_block
+import wagtail.documents.blocks
+import wagtail.embeds.blocks
+import wagtail.fields
+import wagtail.images.blocks
+import wagtail.snippets.blocks
+import wagtailmedia.blocks
+from django.db import migrations
+from wagtail.blocks.migrations.migrate_operation import MigrateStreamData
+
+import networkapi.wagtailpages.pagemodels.blog.blog_topic
+import networkapi.wagtailpages.pagemodels.profiles
+import networkapi.wagtailpages.validators
+from networkapi.utility.migration.operations import AlterStreamChildBlockDataOperation
+
+# Regex pattern for detecting URLs (including those without protocol)
+url_pattern = re.compile(r"^(http://|https://|www\.|[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+)")
+
+
+def migrate_card_grid_block_cards(source_block):
+
+ if "cards" in source_block["value"]:
+ for card in source_block["value"]["cards"]:
+
+ card_value = card.get("value", card)
+ new_link = []
+
+ link_url = card_value.get("link_url")
+ link_label = card_value.get("link_label")
+
+ if link_url and link_label:
+ if url_pattern.match(link_url):
+ new_link.append(
+ {
+ "link_to": "external_url",
+ "external_url": link_url,
+ "new_window": True,
+ "label": link_label,
+ }
+ )
+ else:
+ new_link.append(
+ {
+ "link_to": "relative_url",
+ "relative_url": link_url,
+ "new_window": False,
+ "label": link_label,
+ }
+ )
+
+ # Update the card value with the new link
+ card_value["link"] = new_link
+ card = card_value
+
+ return source_block
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("mozfest", "0064_update_baselinkblock_relative_link_validation"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link_url",
+ wagtail.blocks.CharBlock(
+ help_text="Optional URL that this card should link out to. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link_label",
+ wagtail.blocks.CharBlock(
+ help_text="Optional Label for the URL link above. (Note: If left blank, link will not render.) ",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this mixed content block should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ MigrateStreamData(
+ app_name="mozfest",
+ model_name="mozfestprimarypage",
+ field_name="body",
+ operations_and_block_paths=[
+ (AlterStreamChildBlockDataOperation(block="card_grid", operation=migrate_card_grid_block_cards), ""),
+ ],
+ ),
+ migrations.AlterField(
+ model_name="mozfestprimarypage",
+ name="body",
+ field=wagtail.fields.StreamField(
+ [
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ "large",
+ ],
+ template="wagtailpages/blocks/rich_text_block.html",
+ ),
+ ),
+ (
+ "card_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("body", wagtail.blocks.TextBlock(help_text="Body text of the card.")),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "image_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide images are col-12, Full-Width Images reach both ends of the screen (16:6 images recommended for full width)",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ (
+ "url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this image should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_text_mini",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ ]
+ ),
+ ),
+ (
+ "image_grid",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "grid_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for this image.", required=False
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Please remember to properly attribute any images we use.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this figure should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "square_image",
+ wagtail.blocks.BooleanBlock(
+ default=True,
+ help_text="If left checked, the image will be cropped to be square.",
+ required=False,
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "iframe",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.CharBlock(
+ help_text="Please note that only URLs from allow-listed domains will work."
+ ),
+ ),
+ (
+ "height",
+ wagtail.blocks.IntegerBlock(
+ help_text="Optional integer pixel value for custom iFrame height",
+ required=False,
+ ),
+ ),
+ ("caption", wagtail.blocks.CharBlock(required=False)),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "iframe_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[("normal", "Normal"), ("wide", "Wide"), ("full_width", "Full Width")],
+ help_text="Wide iframes are col-12, Full-Width iframes reach both ends of the screen",
+ ),
+ ),
+ (
+ "disable_scroll",
+ wagtail.blocks.BooleanBlock(
+ default=False,
+ help_text='Checking this will add "scrolling=no" to the iframe. Use this if your iframe is rendering an unnecessary scroll bar or whitespace below it.',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "single_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profile_by_id",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "ids",
+ wagtail.blocks.CharBlock(
+ help_text="Show profiles for pulse users with specific profile ids (mozillapulse.org/profile/[##]). For multiple profiles, specify a comma separated list (e.g. 85,105,332).",
+ label="Profile by ID",
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "profile_directory",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "max_number_of_results",
+ wagtail.blocks.IntegerBlock(
+ default=12,
+ help_text="Pick up to 48 profiles.",
+ max_value=48,
+ min_value=1,
+ required=True,
+ ),
+ ),
+ (
+ "advanced_filter_header",
+ wagtail.blocks.static_block.StaticBlock(
+ admin_text="-------- ADVANCED FILTERS: OPTIONS TO DISPLAY FEWER, MORE TARGETED RESULTS. --------",
+ label=" ",
+ ),
+ ),
+ (
+ "profile_type",
+ wagtail.blocks.CharBlock(default="", help_text="Example: Fellow.", required=False),
+ ),
+ (
+ "program_type",
+ wagtail.blocks.CharBlock(
+ default="", help_text="Example: Tech Policy.", required=False
+ ),
+ ),
+ ("year", wagtail.blocks.CharBlock(default="", required=False)),
+ (
+ "filter_values",
+ wagtail.blocks.CharBlock(
+ default="2019,2018,2017,2016,2015,2014,2013",
+ help_text="Example: 2019,2018,2017,2016,2015,2014,2013",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "recent_blog_entries",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(required=False)),
+ (
+ "tag_filter",
+ wagtail.blocks.CharBlock(
+ help_text="Test this filter at foundation.mozilla.org/blog/tags/",
+ label="Filter by Tag",
+ required=False,
+ ),
+ ),
+ (
+ "topic_filter",
+ wagtail.blocks.ChoiceBlock(
+ choices=networkapi.wagtailpages.pagemodels.blog.blog_topic.BlogPageTopic.get_topics,
+ help_text="Test this filter at foundation.mozilla.org/blog/topic/",
+ label="Filter by Topic",
+ required=False,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "blog_set",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ (
+ "blog_pages",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.PageChooserBlock(page_type=["wagtailpages.BlogPage"])
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "profiles",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profiles",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "profile",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ networkapi.wagtailpages.pagemodels.profiles.Profile
+ ),
+ )
+ ]
+ ),
+ min_num=1,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "group_listing_block",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the group of cards.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ (
+ "meta_data",
+ wagtail.blocks.CharBlock(
+ help_text="Optional meta data information for the card.",
+ required=False,
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold", "link"], help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ )
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "image_feature",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(help_text="Image description (for screen readers)."),
+ ),
+ ("metadata", wagtail.blocks.CharBlock(required=False)),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "title_link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that the title should link out to.", required=False
+ ),
+ ),
+ ("body", wagtail.blocks.CharBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "image_teaser_block",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).", required=True
+ ),
+ ),
+ (
+ "link_button",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link button",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "top_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider above content block.", required=False
+ ),
+ ),
+ (
+ "bottom_divider",
+ wagtail.blocks.BooleanBlock(
+ help_text="Optional divider below content block.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "text_only_teaser",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the card."),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that the header should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ("meta_data", wagtail.blocks.CharBlock(max_length=500)),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.",
+ max_length=200,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 3 cards.",
+ min_num=3,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "block_with_aside",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "listing",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the block.", required=False
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.",
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.",
+ required=False,
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.",
+ required=False,
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ min_num=2,
+ ),
+ ),
+ (
+ "cards_per_row",
+ wagtail.blocks.ChoiceBlock(
+ choices=[(2, "2"), (3, "3")],
+ help_text="Number of cards per row. Note: this is a max and fewer might be used if is less space is available.",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "paragraph",
+ wagtail.blocks.RichTextBlock(
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "ol",
+ "ul",
+ "hr",
+ "document-link",
+ ]
+ ),
+ ),
+ ],
+ help_text="The wider block that appears on the left on desktop",
+ icon="doc-full",
+ max_num=1,
+ ),
+ ),
+ (
+ "aside",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "aside_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card.", required=False
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "linkbutton",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spacer",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "size",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("1", "quarter spacing"),
+ ("2", "half spacing"),
+ ("3", "single spacing"),
+ ("4", "one and a half spacing"),
+ ("5", "triple spacing"),
+ ]
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Elements here will appear in the column on the right side of the page on desktop. This can be left blank if you would just like a 2/3 column on the left",
+ icon="doc-full",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "accordion",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "accordion_items",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the Accordion Item"
+ ),
+ ),
+ (
+ "content",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "rich_text",
+ wagtail.blocks.RichTextBlock(
+ blank=True,
+ features=[
+ "bold",
+ "italic",
+ "link",
+ "ul",
+ "ol",
+ "document-link",
+ ],
+ ),
+ ),
+ (
+ "datawrapper",
+ wagtail.embeds.blocks.EmbedBlock(
+ help_text='Enter the "visualization only" link of the Datawrapper chart. It looks something like this: https://datawrapper.dwcdn.net/KwSKp/1/',
+ icon="image",
+ template="wagtailpages/blocks/datawrapper_block.html",
+ ),
+ ),
+ (
+ "image",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(),
+ ),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(required=False),
+ ),
+ (
+ "caption_url",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ (
+ "external_url",
+ "External URL",
+ ),
+ (
+ "relative_url",
+ "Relative URL",
+ ),
+ ("email", "Email"),
+ (
+ "anchor",
+ "Anchor",
+ ),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page",
+ required=False,
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ (
+ "email",
+ wagtail.blocks.EmailBlock(
+ required=False
+ ),
+ ),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File",
+ required=False,
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone",
+ max_length=30,
+ required=False,
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window",
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional URL that this caption should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "video_width",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("normal", "Normal"),
+ ("wide", "Wide"),
+ ("full_width", "Full Width"),
+ ],
+ help_text="Wide videos are col-12, Full-Width videos reach both ends of the screen.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ ),
+ ),
+ ]
+ )
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "session_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "session_items",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "session_item",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "author_subheading",
+ wagtail.blocks.CharBlock(
+ help_text="Author of this session.", required=False
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this session."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ help_text="Body text of this card."
+ ),
+ ),
+ (
+ "video",
+ wagtailmedia.blocks.VideoChooserBlock(
+ help_text="Video that will autoplay when this card is hovered on",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of sessions in the slider.",
+ ),
+ ),
+ (
+ "button",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(help_text="Label for this link."),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="Button that appears below the slider.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "current_events_slider",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the slider.")),
+ (
+ "current_events",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "current_event",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(help_text="Heading of the card."),
+ ),
+ (
+ "subheading_link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ help_text="The link that appears below the card heading.",
+ max_num=1,
+ required=False,
+ ),
+ ),
+ (
+ "image",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image associated with this event."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "buttons",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "document",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "label",
+ wagtail.blocks.CharBlock(
+ help_text="Label for this link."
+ ),
+ ),
+ (
+ "document",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ help_text="Document that this should link out to."
+ ),
+ ),
+ ],
+ help_text='An iCal document can be attached here for an "Add to Calendar" button.',
+ ),
+ ),
+ ],
+ help_text="A list of buttons that will appear at the bottom of the card.",
+ max_num=2,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of current events in the slider.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "spaces",
+ wagtail.blocks.StructBlock(
+ [
+ ("title", wagtail.blocks.CharBlock()),
+ (
+ "cards",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "space_card",
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Heading for the card."
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.TextBlock(
+ help_text="Body text of the card."
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.StreamBlock(
+ [
+ (
+ "internal",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.PageChooserBlock(
+ help_text="Page that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "external",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link",
+ wagtail.blocks.URLBlock(
+ help_text="URL that this should link out to."
+ ),
+ )
+ ]
+ ),
+ ),
+ ],
+ help_text="Page or external URL this card will link out to.",
+ max_num=1,
+ ),
+ ),
+ ]
+ ),
+ )
+ ],
+ help_text="A list of Spaces Cards.",
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tito_widget",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "button_label",
+ wagtail.blocks.CharBlock(help_text="The text to show on the Tito button."),
+ ),
+ (
+ "styling",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("btn-primary", "Primary button"),
+ ("btn-secondary", "Secondary button"),
+ ]
+ ),
+ ),
+ (
+ "event",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "events.TitoEvent", help_event="The Tito event to be displayed"
+ ),
+ ),
+ (
+ "releases",
+ wagtail.blocks.CharBlock(
+ help_text='Comma-separated list of ticket/release IDs to limit to, e.g. "3elajg6qcxu,6qiiw4socs4"',
+ required=False,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "statistics",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "statistics",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="The statistic figure, e.g '1000+' or '10%'"
+ ),
+ ),
+ (
+ "description",
+ wagtail.blocks.CharBlock(
+ help_text="Context or description for the statistic"
+ ),
+ ),
+ ]
+ ),
+ help_text="Please use a minimum of 2 cards.",
+ max_num=4,
+ min_num=2,
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "carousel_and_text",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ ("text", wagtail.blocks.RichTextBlock(features=["bold", "italic", "link"])),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="A CTA Link for the carousel",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ (
+ "carousel_images",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "altText",
+ wagtail.blocks.CharBlock(
+ help_text="Image description (for screen readers).",
+ required=True,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "heading",
+ wagtail.blocks.CharBlock(help_text="Heading for the block.", required=False),
+ ),
+ (
+ "tickets",
+ wagtail.blocks.ListBlock(
+ wagtail.snippets.blocks.SnippetChooserBlock("mozfest.Ticket"), max_num=3
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "dark_quote",
+ wagtail.blocks.StructBlock(
+ [
+ ("quote", wagtail.blocks.RichTextBlock(features=["bold"])),
+ ("attribution", wagtail.blocks.CharBlock(required=False)),
+ (
+ "attribution_info",
+ wagtail.blocks.RichTextBlock(features=["bold", "link", "large"], required=False),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cta",
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ ("page", wagtail.blocks.PageChooserBlock(label="Page", required=False)),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.RelativeURLValidator()],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[networkapi.wagtailpages.validators.AnchorLinkValidator()],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ ("file", wagtail.documents.blocks.DocumentChooserBlock(label="File", required=False)),
+ ("phone", wagtail.blocks.CharBlock(label="Phone", max_length=30, required=False)),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(label="Open in new window", required=False),
+ ),
+ ("heading", wagtail.blocks.CharBlock(required=False)),
+ ("text", wagtail.blocks.CharBlock(required=False)),
+ ("dark_background", wagtail.blocks.BooleanBlock(required=False)),
+ ]
+ ),
+ ),
+ (
+ "newsletter_signup",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "snippet",
+ wagtail.snippets.blocks.SnippetChooserBlock(
+ "mozfest.NewsletterSignupWithBackground"
+ ),
+ )
+ ]
+ ),
+ ),
+ (
+ "mixed_content",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "video",
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "url",
+ wagtail.blocks.URLBlock(
+ help_text="For YouTube: go to your YouTube video and click “Share,” then “Embed,” and then copy and paste the provided URL only. For example: https://www.youtube.com/embed/3FIVXBawyQw For Vimeo: follow similar steps to grab the embed URL. For example: https://player.vimeo.com/video/9004979",
+ label="Embed URL",
+ ),
+ ),
+ (
+ "caption",
+ wagtail.blocks.CharBlock(
+ help_text="Optional caption for the video, displayed next to the play button.",
+ max_length=25,
+ required=False,
+ ),
+ ),
+ (
+ "title",
+ wagtail.blocks.CharBlock(
+ help_text="Optional title for the video.",
+ max_length=50,
+ required=False,
+ ),
+ ),
+ (
+ "text",
+ wagtail.blocks.CharBlock(
+ help_text="Text content to display with the video title.",
+ required=False,
+ ),
+ ),
+ (
+ "thumbnail",
+ wagtail.images.blocks.ImageChooserBlock(
+ help_text="The image to show before the video is played."
+ ),
+ ),
+ ]
+ ),
+ ),
+ (
+ "cards",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("image", wagtail.images.blocks.ImageChooserBlock()),
+ (
+ "alt_text",
+ wagtail.blocks.CharBlock(
+ help_text="Alt text for card's image.", required=False
+ ),
+ ),
+ ("title", wagtail.blocks.CharBlock(help_text="Heading for the card.")),
+ (
+ "highlighted_metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Metadata to highlight on the card.", required=False
+ ),
+ ),
+ (
+ "metadata",
+ wagtail.blocks.CharBlock(
+ help_text="Generic metadata.", required=False
+ ),
+ ),
+ (
+ "body",
+ wagtail.blocks.RichTextBlock(
+ features=["bold"],
+ help_text="Body text of the card.",
+ required=False,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(
+ label="Page", required=False
+ ),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this card should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ max_num=4,
+ min_num=1,
+ ),
+ ),
+ (
+ "link",
+ wagtail.blocks.ListBlock(
+ wagtail.blocks.StructBlock(
+ [
+ ("label", wagtail.blocks.CharBlock()),
+ (
+ "link_to",
+ wagtail.blocks.ChoiceBlock(
+ choices=[
+ ("page", "Page"),
+ ("external_url", "External URL"),
+ ("relative_url", "Relative URL"),
+ ("email", "Email"),
+ ("anchor", "Anchor"),
+ ("file", "File"),
+ ("phone", "Phone"),
+ ],
+ label="Link to",
+ ),
+ ),
+ (
+ "page",
+ wagtail.blocks.PageChooserBlock(label="Page", required=False),
+ ),
+ (
+ "external_url",
+ wagtail.blocks.URLBlock(
+ help_text="Enter a full URL including http:// or https://",
+ label="External URL",
+ max_length=300,
+ required=False,
+ ),
+ ),
+ (
+ "relative_url",
+ wagtail.blocks.CharBlock(
+ help_text='A path relative to this domain. For example, "/foo/bar" or "?foo=bar".',
+ label="Relative URL",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.RelativeURLValidator()
+ ],
+ ),
+ ),
+ (
+ "anchor",
+ wagtail.blocks.CharBlock(
+ help_text='An id attribute of an element on the current page. For example, "#section-1"',
+ label="#",
+ max_length=300,
+ required=False,
+ validators=[
+ networkapi.wagtailpages.validators.AnchorLinkValidator()
+ ],
+ ),
+ ),
+ ("email", wagtail.blocks.EmailBlock(required=False)),
+ (
+ "file",
+ wagtail.documents.blocks.DocumentChooserBlock(
+ label="File", required=False
+ ),
+ ),
+ (
+ "phone",
+ wagtail.blocks.CharBlock(
+ label="Phone", max_length=30, required=False
+ ),
+ ),
+ (
+ "new_window",
+ wagtail.blocks.BooleanBlock(
+ label="Open in new window", required=False
+ ),
+ ),
+ ]
+ ),
+ help_text="Optional link that this mixed content block should link out to.",
+ max_num=1,
+ min_num=0,
+ ),
+ ),
+ ]
+ ),
+ ),
+ ],
+ use_json_field=True,
+ ),
+ ),
+ ]
diff --git a/network-api/networkapi/mozfest/models.py b/network-api/networkapi/mozfest/models.py
index d93cb378c68..2b165a26dfa 100644
--- a/network-api/networkapi/mozfest/models.py
+++ b/network-api/networkapi/mozfest/models.py
@@ -152,7 +152,6 @@ class MozfestPrimaryPage(FoundationMetadataPageMixin, FoundationBannerInheritanc
("current_events_slider", customblocks.CurrentEventsSliderBlock()),
("spaces", customblocks.SpacesBlock()),
("tito_widget", customblocks.TitoWidgetBlock()),
- ("newsletter_signup", customblocks.NewsletterSignupBlock()),
("statistics", mozfest_blocks.StatisticsBlock()),
("carousel_and_text", mozfest_blocks.CarouselTextBlock()),
("tickets", mozfest_blocks.TicketsBlock()),
@@ -433,7 +432,7 @@ class MozfestLandingPage(MozfestPrimaryPage):
# Content tab fields
TranslatableField("title"),
TranslatableField("banner_heading"),
- SynchronizedField("banner_image"),
+ SynchronizedField("banner"),
TranslatableField("banner_meta"),
TranslatableField("banner_text"),
SynchronizedField("banner_link_url"),
diff --git a/network-api/networkapi/mozfest/templates/fragments/blocks/carousel_text_block.html b/network-api/networkapi/mozfest/templates/fragments/blocks/carousel_text_block.html
index 02ffbaf3994..9fa9c5d1f67 100644
--- a/network-api/networkapi/mozfest/templates/fragments/blocks/carousel_text_block.html
+++ b/network-api/networkapi/mozfest/templates/fragments/blocks/carousel_text_block.html
@@ -1,7 +1,7 @@
{% load wagtailcore_tags wagtailimages_tags %}
{% block block_content %}
-
+
@@ -9,8 +9,10 @@
{{ self.heading }}
{% endif %}
{{ self.text|richtext }}
- {% if self.link_url and self.link_label %}
- {{ self.link_label }}
+ {% if self.link %}
+ {% with link=self.link.0 %}
+ {{ link.label }}
+ {% endwith %}
{% endif %}
- {% blocktrans with foundation_website_url='https://foundation.mozilla.org' foundation_website='foundation.mozilla.org' cc_website_url='https://foundation.mozilla.org/about/website-licensing/' trimmed %}
- Mozilla is a global non-profit dedicated to putting you in control of your online experience and shaping the future of the web for the public good. Visit us at {{ foundation_website }}. Most content available under a Creative Commons license.
- {% endblocktrans %}
-
-
-
-
-{% endblock %}
diff --git a/network-api/networkapi/templates/donate/blocks/notice_block.html b/network-api/networkapi/templates/donate/fragments/help_page_notice.html
similarity index 56%
rename from network-api/networkapi/templates/donate/blocks/notice_block.html
rename to network-api/networkapi/templates/donate/fragments/help_page_notice.html
index 798d3b91caf..7f8aa4f8eed 100644
--- a/network-api/networkapi/templates/donate/blocks/notice_block.html
+++ b/network-api/networkapi/templates/donate/fragments/help_page_notice.html
@@ -1,14 +1,13 @@
-
{% load l10n wagtailcore_tags wagtailimages_tags %}
- {% if value.image %}
+ {% if notice.notice_image %}
- {% image value.image fill-100x100-c100 format-jpeg as img %}
-
+ {% image notice.notice_image fill-100x100-c100 format-jpeg as img %}
+
{% if page.notice %}
- {% for block in page.notice %}
- {% include_block block %}
- {% endfor %}
+ {% include "../fragments/help_page_notice.html" with notice=page.notice %}
{% endif %}
- {% blocktrans with link="?form=donate&utm_medium=web&utm_source=faq-page&utm_campaign=23-Donor-Care" trimmed %}
+ {% blocktrans with link="?form=donor-care-intake" trimmed %}
If you need help with a donation to the Mozilla Foundation, please select the reason for your inquiry from the drop down and a donor care representative will get back to you as soon as possible.
{% endblocktrans %}
- {% if card.link_label and card.link_url %}
- {{ card.link_label }}
+ {% if card.link %}
+ {% with link=card.link.0 %}
+ {{ link.label }}
+ {% endwith %}
{% endif %}
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/button.html b/network-api/networkapi/templates/fragments/blocks/nav/button.html
new file mode 100644
index 00000000000..1ac6a0dd7ca
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/button.html
@@ -0,0 +1,13 @@
+{% load static wagtailadmin_tags %}
+
+{% if style == "primary" %}
+ {% fragment as nav_button_style %}tw-btn-primary tw-px-8{% endfragment %}
+{% elif style == "primary-full-width" %}
+ {% fragment as nav_button_style %}tw-btn-primary tw-min-w-full tw-px-8 tw-mb-12 xlarge:tw-mb-0{% endfragment %}
+{% elif style == "cta" %}
+ {% fragment as nav_button_style %}tw-leading-[130%] tw-text-blue-80 hover:tw-underline {{ link_hover_padding }}{% endfragment %}
+{% endif %}
+
+{% fragment as base_styles %}link-button tw-font-bold tw-text-lg{% endfragment %}
+
+{{ value.label }}
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/button.md b/network-api/networkapi/templates/fragments/blocks/nav/button.md
new file mode 100644
index 00000000000..bc07cc6cdd2
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/button.md
@@ -0,0 +1,8 @@
+# Navigation Button
+
+A call-to-action to a page, relative URL or external URL.
+
+Takes one of the following `style` options:
+* `primary` (for a solid primary button)
+* `primary-full-width` (for a solid primary button with 100% width of the container%)
+* `cta` (for blue text on white background)
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/button.yml b/network-api/networkapi/templates/fragments/blocks/nav/button.yml
new file mode 100644
index 00000000000..2934097196b
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/button.yml
@@ -0,0 +1,7 @@
+name: Navigation Button
+context:
+ value:
+ label: "Learn more"
+ url: https://google.com
+ open_in_new_window: False
+ style: primary
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/column.html b/network-api/networkapi/templates/fragments/blocks/nav/column.html
new file mode 100644
index 00000000000..b4b3a0e89e7
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/column.html
@@ -0,0 +1,18 @@
+{% load wagtailcore_tags wagtailadmin_tags %}
+
+{% fragment as base_styles %}tw-gap-y-8 xlarge:tw-gap-y-4{% endfragment %}
+{% fragment as desktop_layout %}{% endfragment %}
+
+
+
{% block title %}{{ value.title }}{% endblock title %}
+
+ {% block content %}
+ {% for item in value.nav_items %}
+
{% include_block item with link_hover_padding=link_hover_padding %}
+ {% endfor %}
+ {% if value.has_button %}
+
{% include_block value.button_value with style="cta" link_hover_padding=link_hover_padding %}
+ {% endif %}
+ {% endblock content %}
+
+
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/column.yml b/network-api/networkapi/templates/fragments/blocks/nav/column.yml
new file mode 100644
index 00000000000..995c9bfe7b1
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/column.yml
@@ -0,0 +1,34 @@
+name: Navigation Column
+context:
+ value:
+ title: "Research & Analysis"
+ nav_items:
+ - value:
+ label: "Trustworthy AI Progress Report"
+ description: "Promoting openness, competition, and accountability in AI"
+ url: /foo/bar
+ is_external: false
+ - value:
+ label: "Internet Health Report"
+ description: "Issues impacting a healthy internet"
+ url: /foo/bar
+ is_external: true
+ - value:
+ label: "AI Policy"
+ description: "Policy recommendations for AI"
+ url: /foo/bar
+ is_external: false
+ has_button: true
+ button:
+ value:
+ label: "See all research"
+ url: /foo/bar
+ is_external: false
+ style: "cta-link"
+
+tags:
+ include_block:
+ 'item':
+ template_name: "fragments/blocks/nav/item.html"
+ 'value.button with style="cta-link"':
+ template_name: "fragments/blocks/nav/variants/button--cta-link.html"
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/dropdown.html b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.html
new file mode 100644
index 00000000000..3928ed69a25
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.html
@@ -0,0 +1,64 @@
+{% load static wagtailcore_tags wagtailadmin_tags nav_tags %}
+
+{% fragment as content_base_styles %}tw-overflow-y-auto tw-transition-all tw-duration-500 tw-bg-white xlarge:tw-bg-transparent xlarge:tw-max-w-[1200px]{% endfragment %}
+{% fragment as dropdown_selector_base %}tw-container tw-flex tw-flex-row tw-items-center tw-justify-between tw-w-full tw-gap-4{% endfragment %}
+
+{% fragment as content_desktop %}xlarge:tw-px-0 xlarge:tw-hidden{% endfragment %}
+{% fragment as content_desktop_border %}xlarge:tw-border xlarge:tw-border-gray-20{% endfragment %}
+{% comment %} 40 (5rem) is the height of the navbar {% endcomment %}
+{% fragment as content_desktop_positioning %}xlarge:tw-fixed xlarge:tw-top-40 xlarge:tw-left-0 xlarge:tw-right-0 xlarge:tw-mx-auto{% endfragment %}
+
+{% fragment as title_base_typography %}tw-font-sans tw-font-bold tw-text-xl tw-text-black{% endfragment %}
+{% fragment as title_desktop_typography %}xlarge:tw-text-lg{% endfragment %}
+{% comment %} 2.5rem for half the navbar's height, 14px for half the title's line height, 6px for the title bottom border and 1 px for the dropdown border:{% endcomment %}
+{% fragment as title_underline %}xlarge:tw-h-full xlarge:tw-pt-[calc(2.5rem-14px)] xlarge:tw-pb-[calc(2.5rem-14px-6px+1px)]{% endfragment %}
+
+{% get_dropdown_id menu=menu idx=forloop.counter0 as dropdown_id %}
+{% if dropdown_id %}
+ {% check_if_dropdown_can_be_active dropdown_id as can_dropdown_be_active %}
+{% endif %}
+
+
+
+
+
+
+
+
+ {% block content %}
+ {% if value.has_overview %}
+ {% include_block value.overview_value with button=value.button %}
+ {% endif %}
+ {% for column in value.columns %}
+ {% include_block column with link_hover_padding=link_hover_padding %}
+ {% endfor %}
+ {% if value.has_featured_column %}
+ {% include_block value.featured_column_value with link_hover_padding=link_hover_padding %}
+ {% endif %}
+ {% endblock content %}
+
+ {% block full_span_button %}
+ {% comment %}
+ If there is a button but no overview, we want to render the button at the bottom
+ of the dropdown. Otherwise it will be rendered together with the overview.
+ {% endcomment %}
+ {% if value.button and not value.has_overview %}
+
+ {% include_block value.button with style="primary-full-width" %}
+
+ {% endif %}
+ {% endblock full_span_button %}
+
+
+
+
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/dropdown.md b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.md
new file mode 100644
index 00000000000..e0dcb9e1ed4
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.md
@@ -0,0 +1,3 @@
+# Navigation Dropdown
+
+A collection of navigation columns.
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/dropdown.yml b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.yml
new file mode 100644
index 00000000000..7024dec14ad
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/dropdown.yml
@@ -0,0 +1,29 @@
+name: Navigation Dropdown
+context:
+ value:
+ title: "Who We Are"
+ has_overview: True
+ overview:
+ title: About Us
+ description: "Mozilla is a global nonprofit dedicated to keeping the Internet a public resource that is open and accessible to all."
+ columns:
+ - column:
+ - column:
+ has_featured_column: true
+ featured_column:
+ - featured_column:
+ has_button: true
+ button:
+ - button:
+ style: mobile
+
+tags:
+ include_block:
+ 'value.overview|first with button=value.button|first':
+ template_name: "fragments/blocks/nav/overview.html"
+ 'column':
+ template_name: "fragments/blocks/nav/column.html"
+ 'value.button|first with style="primary-full-width"':
+ template_name: "fragments/blocks/nav/variants/button--primary-full-width.html"
+ 'value.featured_column|first':
+ template_name: "fragments/blocks/nav/featured-column.html"
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/featured-column.html b/network-api/networkapi/templates/fragments/blocks/nav/featured-column.html
new file mode 100644
index 00000000000..1ef62493f9d
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/featured-column.html
@@ -0,0 +1,15 @@
+{% load wagtailcore_tags wagtailadmin_tags %}
+
+{% fragment as base_styles %}tw-gap-y-8 xlarge:tw-gap-y-4 tw-bg-gray-02 tw-rounded-2xl{% endfragment %}
+{% fragment as desktop_layout %}xlarge:tw-rounded-none xlarge:tw-col-span-1{% endfragment %}
+
+
+
{% block title %}{{ value.title }}{% endblock title %}
+
+ {% block content %}
+ {% for item in value.nav_items %}
+
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/featured-item.md b/network-api/networkapi/templates/fragments/blocks/nav/featured-item.md
new file mode 100644
index 00000000000..156502d91f8
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/featured-item.md
@@ -0,0 +1,3 @@
+# Navigation Featured Item
+
+A featured item in the navigation menu, holding a title, an icon and a link to a resource.
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/featured-item.yml b/network-api/networkapi/templates/fragments/blocks/nav/featured-item.yml
new file mode 100644
index 00000000000..39826542779
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/featured-item.yml
@@ -0,0 +1,13 @@
+name: Navigation Featured Item
+context:
+ value:
+ label: "Make a Donation"
+ icon:
+ url: /donate
+ is_external: True
+
+tags:
+ image:
+ value.icon height-18 preserve-svg:
+ raw:
+ ''
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/item.html b/network-api/networkapi/templates/fragments/blocks/nav/item.html
new file mode 100644
index 00000000000..b6e60086ce8
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/item.html
@@ -0,0 +1,30 @@
+{% load static i18n wagtailadmin_tags nav_tags %}
+
+{% fragment as font_styles %}tw-text-xl large:tw-text-lg tw-font-semibold tw-text-black{% endfragment %}
+{% fragment as hover_styles %}group-hover/item:tw-text-blue-80 group-hover/item:tw-underline{% endfragment %}
+
+{% fragment as active_wayfinder_style %}tw-underline tw-decoration-2{% endfragment %}
+
+{% check_if_link_is_active value as link_active %}
+
+
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/item.md b/network-api/networkapi/templates/fragments/blocks/nav/item.md
new file mode 100644
index 00000000000..43c24b9cd0a
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/item.md
@@ -0,0 +1,5 @@
+# Navigation Item
+
+An item in the navigation menu, holding a title and a link to a resource.
+
+If the resource is external to MoFo or it's a MoFo page with their own navigation menu (like PNI), the item should display an arrow (↗) indicating that this is an external resource and open it in a new tab.
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/item.yml b/network-api/networkapi/templates/fragments/blocks/nav/item.yml
new file mode 100644
index 00000000000..ae2325a073d
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/item.yml
@@ -0,0 +1,7 @@
+name: Navigation Item
+context:
+ value:
+ label: "*Privacy not included"
+ description: Scrutinizing the privacy & security of consumer tech
+ url: /privacynotincluded
+ is_external: True
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/overview.html b/network-api/networkapi/templates/fragments/blocks/nav/overview.html
new file mode 100644
index 00000000000..d906a19a796
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/overview.html
@@ -0,0 +1,15 @@
+{% load wagtailcore_tags wagtailadmin_tags %}
+
+{% fragment as base_styles %}tw-gap-14 tw-pb-20 xlarge:tw-pb-16 xlarge:tw-pr-8{% endfragment %}
+{% fragment as border_styles %}tw-border-b-gray-05 tw-border-b-[1px] xlarge:tw-pb-0 xlarge:tw-border-b-0 xlarge:tw-border-r-gray-05 xlarge:tw-border-r-[1px]{% endfragment %}
+{% fragment as desktop_layout %}xlarge:tw-border-r{% endfragment %}
+
+
+
+
{{ value.title }}
+
{{ value.description|richtext }}
+
+ {% if button %}
+ {% include_block button with style="primary" %}
+ {% endif %}
+
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/overview.md b/network-api/networkapi/templates/fragments/blocks/nav/overview.md
new file mode 100644
index 00000000000..243e69d76d9
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/overview.md
@@ -0,0 +1,5 @@
+# Navigation Overview
+
+A block with a title and a description for the navigation dropdown menu.
+
+Takes an optional "button" block property, which will render the button block as part of the overview block.
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/overview.yml b/network-api/networkapi/templates/fragments/blocks/nav/overview.yml
new file mode 100644
index 00000000000..b2cbbacd4f6
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/overview.yml
@@ -0,0 +1,11 @@
+name: Navigation Overview
+context:
+ value:
+ title: About Us
+ description: Mozilla is a global nonprofit dedicated to keeping the Internet a public resource that is open and accessible to all.
+ button: True
+
+tags:
+ include_block:
+ 'button with style="primary"':
+ template_name: "fragments/blocks/nav/button.html"
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/variants/button--cta.html b/network-api/networkapi/templates/fragments/blocks/nav/variants/button--cta.html
new file mode 100644
index 00000000000..9a30602631f
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/variants/button--cta.html
@@ -0,0 +1 @@
+{% include "fragments/blocks/nav/button.html" with style="cta" %}
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blocks/nav/variants/button--primary-full-width.html b/network-api/networkapi/templates/fragments/blocks/nav/variants/button--primary-full-width.html
new file mode 100644
index 00000000000..0e4cf53e041
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/blocks/nav/variants/button--primary-full-width.html
@@ -0,0 +1 @@
+{% include "fragments/blocks/nav/button.html" with style="primary-full-width" %}
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/blog_index_feature.html b/network-api/networkapi/templates/fragments/blog_index_feature.html
index 5969dca9e73..36a09f3b6b9 100644
--- a/network-api/networkapi/templates/fragments/blog_index_feature.html
+++ b/network-api/networkapi/templates/fragments/blog_index_feature.html
@@ -5,15 +5,15 @@
- {% include "wagtailpages/fragments/blog_topics.html" with topics=blog_page.specific.topics.all video_post=True published_date=blog_page.first_published_at %}
+ {% include "wagtailpages/fragments/blog_topics.html" with topics=blog_page.topics.all video_post=True published_date=blog_page.first_published_at %}
{% if video_url %}
{% endif %}
{{ blog_page.first_published_at|date:"DATE_FORMAT" }}
+ {% include "./button.html" with url=menu.blog_button_url label=menu.blog_button_label %}
+
+{% endblock full_span_button %}
diff --git a/network-api/networkapi/templates/fragments/nav/blog/blog-dropdown.yml b/network-api/networkapi/templates/fragments/nav/blog/blog-dropdown.yml
new file mode 100644
index 00000000000..8af1fe2c3e0
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/blog-dropdown.yml
@@ -0,0 +1,56 @@
+name: Blog Dropdown
+context:
+ style: desktop # desktop or mobile
+ menu:
+ localized_featured_blog_posts:
+ - title: "Mozilla Research: Watermarking, Content Labeling Struggle to Effectively Distinguish AI-Generated Content"
+ get_meta_description: "Popular methods used for disclosing synthetic content only rate as ‘Low’ or ‘Fair’ in Mozilla analysis. Shortcomings persist amid 2024’s record-number of elections"
+ topics:
+ all:
+ - name: Insights
+ slug: insights
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+ - title: "Was This Video Generated Using AI? Here’s How To Tell "
+ get_meta_description: "OpenAI’s Sora tool will let you generate video using a short paragraph prompt. Here’s what you need to know and how to tell if the video you’re seeing was made by AI."
+ topics:
+ all:
+ - name: Advocacy
+ slug: advocacy
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+ - title: "New Research: Are Well-Being Apps Actually Harming Us?"
+ get_meta_description: "Creative Media Awardee Well-being Struggle interrogates the motives and consequences of digital mental health products, especially in a corporate setting."
+ topics:
+ all:
+ - name: Fellowships & Awards
+ slug: fellowships-awards
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+ localized_featured_blog_topics:
+ - topic:
+ name: Advocacy
+ icon:
+ - topic:
+ name: Fellowship & Awards
+ icon:
+ - topic:
+ name: Common Voice
+ icon:
+ - topic:
+ name: Insights
+ icon:
+ blog_button_label: "See all blog posts"
+
+
+tags:
+ image:
+ 'icon fill-18x18 preserve-svg':
+ raw:
+ ''
diff --git a/network-api/networkapi/templates/fragments/nav/blog/button.html b/network-api/networkapi/templates/fragments/nav/blog/button.html
new file mode 100644
index 00000000000..eecafaf1215
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/button.html
@@ -0,0 +1,6 @@
+{% load static wagtailadmin_tags %}
+
+{% fragment as nav_button_style %}tw-btn-primary tw-min-w-full tw-py-4 tw-px-8 tw-mb-12 xlarge:tw-mb-0{% endfragment %}
+{% fragment as base_styles %}link-button tw-font-bold tw-text-lg{% endfragment %}
+
+{{ label }}
diff --git a/network-api/networkapi/templates/fragments/nav/blog/button.yml b/network-api/networkapi/templates/fragments/nav/blog/button.yml
new file mode 100644
index 00000000000..fd18aaf8f9a
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/button.yml
@@ -0,0 +1,4 @@
+name: Blog Dropdown CTA Button
+context:
+ url: "/en/blog/"
+ label: "See all blog posts"
diff --git a/network-api/networkapi/templates/fragments/nav/blog/featured-posts.html b/network-api/networkapi/templates/fragments/nav/blog/featured-posts.html
new file mode 100644
index 00000000000..fe224f7b082
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/featured-posts.html
@@ -0,0 +1,13 @@
+{% extends "fragments/blocks/nav/column.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Featured Posts" %}{% endblock title %}
+
+{% block column_size %}xlarge:tw-col-span-2{% endblock column_size %}
+
+{% block content %}
+ {% for post in posts %}
+
{% include "./post.html" with post=post %}
+ {% endfor %}
+{% endblock content %}
diff --git a/network-api/networkapi/templates/fragments/nav/blog/featured-posts.yml b/network-api/networkapi/templates/fragments/nav/blog/featured-posts.yml
new file mode 100644
index 00000000000..473e07ca2c6
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/featured-posts.yml
@@ -0,0 +1,38 @@
+name: Blog Dropdown Featured Posts
+context:
+ posts:
+ - title: "Mozilla Research: Watermarking, Content Labeling Struggle to Effectively Distinguish AI-Generated Content"
+ get_meta_description: "Popular methods used for disclosing synthetic content only rate as ‘Low’ or ‘Fair’ in Mozilla analysis. Shortcomings persist amid 2024’s record-number of elections"
+ topics:
+ all:
+ - name: Insights
+ slug: insights
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+ - title: "Was This Video Generated Using AI? Here’s How To Tell "
+ get_meta_description: "OpenAI’s Sora tool will let you generate video using a short paragraph prompt. Here’s what you need to know and how to tell if the video you’re seeing was made by AI."
+ topics:
+ all:
+ - name: Advocacy
+ slug: advocacy
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+ - title: "New Research: Are Well-Being Apps Actually Harming Us?"
+ get_meta_description: "Creative Media Awardee Well-being Struggle interrogates the motives and consequences of digital mental health products, especially in a corporate setting."
+ topics:
+ all:
+ - name: Fellowships & Awards
+ slug: fellowships-awards
+ - name: AI
+ slug: ai
+ - name: Misinformation
+ slug: misinformation
+
+tags:
+ pageurl:
+ post:
+ raw: "/en/blog/mozilla-research-watermarking-content-labeling-struggle-to-effectively-distinguish-ai-generated-content/"
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/nav/blog/featured-topics.html b/network-api/networkapi/templates/fragments/nav/blog/featured-topics.html
new file mode 100644
index 00000000000..6744c08d482
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/nav/blog/featured-topics.html
@@ -0,0 +1,11 @@
+{% extends "fragments/blocks/nav/featured-column.html" %}
+
+{% load i18n %}
+
+{% block title %}{% trans "Popular topics" %}{% endblock title %}
+
+{% block content %}
+ {% for relationship in relationships %}
+
{% include "./topic.html" with topic=relationship.topic icon=relationship.icon %}
+ {% include "fragments/nav_links.html" with pre="
" post="
" %}
+ {% endblock %}
+
-
- {% endblock %}
-
- {% endblock %}
-
-
-
-
-
-
-
Mozilla News email list to get action alerts & internet tips right to your inbox." %}"
- >
-
-
-
-
-
+
\ No newline at end of file
diff --git a/network-api/networkapi/templates/fragments/publication_hero.html b/network-api/networkapi/templates/fragments/publication_hero.html
index 3810d58124d..3d0c946a837 100644
--- a/network-api/networkapi/templates/fragments/publication_hero.html
+++ b/network-api/networkapi/templates/fragments/publication_hero.html
@@ -20,7 +20,7 @@
{% if is_publication_article or is_publication_page %}
{% for entry in self.breadcrumb_list %}
- {% with parent_page=entry.localized %}
+ {% with parent_page=entry %}
{{ parent_page.title }} ›
{% endwith %}
diff --git a/network-api/networkapi/templates/fragments/responsive_screen_wide_image.html b/network-api/networkapi/templates/fragments/responsive_screen_wide_image.html
index d48548f65db..977d4733b29 100644
--- a/network-api/networkapi/templates/fragments/responsive_screen_wide_image.html
+++ b/network-api/networkapi/templates/fragments/responsive_screen_wide_image.html
@@ -1,4 +1,4 @@
-{% load wagtailimages_tags %}
+{% load wagtailimages_tags i18n %}
diff --git a/network-api/networkapi/templates/fragments/svg/nav_icons.html b/network-api/networkapi/templates/fragments/svg/nav_icons.html
new file mode 100644
index 00000000000..2981d599b7b
--- /dev/null
+++ b/network-api/networkapi/templates/fragments/svg/nav_icons.html
@@ -0,0 +1,5 @@
+{% if icon_type == "external_link" %}
+
+
+
+{% endif %}
diff --git a/network-api/networkapi/templates/icons/nav-dropdown.svg b/network-api/networkapi/templates/icons/nav-dropdown.svg
new file mode 100644
index 00000000000..ec10e9a97ee
--- /dev/null
+++ b/network-api/networkapi/templates/icons/nav-dropdown.svg
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/network-api/networkapi/templates/icons/nav-menu.svg b/network-api/networkapi/templates/icons/nav-menu.svg
new file mode 100644
index 00000000000..edf306df802
--- /dev/null
+++ b/network-api/networkapi/templates/icons/nav-menu.svg
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/network-api/networkapi/templates/pages/base.html b/network-api/networkapi/templates/pages/base.html
index f48e91af86d..57f4269f1ac 100644
--- a/network-api/networkapi/templates/pages/base.html
+++ b/network-api/networkapi/templates/pages/base.html
@@ -15,7 +15,7 @@
{% block page_title %}
{% environment_prefix %}
- {% trans "Mozilla Foundation" %} - {% if page.specifics.seo_title %}{{ page.specifics.seo_title }}{% else %}{{ page.title }}{% endif %}
+ {% if page.specifics.seo_title %}{{ page.specifics.seo_title }}{% else %}{{ page.title }}{% endif %} - {% trans "Mozilla Foundation" %}
{% endblock %}
@@ -64,9 +64,7 @@
{% block stylesheets %}
-
-
-
+
{% endblock %}
{% block extended_head %}{% endblock %}
@@ -107,7 +105,13 @@
{% block primary_nav %}
- {% include "fragments/primary_nav.html" with background="simple-background" %}
+ {% with nav_menu=settings.nav.SiteNavMenu.active_nav_menu %}
+ {% if nav_menu %}
+ {% include "fragments/nav/menu.html" with menu=nav_menu.localized %}
+ {% else %}
+ {% include "fragments/primary_nav.html" with background="simple-background" %}
+ {% endif %}
+ {% endwith %}
{% endblock %}
diff --git a/network-api/networkapi/templates/pages/buyersguide/base.html b/network-api/networkapi/templates/pages/buyersguide/base.html
index def39a4650e..1e2397dec69 100644
--- a/network-api/networkapi/templates/pages/buyersguide/base.html
+++ b/network-api/networkapi/templates/pages/buyersguide/base.html
@@ -6,8 +6,16 @@
{% block page_title %}
{% environment_prefix %}
- {% if pageTitle %}{{ pageTitle }}
- {% else %}{% blocktrans context "“*Privacy Not Included” can be localized. This is a reference to the “*batteries not included” mention on toys." %}*Privacy Not Included | Shop smart and safe{% endblocktrans %} | Mozilla Foundation{% endif %}
+ {# if routable page #}
+ {% if pageTitle %}
+ {{ pageTitle }}
+ {# if custom seo_title for a wagtail page #}
+ {% elif page.seo_title %}
+ {{ page.seo_title }}
+ {# default to page.title #}
+ {% else %}
+ {% trans "*Privacy Not Included" context "*Privacy Not Included can be localized. This is a reference to the “*batteries not included” mention on toys." %} | {{ page.title }} | {% trans "Mozilla Foundation" %}
+ {% endif %}
{% endblock %}
{# TODO: consider using a different ga_identifier? #}
@@ -31,8 +39,7 @@
{% block stylesheets %}
{% if debug %}{% endif %}
-
-
+
{% endblock %}
{% block extended_head %}{% endblock %}
diff --git a/network-api/networkapi/templates/pages/buyersguide/catalog.html b/network-api/networkapi/templates/pages/buyersguide/catalog.html
index 5381b208513..0c31382f448 100644
--- a/network-api/networkapi/templates/pages/buyersguide/catalog.html
+++ b/network-api/networkapi/templates/pages/buyersguide/catalog.html
@@ -1,6 +1,6 @@
{% extends "pages/buyersguide/base.html" %}
-{% load static env i18n static wagtailimages_tags wagtailroutablepage_tags wagtailcore_tags cache bg_nav_tags localization %}
+{% load static env i18n static wagtailimages_tags wagtailroutablepage_tags wagtailcore_tags bg_nav_tags localization %}
{% block extended_head %}