From 340834e4ddc2e8b81b46be76b1a15497afc4e94c Mon Sep 17 00:00:00 2001 From: Chuck Sebian-Lander Date: Wed, 16 Nov 2022 11:07:58 -0500 Subject: [PATCH 1/2] Adding byline to text-introduction --- .../migrations/0006_text_intro_byline.py | 22 +++++++ .../molecules/text-introduction.html | 29 ++++++++++ .../migrations/0017_text_intro_byline.py | 27 +++++++++ .../migrations/0036_text_intro_byline.py | 21 +++++++ .../migrations/0005_text_intro_byline.py | 21 +++++++ cfgov/v1/atomic_elements/molecules.py | 7 +++ cfgov/v1/migrations/0222_text_intro_byline.py | 58 +++++++++++++++++++ 7 files changed, 185 insertions(+) create mode 100644 cfgov/form_explainer/migrations/0006_text_intro_byline.py create mode 100644 cfgov/paying_for_college/migrations/0017_text_intro_byline.py create mode 100644 cfgov/regulations3k/migrations/0036_text_intro_byline.py create mode 100644 cfgov/teachers_digital_platform/migrations/0005_text_intro_byline.py create mode 100644 cfgov/v1/migrations/0222_text_intro_byline.py diff --git a/cfgov/form_explainer/migrations/0006_text_intro_byline.py b/cfgov/form_explainer/migrations/0006_text_intro_byline.py new file mode 100644 index 00000000000..b79b5317dde --- /dev/null +++ b/cfgov/form_explainer/migrations/0006_text_intro_byline.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.15 on 2022-11-16 16:06 + +from django.db import migrations + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('form_explainer', '0005_add_explainer_heading'), + ] + + operations = [ + migrations.AlterField( + model_name='formexplainerpage', + name='header', + field=wagtail.core.fields.StreamField([('hero', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(help_text='For complete guidelines on creating heroes, visit our Design System. Character counts (including spaces) at largest breakpoint:', required=False)), ('body', wagtail.core.blocks.RichTextBlock(help_text='Character counts (including spaces) at largest breakpoint:', label='Sub-heading', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='When saving illustrations, use a transparent background. See image dimension guidelines.', label='Large image', required=False)), ('small_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Provides an alternate image for small displays when using a photo or bleeding hero. Not required for the standard illustration. See image dimension guidelines.', required=False)), ('background_color', wagtail.core.blocks.CharBlock(help_text='Specify a hex value (including the # sign) from our official color palette.', required=False)), ('is_white_text', wagtail.core.blocks.BooleanBlock(help_text='Optional. Turns the hero text white. Useful if using a dark background color or background image.', label='White text', required=False)), ('is_overlay', wagtail.core.blocks.BooleanBlock(help_text='Optional. Uses the large image as a background under the entire hero, creating the "Photo" style of hero (see Design System for details). When using this option, make sure to specify a background color (above) for the left/right margins that appear when screens are wider than 1200px and for the text section when the photo and text stack at mobile sizes.', label='Photo', required=False)), ('is_bleeding', wagtail.core.blocks.BooleanBlock(help_text='Optional. Select if you want the illustration to bleed vertically off the top and bottom of the hero space.', label='Bleed', required=False))])), ('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))]))], blank=True), + ), + ] diff --git a/cfgov/jinja2/v1/_includes/molecules/text-introduction.html b/cfgov/jinja2/v1/_includes/molecules/text-introduction.html index d8d287612b6..e1539f27dd7 100644 --- a/cfgov/jinja2/v1/_includes/molecules/text-introduction.html +++ b/cfgov/jinja2/v1/_includes/molecules/text-introduction.html @@ -29,10 +29,15 @@ value.links[i].aria_label: (Optional) An aria-label for the link. + value.date: (Optional) A date to be included on a byline. + value.has_rule: Whether or not to render a rule line (border-bottom) at the bottom of the molecule. ========================================================================== #} +{% set published_date = value.date %} +{% set has_authors = page.authors.exists() %} + {% if value.eyebrow %}
{{ value.eyebrow }}
{% endif %} @@ -40,11 +45,35 @@

{{ value.heading }}

{% endif %} +{% if published_date or has_authors %} +
+{% endif %} +{% if has_authors %} + +{% endif %} +{% if published_date %} + + {% import 'macros/time.html' as time %} + {{ time.render(published_date, {'date':true}) }} + +{% endif %} +{% if published_date or has_authors %} +
+{% endif %} + {% if value.intro.source %}
{{ value.intro | safe }}
{% endif %} + {% if value.body %} {{ value.body | safe }} {% endif %} diff --git a/cfgov/paying_for_college/migrations/0017_text_intro_byline.py b/cfgov/paying_for_college/migrations/0017_text_intro_byline.py new file mode 100644 index 00000000000..adbdc5c0501 --- /dev/null +++ b/cfgov/paying_for_college/migrations/0017_text_intro_byline.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2.15 on 2022-11-16 16:06 + +from django.db import migrations + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('paying_for_college', '0016_heading_block_h5s'), + ] + + operations = [ + migrations.AlterField( + model_name='collegecostspage', + name='header', + field=wagtail.core.fields.StreamField([('hero', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(help_text='For complete guidelines on creating heroes, visit our Design System. Character counts (including spaces) at largest breakpoint:', required=False)), ('body', wagtail.core.blocks.RichTextBlock(help_text='Character counts (including spaces) at largest breakpoint:', label='Sub-heading', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='When saving illustrations, use a transparent background. See image dimension guidelines.', label='Large image', required=False)), ('small_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Provides an alternate image for small displays when using a photo or bleeding hero. Not required for the standard illustration. See image dimension guidelines.', required=False)), ('background_color', wagtail.core.blocks.CharBlock(help_text='Specify a hex value (including the # sign) from our official color palette.', required=False)), ('is_white_text', wagtail.core.blocks.BooleanBlock(help_text='Optional. Turns the hero text white. Useful if using a dark background color or background image.', label='White text', required=False)), ('is_overlay', wagtail.core.blocks.BooleanBlock(help_text='Optional. Uses the large image as a background under the entire hero, creating the "Photo" style of hero (see Design System for details). When using this option, make sure to specify a background color (above) for the left/right margins that appear when screens are wider than 1200px and for the text section when the photo and text stack at mobile sizes.', label='Photo', required=False)), ('is_bleeding', wagtail.core.blocks.BooleanBlock(help_text='Optional. Select if you want the illustration to bleed vertically off the top and bottom of the hero space.', label='Bleed', required=False))])), ('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))]))], blank=True), + ), + migrations.AlterField( + model_name='repayingstudentdebtpage', + name='header', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))]))], blank=True), + ), + ] diff --git a/cfgov/regulations3k/migrations/0036_text_intro_byline.py b/cfgov/regulations3k/migrations/0036_text_intro_byline.py new file mode 100644 index 00000000000..2e3bc1e4819 --- /dev/null +++ b/cfgov/regulations3k/migrations/0036_text_intro_byline.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.15 on 2022-11-16 16:06 + +from django.db import migrations + +import wagtail.core.blocks +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('regulations3k', '0035_heading_block_h5s'), + ] + + operations = [ + migrations.AlterField( + model_name='regulationpage', + name='header', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))]))], blank=True), + ), + ] diff --git a/cfgov/teachers_digital_platform/migrations/0005_text_intro_byline.py b/cfgov/teachers_digital_platform/migrations/0005_text_intro_byline.py new file mode 100644 index 00000000000..9cd46d02ae9 --- /dev/null +++ b/cfgov/teachers_digital_platform/migrations/0005_text_intro_byline.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.15 on 2022-11-16 16:06 + +from django.db import migrations + +import wagtail.core.blocks +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('teachers_digital_platform', '0004_activitypage_search_tags'), + ] + + operations = [ + migrations.AlterField( + model_name='activityindexpage', + name='header', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('notification', wagtail.core.blocks.StructBlock([('type', wagtail.core.blocks.ChoiceBlock(choices=[('information', 'Information'), ('warning', 'Warning')])), ('message', wagtail.core.blocks.CharBlock(help_text='The main notification message to display.', required=True)), ('explanation', wagtail.core.blocks.TextBlock(help_text='Explanation text appears below the message in smaller type.', required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), help_text='Links appear on their own lines below the explanation.', required=False))]))], blank=True), + ), + ] diff --git a/cfgov/v1/atomic_elements/molecules.py b/cfgov/v1/atomic_elements/molecules.py index c50cf3d2242..53dd0d02acc 100644 --- a/cfgov/v1/atomic_elements/molecules.py +++ b/cfgov/v1/atomic_elements/molecules.py @@ -47,6 +47,13 @@ class TextIntroduction(blocks.StructBlock): "text introduction." ), ) + date = blocks.DateBlock( + required=False, + label="Published Date (BYLINE ONLY)", + help_text=( + "IMPORTANT: Only include if this page " + "should have a byline." + ), + ) def clean(self, value): cleaned = super().clean(value) diff --git a/cfgov/v1/migrations/0222_text_intro_byline.py b/cfgov/v1/migrations/0222_text_intro_byline.py new file mode 100644 index 00000000000..1384b243bd0 --- /dev/null +++ b/cfgov/v1/migrations/0222_text_intro_byline.py @@ -0,0 +1,58 @@ +# Generated by Django 3.2.15 on 2022-11-16 16:06 + +import django.core.validators +from django.db import migrations + +import wagtail.core.blocks +import wagtail.core.fields +import wagtail.images.blocks +import wagtail.snippets.blocks + +import v1.atomic_elements.tables +import v1.blocks +import v1.util.ref + + +class Migration(migrations.Migration): + + dependencies = [ + ('v1', '0221_update_how_to_schema'), + ] + + operations = [ + migrations.AlterField( + model_name='abstractfilterpage', + name='header', + field=wagtail.core.fields.StreamField([('article_subheader', wagtail.core.blocks.RichTextBlock(icon='form')), ('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('item_introduction', wagtail.core.blocks.StructBlock([('show_category', wagtail.core.blocks.BooleanBlock(default=True, help_text="Whether to show the category or not (category must be set in 'Configuration').", required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('date', wagtail.core.blocks.DateBlock(required=False)), ('has_social', wagtail.core.blocks.BooleanBlock(help_text='Whether to show the share icons or not.', required=False))])), ('notification', wagtail.core.blocks.StructBlock([('type', wagtail.core.blocks.ChoiceBlock(choices=[('information', 'Information'), ('warning', 'Warning')])), ('message', wagtail.core.blocks.CharBlock(help_text='The main notification message to display.', required=True)), ('explanation', wagtail.core.blocks.TextBlock(help_text='Explanation text appears below the message in smaller type.', required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), help_text='Links appear on their own lines below the explanation.', required=False))]))], blank=True), + ), + migrations.AlterField( + model_name='browsefilterablepage', + name='header', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))]))]), + ), + migrations.AlterField( + model_name='browsepage', + name='header', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))])), ('notification', wagtail.core.blocks.StructBlock([('type', wagtail.core.blocks.ChoiceBlock(choices=[('information', 'Information'), ('warning', 'Warning')])), ('message', wagtail.core.blocks.CharBlock(help_text='The main notification message to display.', required=True)), ('explanation', wagtail.core.blocks.TextBlock(help_text='Explanation text appears below the message in smaller type.', required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), help_text='Links appear on their own lines below the explanation.', required=False))]))], blank=True), + ), + migrations.AlterField( + model_name='landingpage', + name='header', + field=wagtail.core.fields.StreamField([('hero', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(help_text='For complete guidelines on creating heroes, visit our Design System. Character counts (including spaces) at largest breakpoint:', required=False)), ('body', wagtail.core.blocks.RichTextBlock(help_text='Character counts (including spaces) at largest breakpoint:', label='Sub-heading', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='When saving illustrations, use a transparent background. See image dimension guidelines.', label='Large image', required=False)), ('small_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional. Provides an alternate image for small displays when using a photo or bleeding hero. Not required for the standard illustration. See image dimension guidelines.', required=False)), ('background_color', wagtail.core.blocks.CharBlock(help_text='Specify a hex value (including the # sign) from our official color palette.', required=False)), ('is_white_text', wagtail.core.blocks.BooleanBlock(help_text='Optional. Turns the hero text white. Useful if using a dark background color or background image.', label='White text', required=False)), ('is_overlay', wagtail.core.blocks.BooleanBlock(help_text='Optional. Uses the large image as a background under the entire hero, creating the "Photo" style of hero (see Design System for details). When using this option, make sure to specify a background color (above) for the left/right margins that appear when screens are wider than 1200px and for the text section when the photo and text stack at mobile sizes.', label='Photo', required=False)), ('is_bleeding', wagtail.core.blocks.BooleanBlock(help_text='Optional. Select if you want the illustration to bleed vertically off the top and bottom of the hero space.', label='Bleed', required=False))])), ('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))]))], blank=True), + ), + migrations.AlterField( + model_name='storypage', + name='content', + field=wagtail.core.fields.StreamField([('expandable_group', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(help_text='Added as an <h3> at the top of this block. Also adds a wrapping <div> whose id attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('is_accordion', wagtail.core.blocks.BooleanBlock(required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('is_faq', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add FAQ schema markup to expandables.', label='Uses FAQ schema', required=False)), ('expandables', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('is_bordered', wagtail.core.blocks.BooleanBlock(required=False)), ('is_midtone', wagtail.core.blocks.BooleanBlock(required=False)), ('is_expanded', wagtail.core.blocks.BooleanBlock(required=False)), ('content', wagtail.core.blocks.StreamBlock([('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))])), ('links', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])), ('email', wagtail.core.blocks.StructBlock([('emails', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.EmailBlock(label='Email address')), ('text', wagtail.core.blocks.CharBlock(label='Link text (optional)', required=False))])))])), ('phone', wagtail.core.blocks.StructBlock([('fax', wagtail.core.blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('number', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', wagtail.core.blocks.CharBlock(max_length=4, required=False)), ('vanity', wagtail.core.blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', wagtail.core.blocks.CharBlock(label='TTY Extension', max_length=4, required=False))])))])), ('address', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('street', wagtail.core.blocks.CharBlock(required=False)), ('city', wagtail.core.blocks.CharBlock(max_length=50, required=False)), ('state', wagtail.core.blocks.CharBlock(max_length=25, required=False)), ('zip_code', wagtail.core.blocks.CharBlock(max_length=15, required=False))])), ('info_unit_group', wagtail.core.blocks.StructBlock([('format', wagtail.core.blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('border_radius_image', wagtail.core.blocks.ChoiceBlock(choices=[('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], help_text='Adds a border-radius class to images in this group, allowing for a rounded or circular border.', label='Border radius for images?', required=False)), ('info_units', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], default={'level': 'h3'}, required=False)), ('body', wagtail.core.blocks.RichTextBlock(blank=True, required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False))]), default=[])), ('sharing', wagtail.core.blocks.StructBlock([('shareable', wagtail.core.blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', wagtail.core.blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False))]))]))], blank=True))])))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))])), ('full_width_text', wagtail.core.blocks.StreamBlock([('content', wagtail.core.blocks.RichTextBlock(icon='edit')), ('content_with_anchor', wagtail.core.blocks.StructBlock([('content_block', wagtail.core.blocks.RichTextBlock()), ('anchor_link', wagtail.core.blocks.StructBlock([('link_id', wagtail.core.blocks.CharBlock(help_text='\n ID will be auto-generated on save.\n However, you may enter some human-friendly text that\n will be incorporated to make it easier to read.\n ', label='ID for this content block', required=False))]))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('image_width', wagtail.core.blocks.ChoiceBlock(choices=[('full', 'Full width'), (470, '470px'), (270, '270px'), (170, '170px'), ('bleed', 'Bleed into left/right margins')])), ('image_position', wagtail.core.blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', wagtail.core.blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', wagtail.core.blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))])), ('table_block', v1.atomic_elements.tables.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', wagtail.core.blocks.StructBlock([('body', wagtail.core.blocks.TextBlock()), ('citation', wagtail.core.blocks.TextBlock(required=False)), ('is_large', wagtail.core.blocks.BooleanBlock(required=False))])), ('cta', wagtail.core.blocks.StructBlock([('slug_text', wagtail.core.blocks.CharBlock(required=False)), ('paragraph_text', wagtail.core.blocks.RichTextBlock(required=False)), ('button', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False)), ('size', wagtail.core.blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')]))]))])), ('related_links', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(required=False)), ('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])))])), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', v1.blocks.EmailSignUpChooserBlock()), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))]))])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('image_width', wagtail.core.blocks.ChoiceBlock(choices=[('full', 'Full width'), (470, '470px'), (270, '270px'), (170, '170px'), ('bleed', 'Bleed into left/right margins')])), ('image_position', wagtail.core.blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', wagtail.core.blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', wagtail.core.blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))])), ('info_unit_group', wagtail.core.blocks.StructBlock([('format', wagtail.core.blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('border_radius_image', wagtail.core.blocks.ChoiceBlock(choices=[('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], help_text='Adds a border-radius class to images in this group, allowing for a rounded or circular border.', label='Border radius for images?', required=False)), ('info_units', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], default={'level': 'h3'}, required=False)), ('body', wagtail.core.blocks.RichTextBlock(blank=True, required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False))]), default=[])), ('sharing', wagtail.core.blocks.StructBlock([('shareable', wagtail.core.blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', wagtail.core.blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False))]))])), ('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('video_player', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))])), ('simple_chart', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(required=True)), ('subtitle', wagtail.core.blocks.TextBlock(required=False)), ('description', wagtail.core.blocks.TextBlock(help_text='Accessible description of the chart content', required=True)), ('figure_number', wagtail.core.blocks.CharBlock(required=False)), ('chart_type', wagtail.core.blocks.ChoiceBlock(choices=[('bar', 'Bar'), ('datetime', 'Date/time'), ('line', 'Line'), ('tilemap', 'Tile grid map')])), ('data_source', wagtail.core.blocks.TextBlock(help_text="URL of the chart's data source or an array of JSON data", required=True, rows=2)), ('data_series', wagtail.core.blocks.TextBlock(help_text='For charts pulling from a separate source file, include a list of the column headers (from a CSV file) or keys (from a JSON file) to include in the chart as ["HEADER/KEY1", "HEADER/KEY2"]. To change how the data is labeled in the chart, include the correct labels with the format [{"key": "HEADER/KEY1", "label": "NEWLABEL"}, {"key": "HEADER/KEY2", "label": "NEWLABEL2"}]', required=False)), ('show_all_series_by_default', wagtail.core.blocks.BooleanBlock(default=True, help_text='Uncheck this option to initially only show the first data series in the chart. Leave checked to show all data series by default. Users can always turn data series on or off by interacting with the chart legend. ', required=False)), ('x_axis_source', wagtail.core.blocks.TextBlock(help_text='The column header (CSV), key or data array (JSON) to include as the source of x-axis values.', required=False)), ('transform', wagtail.core.blocks.CharBlock(help_text='Name the javascript function in chart-hooks.js to run on the provided data before handing it to the chart', required=False)), ('x_axis_label', wagtail.core.blocks.CharBlock(required=False)), ('y_axis_label', wagtail.core.blocks.CharBlock(required=False)), ('filters', wagtail.core.blocks.TextBlock(help_text='If the chart needs the option for users to filter the data shown, for example by date or geographic region, provide the JSON objects to filter on, in the format {key: "KEY", "label": "LABEL"}', required=False)), ('style_overrides', wagtail.core.blocks.TextBlock(help_text='A JSON object with style overrides for the underlying Highcharts chart. No object merging is done, nested objects should be referenced with dot notation: {"tooltip.shape": "circle"}', required=False)), ('projected_months', wagtail.core.blocks.IntegerBlock(blank=True, help_text='A number to determine how many months of the data are projected values', max_value=12, min_value=0, null=True, required=False)), ('source_credits', wagtail.core.blocks.CharBlock(help_text='Attribution for the data source', required=False)), ('date_published', wagtail.core.blocks.CharBlock(help_text='When the underlying data was published', required=False)), ('download_text', wagtail.core.blocks.CharBlock(help_text='Custom text for the chart download field. Required to display a download link.', required=False)), ('download_file', wagtail.core.blocks.CharBlock(help_text='Location of a file to download, if different from the data source', required=False)), ('notes', wagtail.core.blocks.TextBlock(help_text='General chart information', required=False))]))], blank=True), + ), + migrations.AlterField( + model_name='sublandingfilterablepage', + name='content', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('full_width_text', wagtail.core.blocks.StreamBlock([('content', wagtail.core.blocks.RichTextBlock(icon='edit')), ('content_with_anchor', wagtail.core.blocks.StructBlock([('content_block', wagtail.core.blocks.RichTextBlock()), ('anchor_link', wagtail.core.blocks.StructBlock([('link_id', wagtail.core.blocks.CharBlock(help_text='\n ID will be auto-generated on save.\n However, you may enter some human-friendly text that\n will be incorporated to make it easier to read.\n ', label='ID for this content block', required=False))]))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('image_width', wagtail.core.blocks.ChoiceBlock(choices=[('full', 'Full width'), (470, '470px'), (270, '270px'), (170, '170px'), ('bleed', 'Bleed into left/right margins')])), ('image_position', wagtail.core.blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', wagtail.core.blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', wagtail.core.blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))])), ('table_block', v1.atomic_elements.tables.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', wagtail.core.blocks.StructBlock([('body', wagtail.core.blocks.TextBlock()), ('citation', wagtail.core.blocks.TextBlock(required=False)), ('is_large', wagtail.core.blocks.BooleanBlock(required=False))])), ('cta', wagtail.core.blocks.StructBlock([('slug_text', wagtail.core.blocks.CharBlock(required=False)), ('paragraph_text', wagtail.core.blocks.RichTextBlock(required=False)), ('button', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False)), ('size', wagtail.core.blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')]))]))])), ('related_links', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(required=False)), ('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])))])), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', v1.blocks.EmailSignUpChooserBlock()), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))]))])), ('filter_controls', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('is_bordered', wagtail.core.blocks.BooleanBlock(required=False)), ('is_midtone', wagtail.core.blocks.BooleanBlock(required=False)), ('is_expanded', wagtail.core.blocks.BooleanBlock(required=False)), ('no_posts_message', wagtail.core.blocks.CharBlock(help_text='Message for the notification that will be displayed instead of filter controls if there are no posts to filter.', required=False)), ('no_posts_explanation', wagtail.core.blocks.CharBlock(help_text='Additional explanation for the notification that will be displayed if there are no posts to filter.', required=False)), ('post_date_description', wagtail.core.blocks.CharBlock(help_text='Strongly encouraged to help users understand the action that the date of the post is linked to, i.e. published, issued, released.', label='Date stamp descriptor', required=False)), ('title', wagtail.core.blocks.BooleanBlock(default=True, help_text='Whether to include a "Search by keyword" filter in the filter controls.', label='Filter by keyword', required=False)), ('categories', wagtail.core.blocks.StructBlock([('filter_category', wagtail.core.blocks.BooleanBlock(default=True, help_text='Whether to include a "Category" filter in the filter controls.', label='Filter by Category', required=False)), ('show_preview_categories', wagtail.core.blocks.BooleanBlock(default=True, required=False)), ('page_type', wagtail.core.blocks.ChoiceBlock(choices=v1.util.ref.filterable_list_page_types, required=False))])), ('topic_filtering', wagtail.core.blocks.ChoiceBlock(choices=[('no_filter', "Don't filter topics"), ('sort_alphabetically', 'Filter topics, sort topic list alphabetically'), ('sort_by_frequency', 'Filter topics, sort topic list by number of results')], help_text='Whether to include a "Topics" filter in the filter controls')), ('order_by', wagtail.core.blocks.ChoiceBlock(choices=[('-date_published', 'Date Published'), ('_score', 'Relevance')], help_text='How to order results')), ('statuses', wagtail.core.blocks.BooleanBlock(default=False, help_text='Whether to include a "Status" filter in the filter controls. Only enable if using on an enforcement actions filterable list.', label='Filter by Enforcement Statuses', required=False)), ('products', wagtail.core.blocks.BooleanBlock(default=False, help_text='Whether to include a "Product" filter in the filter controls. Only enable if using on an enforcement actions filterable list.', label='Filter by Enforcement Products', required=False)), ('language', wagtail.core.blocks.BooleanBlock(default=False, help_text='Whether to include a "Language" filter in the filter controls.Only enable if there are non-english filterable results available.', label='Filter by Language', required=False)), ('date_range', wagtail.core.blocks.BooleanBlock(default=True, help_text='Whether to include a set of "Date range" filters in the filter controls.', label='Filter by Date Range', required=False)), ('output_5050', wagtail.core.blocks.BooleanBlock(default=False, label='Render preview items as 50-50s', required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=False, help_text='Add links to post preview images and headings in filterable list results', required=False)), ('filter_children', wagtail.core.blocks.BooleanBlock(default=True, help_text='If checked this list will only filter its child pages.', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))]))]), + ), + migrations.AlterField( + model_name='sublandingpage', + name='content', + field=wagtail.core.fields.StreamField([('text_introduction', wagtail.core.blocks.StructBlock([('eyebrow', wagtail.core.blocks.CharBlock(help_text='Optional: Adds an H5 eyebrow above H1 heading text. Only use in conjunction with heading.', label='Pre-heading', required=False)), ('heading', wagtail.core.blocks.CharBlock(required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False)), ('has_rule', wagtail.core.blocks.BooleanBlock(help_text='Check this to add a horizontal rule line to bottom of text introduction.', label='Has bottom rule', required=False)), ('date', wagtail.core.blocks.DateBlock(help_text='IMPORTANT: Only include if this page should have a byline.', label='Published Date (BYLINE ONLY)', required=False))])), ('notification', wagtail.core.blocks.StructBlock([('type', wagtail.core.blocks.ChoiceBlock(choices=[('information', 'Information'), ('warning', 'Warning')])), ('message', wagtail.core.blocks.CharBlock(help_text='The main notification message to display.', required=True)), ('explanation', wagtail.core.blocks.TextBlock(help_text='Explanation text appears below the message in smaller type.', required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), help_text='Links appear on their own lines below the explanation.', required=False))])), ('featured_content', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock()), ('body', wagtail.core.blocks.TextBlock(help_text='Line breaks will be ignored.')), ('post', wagtail.core.blocks.PageChooserBlock(required=False)), ('show_post_link', wagtail.core.blocks.BooleanBlock(label='Render post link?', required=False)), ('post_link_text', wagtail.core.blocks.CharBlock(required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), label='Additional Links')), ('video', wagtail.core.blocks.StructBlock([('video_id', wagtail.core.blocks.RegexBlock(error_messages={'invalid': 'The YouTube video ID is in the wrong format.'}, help_text='Enter the YouTube video ID, which is located at the end of the video URL, after "v=". For example, the video ID for https://www.youtube.com/watch?v=1V0Ax9OIc84 is 1V0Ax9OIc84.', label='YouTube video ID', regex='^[\\w-]{11}$', required=False)), ('thumbnail_image', wagtail.images.blocks.ImageChooserBlock(help_text='Optional thumbnail image to show before and after the video plays. If the thumbnail image is not set here, the video player will default to showing the thumbnail that was set in (or automatically chosen by) YouTube.', required=False))], required=False))])), ('full_width_text', wagtail.core.blocks.StreamBlock([('content', wagtail.core.blocks.RichTextBlock(icon='edit')), ('content_with_anchor', wagtail.core.blocks.StructBlock([('content_block', wagtail.core.blocks.RichTextBlock()), ('anchor_link', wagtail.core.blocks.StructBlock([('link_id', wagtail.core.blocks.CharBlock(help_text='\n ID will be auto-generated on save.\n However, you may enter some human-friendly text that\n will be incorporated to make it easier to read.\n ', label='ID for this content block', required=False))]))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('image_width', wagtail.core.blocks.ChoiceBlock(choices=[('full', 'Full width'), (470, '470px'), (270, '270px'), (170, '170px'), ('bleed', 'Bleed into left/right margins')])), ('image_position', wagtail.core.blocks.ChoiceBlock(choices=[('right', 'right'), ('left', 'left')], help_text='Does not apply if the image is full-width')), ('text', wagtail.core.blocks.RichTextBlock(label='Caption', required=False)), ('is_bottom_rule', wagtail.core.blocks.BooleanBlock(default=True, help_text='Check to add a horizontal rule line to bottom of inset.', label='Has bottom rule line', required=False))])), ('table_block', v1.atomic_elements.tables.AtomicTableBlock(table_options={'renderer': 'html'})), ('quote', wagtail.core.blocks.StructBlock([('body', wagtail.core.blocks.TextBlock()), ('citation', wagtail.core.blocks.TextBlock(required=False)), ('is_large', wagtail.core.blocks.BooleanBlock(required=False))])), ('cta', wagtail.core.blocks.StructBlock([('slug_text', wagtail.core.blocks.CharBlock(required=False)), ('paragraph_text', wagtail.core.blocks.RichTextBlock(required=False)), ('button', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False)), ('size', wagtail.core.blocks.ChoiceBlock(choices=[('regular', 'Regular'), ('large', 'Large Primary')]))]))])), ('related_links', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(required=False)), ('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])))])), ('reusable_text', v1.blocks.ReusableTextChooserBlock('v1.ReusableText')), ('email_signup', v1.blocks.EmailSignUpChooserBlock()), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))]))])), ('info_unit_group', wagtail.core.blocks.StructBlock([('format', wagtail.core.blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('border_radius_image', wagtail.core.blocks.ChoiceBlock(choices=[('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], help_text='Adds a border-radius class to images in this group, allowing for a rounded or circular border.', label='Border radius for images?', required=False)), ('info_units', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], default={'level': 'h3'}, required=False)), ('body', wagtail.core.blocks.RichTextBlock(blank=True, required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False))]), default=[])), ('sharing', wagtail.core.blocks.StructBlock([('shareable', wagtail.core.blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', wagtail.core.blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False))]))])), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))])), ('snippet_list', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line above this block.', required=False)), ('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('actions_column_width', wagtail.core.blocks.ChoiceBlock(choices=[('70', '70%'), ('66', '66%'), ('60', '60%'), ('50', '50%'), ('40', '40%'), ('33', '33%'), ('30', '30%')], help_text='Choose the width in % that you wish to set the Actions column in a resource list.', label='Width of "Actions" column', required=False)), ('show_thumbnails', wagtail.core.blocks.BooleanBlock(help_text="If selected, each resource in the list will include a 150px-wide image from the resource's thumbnail field.", required=False)), ('actions', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('link_label', wagtail.core.blocks.CharBlock(help_text='E.g., "Download" or "Order free prints"')), ('snippet_field', wagtail.core.blocks.ChoiceBlock(choices=[('related_file', 'Related file'), ('alternate_file', 'Alternate file'), ('link', 'Link'), ('alternate_link', 'Alternate link')], help_text='The field that the action link should point to'))]))), ('tags', wagtail.core.blocks.ListBlock(wagtail.core.blocks.CharBlock(label='Tag'), help_text='Enter tag names to filter the snippets. For a snippet to match and be output in the list, it must have been tagged with all of the tag names listed here. The tag names are case-insensitive.'))])), ('post_preview_snapshot', wagtail.core.blocks.StructBlock([('limit', wagtail.core.blocks.CharBlock(default='3', help_text='How many posts do you want to show?', label='Limit')), ('post_date_description', wagtail.core.blocks.CharBlock(default='Published'))])), ('contact', wagtail.core.blocks.StructBlock([('contact', wagtail.snippets.blocks.SnippetChooserBlock('v1.Contact')), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Add a horizontal rule line to top of contact block.', required=False))])), ('table_block', v1.atomic_elements.tables.AtomicTableBlock(table_options={'renderer': 'html'})), ('expandable_group', wagtail.core.blocks.StructBlock([('heading', wagtail.core.blocks.CharBlock(help_text='Added as an <h3> at the top of this block. Also adds a wrapping <div> whose id attribute comes from a slugified version of this heading, creating an anchor that can be used when linking to this part of the page.', required=False)), ('body', wagtail.core.blocks.RichTextBlock(required=False)), ('is_accordion', wagtail.core.blocks.BooleanBlock(required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of expandable group.', required=False)), ('is_faq', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add FAQ schema markup to expandables.', label='Uses FAQ schema', required=False)), ('expandables', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('is_bordered', wagtail.core.blocks.BooleanBlock(required=False)), ('is_midtone', wagtail.core.blocks.BooleanBlock(required=False)), ('is_expanded', wagtail.core.blocks.BooleanBlock(required=False)), ('content', wagtail.core.blocks.StreamBlock([('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))])), ('links', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])), ('email', wagtail.core.blocks.StructBlock([('emails', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.EmailBlock(label='Email address')), ('text', wagtail.core.blocks.CharBlock(label='Link text (optional)', required=False))])))])), ('phone', wagtail.core.blocks.StructBlock([('fax', wagtail.core.blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('number', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', wagtail.core.blocks.CharBlock(max_length=4, required=False)), ('vanity', wagtail.core.blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', wagtail.core.blocks.CharBlock(label='TTY Extension', max_length=4, required=False))])))])), ('address', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('street', wagtail.core.blocks.CharBlock(required=False)), ('city', wagtail.core.blocks.CharBlock(max_length=50, required=False)), ('state', wagtail.core.blocks.CharBlock(max_length=25, required=False)), ('zip_code', wagtail.core.blocks.CharBlock(max_length=15, required=False))])), ('info_unit_group', wagtail.core.blocks.StructBlock([('format', wagtail.core.blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('border_radius_image', wagtail.core.blocks.ChoiceBlock(choices=[('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], help_text='Adds a border-radius class to images in this group, allowing for a rounded or circular border.', label='Border radius for images?', required=False)), ('info_units', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], default={'level': 'h3'}, required=False)), ('body', wagtail.core.blocks.RichTextBlock(blank=True, required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False))]), default=[])), ('sharing', wagtail.core.blocks.StructBlock([('shareable', wagtail.core.blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', wagtail.core.blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False))]))]))], blank=True))])))])), ('expandable', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('is_bordered', wagtail.core.blocks.BooleanBlock(required=False)), ('is_midtone', wagtail.core.blocks.BooleanBlock(required=False)), ('is_expanded', wagtail.core.blocks.BooleanBlock(required=False)), ('content', wagtail.core.blocks.StreamBlock([('paragraph', wagtail.core.blocks.RichTextBlock(required=False)), ('well', wagtail.core.blocks.StructBlock([('content', wagtail.core.blocks.RichTextBlock(label='Well', required=False))])), ('links', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))])), ('email', wagtail.core.blocks.StructBlock([('emails', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.EmailBlock(label='Email address')), ('text', wagtail.core.blocks.CharBlock(label='Link text (optional)', required=False))])))])), ('phone', wagtail.core.blocks.StructBlock([('fax', wagtail.core.blocks.BooleanBlock(default=False, label='Is this number a fax?', required=False)), ('phones', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('number', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', max_length=15, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('extension', wagtail.core.blocks.CharBlock(max_length=4, required=False)), ('vanity', wagtail.core.blocks.CharBlock(help_text='A phoneword version of the above number. Include any formatting. Ex. (555) 222-CFPB', max_length=15, required=False)), ('tty', wagtail.core.blocks.CharBlock(help_text='Do not include spaces or dashes. Ex. 8554112372', label='TTY', max_length=15, required=False, validators=[django.core.validators.RegexValidator(message='Enter a numeric phone number, without punctuation.', regex='^\\d*$')])), ('tty_ext', wagtail.core.blocks.CharBlock(label='TTY Extension', max_length=4, required=False))])))])), ('address', wagtail.core.blocks.StructBlock([('label', wagtail.core.blocks.CharBlock(required=False)), ('title', wagtail.core.blocks.CharBlock(required=False)), ('street', wagtail.core.blocks.CharBlock(required=False)), ('city', wagtail.core.blocks.CharBlock(max_length=50, required=False)), ('state', wagtail.core.blocks.CharBlock(max_length=25, required=False)), ('zip_code', wagtail.core.blocks.CharBlock(max_length=15, required=False))])), ('info_unit_group', wagtail.core.blocks.StructBlock([('format', wagtail.core.blocks.ChoiceBlock(choices=[('50-50', '50/50'), ('33-33-33', '33/33/33'), ('25-75', '25/75')], help_text='Choose the number and width of info unit columns.', label='Format')), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], required=False)), ('intro', wagtail.core.blocks.RichTextBlock(required=False)), ('link_image_and_heading', wagtail.core.blocks.BooleanBlock(default=True, help_text="Check this to link all images and headings to the URL of the first link in their unit's list, if there is a link.", required=False)), ('has_top_rule_line', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to add a horizontal rule line to top of info unit group.', required=False)), ('lines_between_items', wagtail.core.blocks.BooleanBlock(default=False, help_text='Check this to show horizontal rule lines between info units.', label='Show rule lines between items', required=False)), ('border_radius_image', wagtail.core.blocks.ChoiceBlock(choices=[('none', 'None'), ('rounded', 'Rounded corners'), ('circle', 'Circle')], help_text='Adds a border-radius class to images in this group, allowing for a rounded or circular border.', label='Border radius for images?', required=False)), ('info_units', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('image', wagtail.core.blocks.StructBlock([('upload', wagtail.images.blocks.ImageChooserBlock(required=False)), ('alt', wagtail.core.blocks.CharBlock(help_text="No character limit, but be as succinct as possible. If the image is decorative (i.e., a screenreader wouldn't have anything useful to say about it), leave this field blank.", required=False))])), ('heading', wagtail.core.blocks.StructBlock([('text', v1.blocks.HeadingTextBlock(required=False)), ('level', wagtail.core.blocks.ChoiceBlock(choices=[('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4'), ('h5', 'H5')])), ('icon', v1.blocks.HeadingIconBlock(help_text='Input the name of an icon to appear to the left of the heading. E.g., approved, help-round, etc. See full list of icons', required=False))], default={'level': 'h3'}, required=False)), ('body', wagtail.core.blocks.RichTextBlock(blank=True, required=False)), ('links', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock(required=False)), ('aria_label', wagtail.core.blocks.CharBlock(help_text='Add an ARIA label if the link text does not describe the destination of the link (e.g. has ambiguous text like "Learn more" that is not descriptive on its own).', required=False)), ('url', wagtail.core.blocks.CharBlock(default='/', required=False))]), required=False))]), default=[])), ('sharing', wagtail.core.blocks.StructBlock([('shareable', wagtail.core.blocks.BooleanBlock(help_text='If checked, share links will be included below the items.', label='Include sharing links?', required=False)), ('share_blurb', wagtail.core.blocks.CharBlock(help_text='Sets the tweet text, email subject line, and LinkedIn post text.', required=False))]))]))], blank=True))]))], blank=True), + ), + ] From 0ccf64dc8b6a6f29389e5a5d1f5351c2baa4c166 Mon Sep 17 00:00:00 2001 From: Andy Chosak Date: Wed, 23 Nov 2022 08:32:55 -0500 Subject: [PATCH 2/2] Add byline support to Text Introductions This commit adds support for bylines to the Text Introduction block in the same way that Item Introduction blocks support them. To avoid duplication, the common byline functionality has been pulled out into a new byline template (although not into a new Wagtail block). All three of the affected templates (byline, item introduction, text introduction) can be previewed using this repository's template debug functionality at these URLs: - http://localhost:8000/admin/template_debug/v1/byline/ - http://localhost:8000/admin/template_debug/v1/item_introduction/ - http://localhost:8000/admin/template_debug/v1/text_introduction/ Like Item Introduction bylines, Text Introduction bylines can have zero or more authors and an optional date. This commit also includes some minor cleanup around the way that item introduction blocks have been manually rendered on various page types. As far as I can tell this special handling is no longer needed, if it ever was. Affected page types and example pages to verify this: - BlogPage: http://localhost:8000/about-us/blog/why-were-modernizing-how-we-collect-credit-card-data/ - DocumentDetailPage: http://localhost:8000/compliance/supervisory-guidance/bulletin-phone-pay-fees/ - EnforcementActionPage: http://localhost:8000/enforcement/actions/capital-one-bank/ - LearnPage: http://localhost:8000/enforcement/information-industry-whistleblowers/privacy-act-statement/ - NewsroomPage: http://localhost:8000/about-us/newsroom/cfpb-issues-guidance-to-address-shoddy-investigation-practices-by-consumer-reporting-companies/ - HMDAHistoricDataPage: http://localhost:8000/data-research/hmda/historic-data/ This commit also adds a few new Python unit tests to validate the intended template rendering. --- cfgov/hmda/jinja2/hmda/hmda-explorer.html | 7 +- cfgov/jinja2/v1/_includes/article.html | 19 ++-- cfgov/jinja2/v1/_includes/atoms/byline.html | 49 +++++++++ .../v1/_includes/macros/category-slug.html | 40 +++----- .../molecules/text-introduction.html | 57 ++++------- .../organisms/item-introduction.html | 99 ++++++++++--------- cfgov/jinja2/v1/document-detail/index.html | 12 +-- cfgov/jinja2/v1/enforcement-action/index.html | 12 +-- cfgov/jinja2/v1/learn-page/index.html | 7 +- .../css/organisms/item-introduction.less | 9 +- cfgov/v1/atomic_elements/organisms.py | 1 - cfgov/v1/jinja2/v1/template_debug.html | 2 +- cfgov/v1/template_debug/__init__.py | 3 + cfgov/v1/template_debug/byline.py | 36 +++++++ cfgov/v1/template_debug/item_introduction.py | 47 +++++++++ cfgov/v1/template_debug/text_introduction.py | 60 +++++++++++ .../organisms/test_item_introductions.py | 31 ++++++ .../tests/atomic_elements/test_molecules.py | 31 ++++-- cfgov/v1/wagtail_hooks.py | 24 +++++ 19 files changed, 379 insertions(+), 167 deletions(-) create mode 100644 cfgov/jinja2/v1/_includes/atoms/byline.html create mode 100644 cfgov/v1/template_debug/byline.py create mode 100644 cfgov/v1/template_debug/item_introduction.py create mode 100644 cfgov/v1/template_debug/text_introduction.py create mode 100644 cfgov/v1/tests/atomic_elements/organisms/test_item_introductions.py diff --git a/cfgov/hmda/jinja2/hmda/hmda-explorer.html b/cfgov/hmda/jinja2/hmda/hmda-explorer.html index b72effce500..56a717c12a7 100644 --- a/cfgov/hmda/jinja2/hmda/hmda-explorer.html +++ b/cfgov/hmda/jinja2/hmda/hmda-explorer.html @@ -3,7 +3,6 @@ {% import 'hmda-explorer-controls.html' as controls with context %} {% import 'hmda-explorer-results.html' as results with context %} {% import 'hmda-explorer-institutions.html' as institutions with context %} -{% import 'organisms/item-introduction.html' as item_introduction with context %} {% import 'templates/render_block.html' as render_block with context %} {% import 'templates/streamfield-sidefoot.html' as streamfield_sidefoot with context %} @@ -13,11 +12,7 @@ {% block content_main %} {% for block in page.header -%} - {% if block.block_type == 'item_introduction' %} - {{ item_introduction.render(block.value) }} - {% else %} - {{ render_block.render(block, loop.index) }} - {% endif %} + {{ render_block.render(block, loop.index) }} {%- endfor %}
diff --git a/cfgov/jinja2/v1/_includes/article.html b/cfgov/jinja2/v1/_includes/article.html index c4d09c75e2b..c21e2210eb6 100644 --- a/cfgov/jinja2/v1/_includes/article.html +++ b/cfgov/jinja2/v1/_includes/article.html @@ -38,21 +38,20 @@
- {% set data = { - 'category': page.categories.all(), + {% with value = { 'heading': page.title, 'date': page.date_published, - 'has_social': True, + 'has_social': true, 'social_options': { 'is_printable': true } } %} + {% for block in page.header -%} + {% if block.block_type == 'article_subheader' %} + {% do value.update( { 'paragraph': block.value } ) %} + {% endif %} + {% endfor %} - {% for block in page.header -%} - {% if block.block_type == 'article_subheader' %} - {% do data.update({'paragraph': block.value}) %} - {% endif %} - {% endfor %} - - {{ item_introduction.render(data) }} + {% include 'organisms/item-introduction.html' with context %} + {% endwith %}
diff --git a/cfgov/jinja2/v1/_includes/atoms/byline.html b/cfgov/jinja2/v1/_includes/atoms/byline.html new file mode 100644 index 00000000000..ca83032029d --- /dev/null +++ b/cfgov/jinja2/v1/_includes/atoms/byline.html @@ -0,0 +1,49 @@ +{# ========================================================================== + + Create a byline when given: + + value.authors: List of author names. + + value.date: Publication date. + +========================================================================== #} + +{%- macro render( value ) %} +{%- if value.authors or value.date -%} + +{%- endif %} +{%- endmacro %} + + +{%- if value %} + +{% if page and not "authors" in value %} + {% do value.update( + { "authors": page.authors.values_list( "name", flat=True ) } + ) %} +{% endif %} + +{{- render( value ) -}} + +{% endif -%} diff --git a/cfgov/jinja2/v1/_includes/macros/category-slug.html b/cfgov/jinja2/v1/_includes/macros/category-slug.html index b4fa5c24d73..a302f1d67bd 100644 --- a/cfgov/jinja2/v1/_includes/macros/category-slug.html +++ b/cfgov/jinja2/v1/_includes/macros/category-slug.html @@ -9,45 +9,35 @@ Render a category slug when given: - category: A string. + category: A category slug, e.g. "press-release". - href (optional): If present creates a link with - a path to which the category filter applies. - For example, if the slug is used on a blog article - then path should be '/about-us/blog/'. - Remember to leverage vars.path instead of - using the literal string '/about-us/blog/'. - Path is used to create the filtered URL: - {{ href }}?category={{ category }} + href (optional): If present creates a link with + a path to which the category filter applies. + For example, if the slug is used on a blog article + then path should be '/about-us/blog/'. + Path is used to create the filtered URL: + {{ href }}?categories={{ category }} classes (optional): Space separated list of class names. - use_blog_category (optional): Whether to use the blog category filter or not. - Defaults to false. - ========================================================================== #} -{% macro render(category, href, classes='', use_blog_category=false) %} +{% macro render( category, href, classes='' ) %} {% import 'macros/category-icon.html' as category_icon %} {% if href %} - {# TODO: Remove use_blog_category parameter when this element becomes atomic. #} - {% if use_blog_category %} - {% set href = href + '?blog_category=' + category | urlencode | replace('%20', '+') %} - {% else %} - {% set href = href + '?categories=' + category | urlencode | replace('%20', '+') %} - {% endif %} + {% set href = href + '?categories=' + category | urlencode %} {% endif %} - {% call _category_link(href, classes) %} - {% set cat = category_label(category) or category %} - {{ category_icon.render(cat) }} + {% call _category_link( href, classes ) -%} + {% set category_name = category_label( category ) or category %} + {{- category_icon.render( category_name ) }} Category: - {{ cat | safe }} - {% endcall %} + {{ category_name }} + {%- endcall %} {% endmacro %} -{% macro _category_link(href, classes) %} +{% macro _category_link( href, classes ) %} {% if href %} diff --git a/cfgov/jinja2/v1/_includes/molecules/text-introduction.html b/cfgov/jinja2/v1/_includes/molecules/text-introduction.html index e1539f27dd7..e2ced9719d3 100644 --- a/cfgov/jinja2/v1/_includes/molecules/text-introduction.html +++ b/cfgov/jinja2/v1/_includes/molecules/text-introduction.html @@ -4,79 +4,56 @@ ========================================================================= - Description: - Create a Text Introduction molecule. - See [GHE]/flapjack/Modules-V1/wiki/Text-Introduction - value: Object defined from a StreamField block. + https://cfpb.github.io/design-system/patterns/text-introductions value.eyebrow: (Optional) Text to display above heading. value.heading: (Optional) String for heading text. - value.intro: (Optional) String for body introduction text. + value.authors: (Optional) A list of author names to be included + on a byline. + + value.date: (Optional) A date to be included on a byline. - value.intro.source: TODO: add type and description. + value.intro: (Optional) String for body introduction text. value.body: (Optional) String for body text. - value.links: A tuple to create a list of links, containing: + value.links: A list of links, containing: - value.links[i].text: (Optional) A string for the text of the link. + value.links[i].text: A string for the text of the link. value.links[i].url: A string for the URL of the link. value.links[i].aria_label: (Optional) An aria-label for the link. - value.date: (Optional) A date to be included on a byline. - value.has_rule: Whether or not to render a rule line (border-bottom) at the bottom of the molecule. ========================================================================== #} -{% set published_date = value.date %} -{% set has_authors = page.authors.exists() %} -{% if value.eyebrow %} +{% if value.eyebrow -%}
{{ value.eyebrow }}
-{% endif %} -{% if value.heading %} +{%- endif %} + +{% if value.heading -%}

{{ value.heading }}

-{% endif %} +{%- endif %} -{% if published_date or has_authors %} -
-{% endif %} -{% if has_authors %} - -{% endif %} -{% if published_date %} - - {% import 'macros/time.html' as time %} - {{ time.render(published_date, {'date':true}) }} - -{% endif %} -{% if published_date or has_authors %} -
-{% endif %} +{% include 'atoms/byline.html' with context %} -{% if value.intro.source %} +{% if value.intro -%}
{{ value.intro | safe }}
-{% endif %} +{%- endif %} {% if value.body %} {{ value.body | safe }} {% endif %} + {% for link in value.links %} {% if link.text %} {% if loop.first %}
+{{- render( value ) -}} -{% endmacro %} +{% endif -%} diff --git a/cfgov/jinja2/v1/document-detail/index.html b/cfgov/jinja2/v1/document-detail/index.html index 7e93fc32b10..82d5c7e1ed0 100644 --- a/cfgov/jinja2/v1/document-detail/index.html +++ b/cfgov/jinja2/v1/document-detail/index.html @@ -9,15 +9,9 @@ {% block content_main %} {% for block in page.header -%} - {% if block.block_type == 'item_introduction' %} - {% import 'organisms/item-introduction.html' as item_introduction with context %} - {{ item_introduction.render(block.value) }} - {% else %} -
- {{ render_stream_child(block) }} -
- {% endif %} +
+ {{ render_stream_child(block) }} +
{%- endfor %} {% for block in page.content -%} diff --git a/cfgov/jinja2/v1/enforcement-action/index.html b/cfgov/jinja2/v1/enforcement-action/index.html index 6a7c03924f1..2c5c5e438df 100644 --- a/cfgov/jinja2/v1/enforcement-action/index.html +++ b/cfgov/jinja2/v1/enforcement-action/index.html @@ -10,15 +10,9 @@ {% block content_main %} {% for block in page.header -%} - {% if block.block_type == 'item_introduction' %} - {% import 'organisms/item-introduction.html' as item_introduction with context %} - {{ item_introduction.render(block.value) }} - {% else %} -
- {{ render_stream_child(block) }} -
- {% endif %} +
+ {{ render_stream_child(block) }} +
{%- endfor %} {% for block in page.content -%} diff --git a/cfgov/jinja2/v1/learn-page/index.html b/cfgov/jinja2/v1/learn-page/index.html index 7720e7217dd..7a4d3a571b2 100644 --- a/cfgov/jinja2/v1/learn-page/index.html +++ b/cfgov/jinja2/v1/learn-page/index.html @@ -1,6 +1,5 @@ {% extends 'layout-2-1.html' %} -{% import 'organisms/item-introduction.html' as item_introduction with context %} {% import 'templates/render_block.html' as render_block with context %} {% import 'templates/streamfield-sidefoot.html' as streamfield_sidefoot with context %} @@ -10,11 +9,7 @@ {% block content_main %} {% for block in page.header -%} - {% if block.block_type == 'item_introduction' %} - {{ item_introduction.render(block.value) }} - {% else %} - {{ render_block.render(block, loop.index) }} - {% endif %} + {{ render_block.render(block, loop.index) }} {%- endfor %} {% for block in page.content -%} diff --git a/cfgov/unprocessed/css/organisms/item-introduction.less b/cfgov/unprocessed/css/organisms/item-introduction.less index 908615308e5..509952c7a22 100644 --- a/cfgov/unprocessed/css/organisms/item-introduction.less +++ b/cfgov/unprocessed/css/organisms/item-introduction.less @@ -35,18 +35,18 @@ */ .o-item-introduction { - margin-bottom: unit( @grid_gutter-width * 2 / @base-font-size-px, em ); + margin-bottom: unit(@grid_gutter-width * 2 / @base-font-size-px, em); .short-desc { - padding-bottom: unit( @grid_gutter-width / 2 / @base-font-size-px, em ); + padding-bottom: unit(@grid_gutter-width / 2 / @base-font-size-px, em); } .lead-paragraph { margin-top: 0; } - .meta { - margin-bottom: unit( @grid_gutter-width / @base-font-size-px, em ); + .a-byline { + margin-bottom: unit(@grid_gutter-width / @base-font-size-px, em); .byline { .heading-4(); @@ -54,7 +54,6 @@ } } - /* topdoc name: EOF eof: true diff --git a/cfgov/v1/atomic_elements/organisms.py b/cfgov/v1/atomic_elements/organisms.py index 0a6aee41ba7..2cc99fff6d4 100644 --- a/cfgov/v1/atomic_elements/organisms.py +++ b/cfgov/v1/atomic_elements/organisms.py @@ -721,7 +721,6 @@ class ItemIntroduction(blocks.StructBlock): class Meta: icon = "form" template = "_includes/organisms/item-introduction.html" - classname = "block__flush-top" class FilterableList(BaseExpandable): diff --git a/cfgov/v1/jinja2/v1/template_debug.html b/cfgov/v1/jinja2/v1/template_debug.html index b9772b96cda..fafe0d3c851 100644 --- a/cfgov/v1/jinja2/v1/template_debug.html +++ b/cfgov/v1/jinja2/v1/template_debug.html @@ -7,7 +7,7 @@