diff --git a/cdhweb/blog/migrations/0018_alter_blogpost_body.py b/cdhweb/blog/migrations/0018_alter_blogpost_body.py new file mode 100644 index 00000000..99d7c1cc --- /dev/null +++ b/cdhweb/blog/migrations/0018_alter_blogpost_body.py @@ -0,0 +1,865 @@ +# Generated by Django 5.0.5 on 2024-06-12 20:47 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text + + +class Migration(migrations.Migration): + dependencies = [ + ("blog", "0017_bloglandingpage_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="blogpost", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + ] diff --git a/cdhweb/blog/migrations/0019_alter_blogpost_body.py b/cdhweb/blog/migrations/0019_alter_blogpost_body.py new file mode 100644 index 00000000..663e6ece --- /dev/null +++ b/cdhweb/blog/migrations/0019_alter_blogpost_body.py @@ -0,0 +1,27 @@ +# Generated by Django 5.0.5 on 2024-06-12 23:37 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0018_alter_blogpost_body'), + ] + + operations = [ + migrations.AlterField( + model_name='blogpost', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + ] diff --git a/cdhweb/blog/wagtail_hooks.py b/cdhweb/blog/wagtail_hooks.py index ee074135..e04f4b83 100644 --- a/cdhweb/blog/wagtail_hooks.py +++ b/cdhweb/blog/wagtail_hooks.py @@ -33,7 +33,6 @@ class BlogPostAdmin(ThumbnailMixin, ModelAdmin): "authors__person__last_name", "body", ) - exclude_from_explorer = True thumb_image_field_name = "featured_image" thumb_col_header_text = "image" ordering = ("-first_published_at",) diff --git a/cdhweb/events/migrations/0018_alter_event_body.py b/cdhweb/events/migrations/0018_alter_event_body.py new file mode 100644 index 00000000..4a440ea9 --- /dev/null +++ b/cdhweb/events/migrations/0018_alter_event_body.py @@ -0,0 +1,865 @@ +# Generated by Django 5.0.5 on 2024-06-12 20:47 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text + + +class Migration(migrations.Migration): + dependencies = [ + ("events", "0017_alter_event_body"), + ] + + operations = [ + migrations.AlterField( + model_name="event", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + ] diff --git a/cdhweb/events/migrations/0019_alter_event_body.py b/cdhweb/events/migrations/0019_alter_event_body.py new file mode 100644 index 00000000..532e65c0 --- /dev/null +++ b/cdhweb/events/migrations/0019_alter_event_body.py @@ -0,0 +1,27 @@ +# Generated by Django 5.0.5 on 2024-06-12 23:37 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0018_alter_event_body'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + ] diff --git a/cdhweb/events/wagtail_hooks.py b/cdhweb/events/wagtail_hooks.py index 5af5cd00..8813a200 100644 --- a/cdhweb/events/wagtail_hooks.py +++ b/cdhweb/events/wagtail_hooks.py @@ -43,7 +43,6 @@ class EventAdmin(ThumbnailMixin, ModelAdmin): "location__name", "location__address", ) - exclude_from_explorer = True thumb_image_field_name = "thumbnail" thumb_col_header_text = "thumbnail" ordering = ("-start_time",) diff --git a/cdhweb/pages/blocks/article_index_block.py b/cdhweb/pages/blocks/article_index_block.py new file mode 100644 index 00000000..723198a7 --- /dev/null +++ b/cdhweb/pages/blocks/article_index_block.py @@ -0,0 +1,73 @@ +from springkit.blocks.headings import HeadingBlock +from springkit.blocks.jumplinks import JumplinkMixin +from wagtail import blocks + +from cdhweb.pages.blocks.link import InternalPageLinkBlock + + +class ArticleTileBlock(JumplinkMixin): + """ + CMS controlled Article Tile block + """ + + heading = HeadingBlock(required=False, help_text="Heading for this tile block") + + description = blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ) + + landing_page = blocks.PageChooserBlock( + required=True, + page_type=["blog.BlogLandingPage"], + help_text=( + "Select the Blog Landing Page whose child pages you want to show as " + "tiles in this block." + ), + ) + + max_articles = blocks.ChoiceBlock( + choices=[ + (2, "2"), + (3, "3"), + (4, "4"), + (5, "5"), + (6, "6"), + ], + default=3, + icon="placeholder", + help_text="Define the maximum number of tiles to show in this group.", + ) + + see_more_link = blocks.CharBlock( + max_length=80, + help_text="Set text for the link which takes you to the landing page", + label="Link title", + default='See All', + required=False, + ) + def get_context(self, value, parent_context=None): + context = super().get_context(value, parent_context=parent_context) + + child_pages = ( + value.get("landing_page") + .get_children() + .live() + .public() + .order_by("-blogpost__first_published_at") # Sort by date descending + .specific() + ) + + max_value = int(value.get("max_articles")) + + tiles = child_pages[:max_value] + + context["tiles"] = tiles + return context + + class Meta: + template = "cdhpages/blocks/article_tile_block.html" + label = "Article Tile Block" + icon = "doc-full" + group = "Body copy components" diff --git a/cdhweb/pages/blocks/event_index_block.py b/cdhweb/pages/blocks/event_index_block.py new file mode 100644 index 00000000..74247277 --- /dev/null +++ b/cdhweb/pages/blocks/event_index_block.py @@ -0,0 +1,47 @@ +from django.utils import timezone +from springkit.blocks.headings import HeadingBlock +from springkit.blocks.jumplinks import JumplinkMixin +from wagtail import blocks + +from cdhweb.pages.blocks.link import InternalPageLinkBlock + +from .article_index_block import ArticleTileBlock + + +class EventTileBlock(ArticleTileBlock): + landing_page = blocks.PageChooserBlock( + required=True, + page_type=["events.EventsLandingPage"], + help_text=( + "Select the Event Landing Page whose child pages you want to show as " + "tiles in this block." + ), + ) + + def get_context(self, value, parent_context=None): + context = super().get_context(value, parent_context=parent_context) + + current_datetime = timezone.now() + + child_pages = ( + value.get("landing_page") + .get_children() + .live() + .public() + .filter(event__start_time__gt=current_datetime) # only show upcoming events + .order_by("event__start_time") # Sort by date ascending + .specific() + ) + + max_value = int(value.get("max_articles")) + + tiles = child_pages[:max_value] + + context["tiles"] = tiles + return context + + class Meta: + template = "cdhpages/blocks/article_tile_block.html" + label = "Event Tile Block" + icon = "calendar-alt" + group = "Body copy components" diff --git a/cdhweb/pages/blocks/newsletter.py b/cdhweb/pages/blocks/newsletter.py index 41ef0052..570162f2 100644 --- a/cdhweb/pages/blocks/newsletter.py +++ b/cdhweb/pages/blocks/newsletter.py @@ -6,4 +6,5 @@ class Meta: template = "includes/newsletter_form.html" label = "Newsletter Sign Up" icon = "mail" + group = "Body copy components" admin_text = "The newsletter sign up block does not require cms edit" diff --git a/cdhweb/pages/blocks/tile_block.py b/cdhweb/pages/blocks/tile_block.py index 28a1db6e..a63d6c2b 100644 --- a/cdhweb/pages/blocks/tile_block.py +++ b/cdhweb/pages/blocks/tile_block.py @@ -50,6 +50,12 @@ class StandardTileBlock(JumplinkMixin): see_more_link = InternalPageLinkBlock(help_text="'See more' link", required=False) + featured = blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + required=False, + ) + tiles = blocks.StreamBlock( [ ("internal_page_tile", TileInternalPage()), @@ -64,8 +70,11 @@ def get_context(self, value, parent_context=None): tiles = value.get("tiles") context["tiles"] = tiles + return context class Meta: template = "cdhpages/blocks/standard_tile_block.html" label = "Standard Tile Block" + icon = "copy" + group = "Body copy components" diff --git a/cdhweb/pages/migrations/0048_alter_contentpage_body_alter_homepage_body_and_more.py b/cdhweb/pages/migrations/0048_alter_contentpage_body_alter_homepage_body_and_more.py new file mode 100644 index 00000000..5adcf820 --- /dev/null +++ b/cdhweb/pages/migrations/0048_alter_contentpage_body_alter_homepage_body_and_more.py @@ -0,0 +1,2550 @@ +# Generated by Django 5.0.5 on 2024-06-12 20:47 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text + + +class Migration(migrations.Migration): + dependencies = [ + ("cdhpages", "0047_alter_contentpage_body_alter_homepage_body_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="contentpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + migrations.AlterField( + model_name="homepage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + migrations.AlterField( + model_name="landingpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + ] diff --git a/cdhweb/pages/migrations/0049_alter_contentpage_body_alter_homepage_body_and_more.py b/cdhweb/pages/migrations/0049_alter_contentpage_body_alter_homepage_body_and_more.py new file mode 100644 index 00000000..4eafbe5e --- /dev/null +++ b/cdhweb/pages/migrations/0049_alter_contentpage_body_alter_homepage_body_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.0.5 on 2024-06-12 23:37 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cdhpages', '0048_alter_contentpage_body_alter_homepage_body_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='contentpage', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + migrations.AlterField( + model_name='homepage', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))]))], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + migrations.AlterField( + model_name='landingpage', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + ] diff --git a/cdhweb/pages/models.py b/cdhweb/pages/models.py index 182104bf..b1e1abce 100644 --- a/cdhweb/pages/models.py +++ b/cdhweb/pages/models.py @@ -35,8 +35,10 @@ from cdhweb.pages import snippets # needed for import order from .blocks.accordion_block import AccordionBlock +from .blocks.article_index_block import ArticleTileBlock from .blocks.cdh_hosted_video import HostedVideo from .blocks.download_block import DownloadBlock +from .blocks.event_index_block import EventTileBlock from .blocks.feature_block import FeatureBlock from .blocks.image_block import ImageBlock from .blocks.migrated import MigratedBlock @@ -87,6 +89,8 @@ ("newsletter", NewsletterBlock()), ("heading", JumplinkableH2Block()), ("tile_block", StandardTileBlock()), + ("article_tile_block", ArticleTileBlock()), + ("event_tile_block", EventTileBlock()), ] diff --git a/cdhweb/people/migrations/0017_alter_peoplelandingpage_body_alter_profile_body.py b/cdhweb/people/migrations/0017_alter_peoplelandingpage_body_alter_profile_body.py new file mode 100644 index 00000000..a4048601 --- /dev/null +++ b/cdhweb/people/migrations/0017_alter_peoplelandingpage_body_alter_profile_body.py @@ -0,0 +1,1708 @@ +# Generated by Django 5.0.5 on 2024-06-12 20:47 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text + + +class Migration(migrations.Migration): + dependencies = [ + ("people", "0016_alter_peoplelandingpage_body_alter_profile_body_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="peoplelandingpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + migrations.AlterField( + model_name="profile", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + ] diff --git a/cdhweb/people/migrations/0018_alter_peoplelandingpage_body_alter_profile_body.py b/cdhweb/people/migrations/0018_alter_peoplelandingpage_body_alter_profile_body.py new file mode 100644 index 00000000..74fdcd01 --- /dev/null +++ b/cdhweb/people/migrations/0018_alter_peoplelandingpage_body_alter_profile_body.py @@ -0,0 +1,32 @@ +# Generated by Django 5.0.5 on 2024-06-12 23:37 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0017_alter_peoplelandingpage_body_alter_profile_body'), + ] + + operations = [ + migrations.AlterField( + model_name='peoplelandingpage', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + migrations.AlterField( + model_name='profile', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + ] diff --git a/cdhweb/people/wagtail_hooks.py b/cdhweb/people/wagtail_hooks.py index a4f33bb2..de337676 100644 --- a/cdhweb/people/wagtail_hooks.py +++ b/cdhweb/people/wagtail_hooks.py @@ -50,7 +50,6 @@ class ProfileAdmin(ThumbnailMixin, ModelAdmin): search_fields = ("title", "body") ordering = ("title",) thumb_image_field_name = "image" - exclude_from_explorer = True class PeopleGroup(ModelAdminGroup): diff --git a/cdhweb/projects/migrations/0020_alter_project_body.py b/cdhweb/projects/migrations/0020_alter_project_body.py new file mode 100644 index 00000000..9f73c168 --- /dev/null +++ b/cdhweb/projects/migrations/0020_alter_project_body.py @@ -0,0 +1,865 @@ +# Generated by Django 5.0.5 on 2024-06-12 20:47 + +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text + + +class Migration(migrations.Migration): + dependencies = [ + ("projects", "0019_alter_project_body_alter_project_members"), + ] + + operations = [ + migrations.AlterField( + model_name="project", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", cdhweb.pages.blocks.rich_text.RichTextBlock()), + ( + "download_block", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + help_text="Heading for document block", + max_length=80, + required=False, + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="A description to display with the download file (150 characters maximum).", + max_length=150, + required=False, + ), + ), + ( + "documents", + wagtail.blocks.ListBlock( + cdhweb.pages.blocks.download_block.FileBlock, + help_text="Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.", + max_num=10, + min_num=1, + ), + ), + ] + ), + ), + ( + "cta_block", + wagtail.blocks.StructBlock( + [ + ( + "introduction", + wagtail.blocks.TextBlock( + help_text="Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).", + max_length=100, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=1, + ), + ), + ] + ), + ), + ( + "accordion_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "description", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + required=False, + ), + ), + ( + "accordion_items", + wagtail.blocks.ListBlock( + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, + required=True, + verbose_name="Accordion Title", + ), + ), + ( + "body", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "document-link", + "h3", + "h4", + ], + help_text="Only use H3 if you have not set an overall heading for the accordion block.", + ), + ), + ] + ) + ), + ), + ] + ), + ), + ( + "video_block", + wagtail.blocks.StructBlock( + [ + ( + "video", + wagtail.blocks.URLBlock( + help_text="A YouTube URL. Link to a specifc video or playlist." + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=False, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ] + ), + ), + ( + "embed", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + required=False, + ), + ), + ( + "video_url", + wagtail.embeds.blocks.EmbedBlock( + help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu' + ), + ), + ( + "accessibility_description", + wagtail.blocks.CharBlock( + help_text="Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.", + required=True, + ), + ), + ( + "transcript", + wagtail.blocks.RichTextBlock( + features=["bold", "link", "document-link"], + required=False, + ), + ), + ] + ), + ), + ( + "pull_quote", + wagtail.blocks.StructBlock( + [ + ( + "quote", + wagtail.blocks.RichTextBlock( + features=["bold", "italic"], + help_text='Pull a small section of content out as an "aside" to give it emphasis.', + max_length=100, + required=True, + ), + ), + ( + "attribution", + wagtail.blocks.RichTextBlock( + features=["bold", "link"], + help_text="Optional attribution", + max_length=60, + required=False, + ), + ), + ] + ), + ), + ( + "note", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.TextBlock( + help_text="Optional heading", required=False + ), + ), + ( + "message", + wagtail.blocks.RichTextBlock( + features=["bold", "italic", "link", "ul", "ol"], + help_text="Note message up to 750 chars", + max_length=750, + required=True, + ), + ), + ] + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "caption", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A short caption for the image.", + max_length=180, + required=False, + ), + ), + ( + "credit", + wagtail.blocks.RichTextBlock( + features=["italic", "bold", "link"], + help_text="A credit line or attribution for the image.", + max_length=80, + required=False, + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers", + max_length=80, + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("small", "small"), + ("medium", "medium"), + ("large", "large"), + ], + label="Image Size", + ), + ), + ] + ), + ), + ( + "feature", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ), + ( + "feature_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "document-link", + "italic", + "link", + "ol", + "ul", + ], + max_length=400, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=True + ), + ), + ( + "alt_text", + wagtail.blocks.CharBlock( + help_text="Describe the image for screen readers.", + max_length=80, + required=False, + ), + ), + ( + "cta_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "internal_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock(), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ( + "external_link", + wagtail.blocks.StructBlock( + [ + ( + "link_url", + wagtail.blocks.URLBlock( + label="URL" + ), + ), + ( + "link_text", + wagtail.blocks.CharBlock( + label="Button text", + max_length=40, + required=True, + ), + ), + ] + ), + ), + ], + max_num=2, + min_num=0, + required=False, + ), + ), + ] + ), + ), + ( + "table", + wagtail.blocks.StructBlock( + [ + ( + "caption", + wagtail.blocks.CharBlock( + help_text="Table caption", + label="Caption", + required=False, + ), + ), + ( + "notes", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + ], + help_text="Primarily for using for footnotes from cells with asterisks", + label="Table notes", + required=False, + ), + ), + ( + "table", + wagtail.contrib.typed_table_block.blocks.TypedTableBlock( + [ + ( + "rich_text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "ol", + "ul", + "h3", + ] + ), + ) + ], + help_text="It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.", + max_num=1, + min_num=1, + ), + ), + ] + ), + ), + ("newsletter", cdhweb.pages.blocks.newsletter.NewsletterBlock()), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ] + ), + ), + ] + ), + ), + ( + "tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ( + "featured", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.", + ), + ), + ( + "tiles", + wagtail.blocks.StreamBlock( + [ + ( + "internal_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + required=True + ), + ) + ] + ), + ), + ( + "external_page_tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Title for this tile.", + label="Tile Title", + max_length=100, + required=True, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Image for this tile.", + label="Tile Image", + required=False, + ), + ), + ( + "summary", + wagtail.blocks.CharBlock( + help_text="Summary for this tile.", + label="Tile Summary", + max_length=200, + required=False, + ), + ), + ( + "external_link", + wagtail.blocks.URLBlock( + required=True + ), + ), + ] + ), + ), + ], + min_num=1, + required=True, + ), + ), + ] + ), + ), + ( + "article_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Blog Landing Page whose child pages you want to show as tiles in this block.", + page_type=["blog.BlogLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ( + "event_tile_block", + wagtail.blocks.StructBlock( + [ + ( + "show_in_jumplinks", + wagtail.blocks.BooleanBlock( + default=False, + help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", + required=False, + ), + ), + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + max_length=80, required=True + ), + ) + ], + help_text="Heading for this tile block", + required=False, + ), + ), + ( + "description", + wagtail.blocks.CharBlock( + help_text="Description for this tile block", + label="Description", + required=False, + ), + ), + ( + "landing_page", + wagtail.blocks.PageChooserBlock( + help_text="Select the Event Landing Page whose child pages you want to show as tiles in this block.", + page_type=["events.EventsLandingPage"], + required=True, + ), + ), + ( + "max_articles", + wagtail.blocks.ChoiceBlock( + choices=[(3, "3"), (6, "6"), (9, "9")], + help_text="Define the maximum number of tiles to show in this group.", + icon="placeholder", + ), + ), + ( + "see_more_link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Choose a page to link to", + label="Wagtail Page", + required=False, + ), + ), + ( + "title", + wagtail.blocks.CharBlock( + help_text="Set title for this link", + label="Link title", + max_length=80, + required=False, + ), + ), + ], + help_text="'See more' link", + required=False, + ), + ), + ] + ), + ), + ("migrated", cdhweb.pages.blocks.migrated.MigratedBlock()), + ], + blank=True, + help_text="Put content for the body of the page here. Start with using the + button.", + use_json_field=True, + verbose_name="Page content", + ), + ), + ] diff --git a/cdhweb/projects/migrations/0021_alter_project_body.py b/cdhweb/projects/migrations/0021_alter_project_body.py new file mode 100644 index 00000000..a8ffd9db --- /dev/null +++ b/cdhweb/projects/migrations/0021_alter_project_body.py @@ -0,0 +1,27 @@ +# Generated by Django 5.0.5 on 2024-06-12 23:37 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.migrated +import cdhweb.pages.blocks.newsletter +import cdhweb.pages.blocks.rich_text +import wagtail.blocks +import wagtail.contrib.typed_table_block.blocks +import wagtail.embeds.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0020_alter_project_body'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='body', + field=wagtail.fields.StreamField([('paragraph', cdhweb.pages.blocks.rich_text.RichTextBlock()), ('download_block', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(help_text='Heading for document block', max_length=80, required=False)), ('description', wagtail.blocks.TextBlock(help_text='A description to display with the download file (150 characters maximum).', max_length=150, required=False)), ('documents', wagtail.blocks.ListBlock(cdhweb.pages.blocks.download_block.FileBlock, help_text='Upload at least 1 and maximum 10 files. Each file size should be less than 5MB.', max_num=10, min_num=1))])), ('cta_block', wagtail.blocks.StructBlock([('introduction', wagtail.blocks.TextBlock(help_text='Short introduction to the action you want users to take. Ideal: 80 characters or less (Max: 100 characters).', max_length=100, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=1))])), ('accordion_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], required=False)), ('accordion_items', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True, verbose_name='Accordion Title')), ('body', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'document-link', 'h3', 'h4'], help_text='Only use H3 if you have not set an overall heading for the accordion block.'))])))])), ('video_block', wagtail.blocks.StructBlock([('video', wagtail.blocks.URLBlock(help_text='A YouTube URL. Link to a specifc video or playlist.')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=False)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False)), ('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False))])), ('embed', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], required=False)), ('video_url', wagtail.embeds.blocks.EmbedBlock(help_text='This should be used for videos from Princeton\'s Media Central. Copy the "oEmbed URL" from the "Share" menu')), ('accessibility_description', wagtail.blocks.CharBlock(help_text='Use this to describe the video. It is used as an accessibility attribute mainly for screen readers.', required=True)), ('transcript', wagtail.blocks.RichTextBlock(features=['bold', 'link', 'document-link'], required=False))])), ('pull_quote', wagtail.blocks.StructBlock([('quote', wagtail.blocks.RichTextBlock(features=['bold', 'italic'], help_text='Pull a small section of content out as an "aside" to give it emphasis.', max_length=100, required=True)), ('attribution', wagtail.blocks.RichTextBlock(features=['bold', 'link'], help_text='Optional attribution', max_length=60, required=False))])), ('note', wagtail.blocks.StructBlock([('heading', wagtail.blocks.TextBlock(help_text='Optional heading', required=False)), ('message', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ul', 'ol'], help_text='Note message up to 750 chars', max_length=750, required=True))])), ('image', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('caption', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A short caption for the image.', max_length=180, required=False)), ('credit', wagtail.blocks.RichTextBlock(features=['italic', 'bold', 'link'], help_text='A credit line or attribution for the image.', max_length=80, required=False)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers', max_length=80, required=False)), ('size', wagtail.blocks.ChoiceBlock(choices=[('small', 'small'), ('medium', 'medium'), ('large', 'large')], label='Image Size'))])), ('feature', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True)), ('feature_text', wagtail.blocks.RichTextBlock(features=['bold', 'document-link', 'italic', 'link', 'ol', 'ul'], max_length=400)), ('image', wagtail.images.blocks.ImageChooserBlock(label='Image', required=True)), ('alt_text', wagtail.blocks.CharBlock(help_text='Describe the image for screen readers.', max_length=80, required=False)), ('cta_buttons', wagtail.blocks.StreamBlock([('internal_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock()), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))])), ('external_link', wagtail.blocks.StructBlock([('link_url', wagtail.blocks.URLBlock(label='URL')), ('link_text', wagtail.blocks.CharBlock(label='Button text', max_length=40, required=True))]))], max_num=2, min_num=0, required=False))])), ('table', wagtail.blocks.StructBlock([('caption', wagtail.blocks.CharBlock(help_text='Table caption', label='Caption', required=False)), ('notes', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'document-link'], help_text='Primarily for using for footnotes from cells with asterisks', label='Table notes', required=False)), ('table', wagtail.contrib.typed_table_block.blocks.TypedTableBlock([('rich_text', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'ol', 'ul', 'h3']))], help_text='It is recommended to use a minimal number of columns, to ensure the table is usable on mobile and desktop.', max_num=1, min_num=1))])), ('newsletter', cdhweb.pages.blocks.newsletter.NewsletterBlock()), ('heading', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))]))])), ('tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False)), ('featured', wagtail.blocks.BooleanBlock(default=False, help_text='Check this checkbox to create a visually distinct tile block that stands out from regular tiles on the page.', required=False)), ('tiles', wagtail.blocks.StreamBlock([('internal_page_tile', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(required=True))])), ('external_page_tile', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title for this tile.', label='Tile Title', max_length=100, required=True)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Image for this tile.', label='Tile Image', required=False)), ('summary', wagtail.blocks.CharBlock(help_text='Summary for this tile.', label='Tile Summary', max_length=200, required=False)), ('external_link', wagtail.blocks.URLBlock(required=True))]))], min_num=1, required=True))])), ('article_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Blog Landing Page whose child pages you want to show as tiles in this block.', page_type=['blog.BlogLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('event_tile_block', wagtail.blocks.StructBlock([('show_in_jumplinks', wagtail.blocks.BooleanBlock(default=False, help_text="Link to this block in the jumplinks list (when 'Show jumplinks' is enabled in Page settings)", required=False)), ('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=80, required=True))], help_text='Heading for this tile block', required=False)), ('description', wagtail.blocks.CharBlock(help_text='Description for this tile block', label='Description', required=False)), ('landing_page', wagtail.blocks.PageChooserBlock(help_text='Select the Event Landing Page whose child pages you want to show as tiles in this block.', page_type=['events.EventsLandingPage'], required=True)), ('max_articles', wagtail.blocks.ChoiceBlock(choices=[(3, '3'), (6, '6'), (9, '9')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(help_text='Choose a page to link to', label='Wagtail Page', required=False)), ('title', wagtail.blocks.CharBlock(help_text='Set title for this link', label='Link title', max_length=80, required=False))], help_text="'See more' link", required=False))])), ('migrated', cdhweb.pages.blocks.migrated.MigratedBlock())], blank=True, help_text='Put content for the body of the page here. Start with using the + button.', use_json_field=True, verbose_name='Page content'), + ), + ] diff --git a/cdhweb/projects/wagtail_hooks.py b/cdhweb/projects/wagtail_hooks.py index 9cf2746c..16a06175 100644 --- a/cdhweb/projects/wagtail_hooks.py +++ b/cdhweb/projects/wagtail_hooks.py @@ -23,7 +23,6 @@ class ProjectAdmin(ThumbnailMixin, ModelAdmin): ) search_fields = ("title", "description", "body") export_filename = "cdhweb-projects" - exclude_from_explorer = True thumb_image_field_name = "thumbnail" thumb_col_header_text = "thumbnail" ordering = ("title",) diff --git a/templates/cdhpages/blocks/article_tile_block.html b/templates/cdhpages/blocks/article_tile_block.html new file mode 100644 index 00000000..aa758b1e --- /dev/null +++ b/templates/cdhpages/blocks/article_tile_block.html @@ -0,0 +1,27 @@ +{% load wagtailcore_tags %} + +{% if self.heading or self.see_more_link.page %} +
+ {% if self.heading %} + {% include_block self.heading %} + {% endif %} + + {% if self.see_more_link %} + + {{ self.see_more_link }} + + {% endif %} +
+{% endif %} + +{% if self.description %} +
+ {{ self.description }} +
+{% endif %} + +
+ {% for tile in tiles %} + {% include 'cdhpages/blocks/tile.html' with internal_page=tile tile_type='internal_page_tile' has_component_title=self.heading.heading %} + {% endfor %} +
\ No newline at end of file diff --git a/templates/cdhpages/blocks/standard_tile_block.html b/templates/cdhpages/blocks/standard_tile_block.html index b8f51590..9ae019b1 100644 --- a/templates/cdhpages/blocks/standard_tile_block.html +++ b/templates/cdhpages/blocks/standard_tile_block.html @@ -1,5 +1,9 @@ {% load wagtailcore_tags %} +{% if self.featured %} + {# make it look different } +{% endif %} + {% if self.heading or self.see_more_link.page %}
{% if self.heading %}