From ce62a3c11a2905482b0ded985f98eaf6277819c5 Mon Sep 17 00:00:00 2001 From: sarahframe Date: Fri, 5 Jul 2024 13:26:25 +1200 Subject: [PATCH 1/4] remove section link title from primary nav --- ...4_remove_level1menuitem_section_link_title.py | 16 ++++++++++++++++ cdhweb/pages/snippets.py | 11 ++--------- cdhweb/pages/templatetags/core_tags.py | 1 - 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 cdhweb/pages/migrations/0054_remove_level1menuitem_section_link_title.py diff --git a/cdhweb/pages/migrations/0054_remove_level1menuitem_section_link_title.py b/cdhweb/pages/migrations/0054_remove_level1menuitem_section_link_title.py new file mode 100644 index 00000000..59edcbb0 --- /dev/null +++ b/cdhweb/pages/migrations/0054_remove_level1menuitem_section_link_title.py @@ -0,0 +1,16 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:25 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cdhpages", "0053_alter_purplemode_options_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="level1menuitem", + name="section_link_title", + ), + ] diff --git a/cdhweb/pages/snippets.py b/cdhweb/pages/snippets.py index 29d763d7..6a37d0c4 100644 --- a/cdhweb/pages/snippets.py +++ b/cdhweb/pages/snippets.py @@ -9,7 +9,6 @@ from wagtail.snippets.models import register_snippet - class Level2MenuItem(Orderable, ClusterableModel): """ Represents a 'second-level' menu item. @@ -68,12 +67,6 @@ class Level1MenuItem(Orderable, ClusterableModel): blank=True, null=False, ) - section_link_title = models.CharField( - max_length=60, - verbose_name="Section link title", - blank=True, - null=False, - ) section_link = StreamField( [ ("page", blocks.PageChooserBlock()), @@ -85,7 +78,6 @@ class Level1MenuItem(Orderable, ClusterableModel): panels = [ FieldPanel("title"), FieldPanel("overview"), - FieldPanel("section_link_title"), FieldPanel("section_link"), InlinePanel("l2_items", label="Second-level menu items", max_num=20), ] @@ -348,6 +340,7 @@ class SiteAlert(models.Model): FieldPanel("display_until"), FieldPanel("dismissable"), ] + def __str__(self): if self.title: return self.title @@ -370,7 +363,7 @@ def clean(self): raise ValidationError(errors) return super().clean() - + @property def alert_id(self): return f"alert_{self.id}" diff --git a/cdhweb/pages/templatetags/core_tags.py b/cdhweb/pages/templatetags/core_tags.py index c967e33c..f029e625 100644 --- a/cdhweb/pages/templatetags/core_tags.py +++ b/cdhweb/pages/templatetags/core_tags.py @@ -62,7 +62,6 @@ def _l1_item_to_dict(l1_item): l1_item_data = { "title": l1_item.title, "overview": l1_item.overview, - "section_link_title": l1_item.section_link_title, "link_url": l1_item.link_url, "l2_items": l2_item_data, } From f773118c055581bee411cc0a5fd4fcae62f040c8 Mon Sep 17 00:00:00 2001 From: sarahframe Date: Fri, 5 Jul 2024 13:31:31 +1200 Subject: [PATCH 2/4] add help text to attachments --- .../0021_alter_blogpost_attachments.py | 21 +++++++++++++++ .../0021_alter_event_attachments.py | 21 +++++++++++++++ ..._alter_contentpage_attachments_and_more.py | 26 +++++++++++++++++++ cdhweb/pages/models.py | 7 ++++- ...peoplecategorypage_attachments_and_more.py | 26 +++++++++++++++++++ .../0029_alter_project_attachments.py | 21 +++++++++++++++ 6 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 cdhweb/blog/migrations/0021_alter_blogpost_attachments.py create mode 100644 cdhweb/events/migrations/0021_alter_event_attachments.py create mode 100644 cdhweb/pages/migrations/0055_alter_contentpage_attachments_and_more.py create mode 100644 cdhweb/people/migrations/0022_alter_peoplecategorypage_attachments_and_more.py create mode 100644 cdhweb/projects/migrations/0029_alter_project_attachments.py diff --git a/cdhweb/blog/migrations/0021_alter_blogpost_attachments.py b/cdhweb/blog/migrations/0021_alter_blogpost_attachments.py new file mode 100644 index 00000000..6543bedf --- /dev/null +++ b/cdhweb/blog/migrations/0021_alter_blogpost_attachments.py @@ -0,0 +1,21 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:30 + +import wagtail.documents.blocks +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('blog', '0020_alter_blogpost_body'), + ] + + operations = [ + migrations.AlterField( + model_name='blogpost', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + ] diff --git a/cdhweb/events/migrations/0021_alter_event_attachments.py b/cdhweb/events/migrations/0021_alter_event_attachments.py new file mode 100644 index 00000000..14c71878 --- /dev/null +++ b/cdhweb/events/migrations/0021_alter_event_attachments.py @@ -0,0 +1,21 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:30 + +import wagtail.documents.blocks +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0020_alter_event_body'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + ] diff --git a/cdhweb/pages/migrations/0055_alter_contentpage_attachments_and_more.py b/cdhweb/pages/migrations/0055_alter_contentpage_attachments_and_more.py new file mode 100644 index 00000000..7fd2a08e --- /dev/null +++ b/cdhweb/pages/migrations/0055_alter_contentpage_attachments_and_more.py @@ -0,0 +1,26 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:30 + +import wagtail.documents.blocks +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cdhpages', '0054_remove_level1menuitem_section_link_title'), + ] + + operations = [ + migrations.AlterField( + model_name='contentpage', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + migrations.AlterField( + model_name='landingpage', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + ] diff --git a/cdhweb/pages/models.py b/cdhweb/pages/models.py index ea9a5e28..6aa06bdf 100644 --- a/cdhweb/pages/models.py +++ b/cdhweb/pages/models.py @@ -266,7 +266,12 @@ class BasePage(Page): use_json_field=True, ) - attachments = StreamField(AttachmentBlock, blank=True, use_json_field=True) + attachments = StreamField( + AttachmentBlock, + blank=True, + use_json_field=True, + help_text="This block exists to help with data migration. It will be deleted when content loading is complete.", + ) short_title = models.CharField( verbose_name="Short title", diff --git a/cdhweb/people/migrations/0022_alter_peoplecategorypage_attachments_and_more.py b/cdhweb/people/migrations/0022_alter_peoplecategorypage_attachments_and_more.py new file mode 100644 index 00000000..7b783105 --- /dev/null +++ b/cdhweb/people/migrations/0022_alter_peoplecategorypage_attachments_and_more.py @@ -0,0 +1,26 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:30 + +import wagtail.documents.blocks +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0021_alter_peoplecategorypage_category'), + ] + + operations = [ + migrations.AlterField( + model_name='peoplecategorypage', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + migrations.AlterField( + model_name='profile', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + ] diff --git a/cdhweb/projects/migrations/0029_alter_project_attachments.py b/cdhweb/projects/migrations/0029_alter_project_attachments.py new file mode 100644 index 00000000..0cab0a18 --- /dev/null +++ b/cdhweb/projects/migrations/0029_alter_project_attachments.py @@ -0,0 +1,21 @@ +# Generated by Django 5.0.5 on 2024-07-05 01:30 + +import wagtail.documents.blocks +import wagtail.fields +import wagtail.snippets.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0028_alter_project_accordion'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='attachments', + field=wagtail.fields.StreamField([('document', wagtail.documents.blocks.DocumentChooserBlock()), ('link', wagtail.snippets.blocks.SnippetChooserBlock('cdhpages.ExternalAttachment'))], blank=True, help_text='This block exists to help with data migration. It will be deleted when content loading is complete.', use_json_field=True), + ), + ] From 6ca64141400c264876bd4ae0f244341785561539 Mon Sep 17 00:00:00 2001 From: sarahframe Date: Mon, 8 Jul 2024 11:59:57 +1200 Subject: [PATCH 3/4] remove unused snippets --- cdhweb/blog/tests/conftest.py | 2 +- cdhweb/events/tests/test_templates.py | 8 ----- cdhweb/pages/context_processors.py | 17 ---------- ..._remove_linkpage_extra_classes_and_more.py | 28 ++++++++++++++++ .../pages/migrations/0057_delete_pageintro.py | 16 +++++++++ cdhweb/pages/models.py | 33 ++++--------------- cdhweb/pages/tests/test_context_processors.py | 16 --------- cdhweb/people/tests/test_pages.py | 2 +- cdhweb/projects/tests/test_templates.py | 16 --------- cdhweb/settings/components/base.py | 2 -- 10 files changed, 52 insertions(+), 88 deletions(-) create mode 100644 cdhweb/pages/migrations/0056_remove_linkpage_extra_classes_and_more.py create mode 100644 cdhweb/pages/migrations/0057_delete_pageintro.py diff --git a/cdhweb/blog/tests/conftest.py b/cdhweb/blog/tests/conftest.py index c592dfba..f9b7ccf5 100644 --- a/cdhweb/blog/tests/conftest.py +++ b/cdhweb/blog/tests/conftest.py @@ -12,7 +12,7 @@ def make_blog_link_page(homepage): """Create a test blog link page underneath the homepage.""" - link = BlogLinkPageArchived(title="updates", link_url="updates") + link = BlogLinkPageArchived(title="updates") homepage.add_child(instance=link) homepage.save() return link diff --git a/cdhweb/events/tests/test_templates.py b/cdhweb/events/tests/test_templates.py index 0405e3d0..c151161f 100644 --- a/cdhweb/events/tests/test_templates.py +++ b/cdhweb/events/tests/test_templates.py @@ -125,11 +125,3 @@ def test_event_location(self, client, workshop): """event archive page should list non-virtal event address on cards""" response = client.get(reverse("events:upcoming")) assertContains(response, workshop.location.address) - - def test_page_intro(self, client, events_link_page): - """event archive page should display an intro snippet if set""" - # create a snippet for the upcoming events page - PageIntro.objects.create(page=events_link_page, paragraph="test content") - # visit and check that it renders - response = client.get(reverse("events:upcoming")) - assertContains(response, "test content") diff --git a/cdhweb/pages/context_processors.py b/cdhweb/pages/context_processors.py index f4fd8478..d0fc3f47 100644 --- a/cdhweb/pages/context_processors.py +++ b/cdhweb/pages/context_processors.py @@ -1,21 +1,4 @@ from cdhweb.pages.forms import SiteSearchForm -from cdhweb.pages.models import PageIntro - - -def page_intro(request): - """Template context processor: if there is a PageIntro snippet - for this page, add it to the context for display.""" - # wagtail stores link url without leading and trailing slashes, - # but requests to django view urls include them; strip them off to match - - # NOTE: page intro modification time is NOT taken into account - # when generating Last-Modified headers and returning 304 Not Modified - page_intro = PageIntro.objects.filter( - page__link_url=request.path.strip("/") - ).first() - if page_intro: - return {"page_intro": page_intro} - return {} def site_search(request): diff --git a/cdhweb/pages/migrations/0056_remove_linkpage_extra_classes_and_more.py b/cdhweb/pages/migrations/0056_remove_linkpage_extra_classes_and_more.py new file mode 100644 index 00000000..0ffe27ae --- /dev/null +++ b/cdhweb/pages/migrations/0056_remove_linkpage_extra_classes_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.5 on 2024-07-07 23:49 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cdhpages", "0055_alter_contentpage_attachments_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="linkpage", + name="extra_classes", + ), + migrations.RemoveField( + model_name="linkpage", + name="link_page", + ), + migrations.RemoveField( + model_name="linkpage", + name="link_url", + ), + migrations.RemoveField( + model_name="linkpage", + name="url_append", + ), + ] diff --git a/cdhweb/pages/migrations/0057_delete_pageintro.py b/cdhweb/pages/migrations/0057_delete_pageintro.py new file mode 100644 index 00000000..ad5cd426 --- /dev/null +++ b/cdhweb/pages/migrations/0057_delete_pageintro.py @@ -0,0 +1,16 @@ +# Generated by Django 5.0.5 on 2024-07-07 23:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cdhpages', '0056_remove_linkpage_extra_classes_and_more'), + ] + + operations = [ + migrations.DeleteModel( + name='PageIntro', + ), + ] diff --git a/cdhweb/pages/models.py b/cdhweb/pages/models.py index 6aa06bdf..c57ba842 100644 --- a/cdhweb/pages/models.py +++ b/cdhweb/pages/models.py @@ -30,8 +30,6 @@ from wagtail.snippets.blocks import SnippetChooserBlock from wagtail.snippets.models import register_snippet from wagtailcodeblock.blocks import CodeBlock -from wagtailmenus.models import AbstractLinkPage -from wagtailmenus.panels import linkpage_tab from cdhweb.pages import snippets # needed for import order @@ -237,19 +235,18 @@ def get_plaintext_description(self): return striptags(self.get_description()) -class LinkPage(AbstractLinkPage): +class LinkPage(Page): """Link page for controlling appearance in menus of non-Page content.""" # NOTE these pages can have slugs, but the slug isn't editable in the admin # by default. We override the editing interface to introduce a "promote" # panel as with other Page models containing the form field for the slug. # see: https://github.com/rkhleics/wagtailmenus/blob/master/wagtailmenus/panels.py#L79-L93 - edit_handler = TabbedInterface( - [ - linkpage_tab, - ObjectList((MultiFieldPanel((FieldPanel("slug"),)),), heading="Promote"), - ] - ) + # edit_handler = TabbedInterface( + # [ + # ObjectList((MultiFieldPanel((FieldPanel("slug"),)),), heading="Promote"), + # ] + # ) search_fields = Page.search_fields is_creatable = False @@ -436,24 +433,6 @@ def get_context(self, request): return context -@register_snippet -class PageIntro(models.Model): - """Snippet for optional page intro text on for pages generated from - django views not managed by wagtail""" - - page = models.OneToOneField(LinkPage, on_delete=models.CASCADE) - #: intro text - paragraph = RichTextField(features=PARAGRAPH_FEATURES) - - panels = [ - FieldPanel("page"), - FieldPanel("paragraph"), - ] - - def __str__(self): - return self.page.title - - class DisplayUrlMixin(models.Model): """Mixin that provides a single required URL field and a display method.""" diff --git a/cdhweb/pages/tests/test_context_processors.py b/cdhweb/pages/tests/test_context_processors.py index d8e96db9..a0a18098 100644 --- a/cdhweb/pages/tests/test_context_processors.py +++ b/cdhweb/pages/tests/test_context_processors.py @@ -1,20 +1,4 @@ import pytest from wagtail.models import Page -from cdhweb.pages.context_processors import page_intro from cdhweb.pages.models import LinkPage, PageIntro - - -@pytest.mark.django_db -def test_page_intro(rf): - root = Page.objects.get(title="Root") - link_page = LinkPage(title="Students", link_url="people/students") - root.add_child(instance=link_page) - intro = PageIntro.objects.create( - page=link_page, paragraph="

We have great students

" - ) - - # should find a page intro for students - assert page_intro(rf.get("/people/students/")) == {"page_intro": intro} - # but not not for staff - assert page_intro(rf.get("/people/staff/")) == {} diff --git a/cdhweb/people/tests/test_pages.py b/cdhweb/people/tests/test_pages.py index ad4024bd..d05feca3 100644 --- a/cdhweb/people/tests/test_pages.py +++ b/cdhweb/people/tests/test_pages.py @@ -125,7 +125,7 @@ def test_child_pages(self): class TestPageIntro: def test_str(self): root = Page.objects.get(title="Root") - link_page = LinkPage(title="Students", link_url="people/students") + link_page = LinkPage(title="Students") root.add_child(instance=link_page) intro = PageIntro.objects.create( page=link_page, paragraph="

We have great students

" diff --git a/cdhweb/projects/tests/test_templates.py b/cdhweb/projects/tests/test_templates.py index 983dd67a..7769edeb 100644 --- a/cdhweb/projects/tests/test_templates.py +++ b/cdhweb/projects/tests/test_templates.py @@ -120,22 +120,6 @@ def test_page_titles(self, client, projects): response = client.get(reverse("projects:working-groups")) assertNotContains(response, "

Past Projects

") - def test_page_intro(self, client, projects_landing_page): - """project list pages should display an intro snippet if set""" - # create link page for project list - sponsored_projects = LinkPage( - title="Sponsored Projects", link_url="projects/sponsored" - ) - projects_landing_page.add_child(instance=sponsored_projects) - # create a snippet for the sponsored projects page - PageIntro.objects.create( - page=sponsored_projects, paragraph="test content" - ) - - # visit and check that it renders - response = client.get(reverse("projects:sponsored")) - assertContains(response, "test content") - def test_project_card(self, client, projects): """project list pages should display cards for each project""" # one project card for each staff/postdoc project diff --git a/cdhweb/settings/components/base.py b/cdhweb/settings/components/base.py index 50de0b75..ff96d188 100644 --- a/cdhweb/settings/components/base.py +++ b/cdhweb/settings/components/base.py @@ -147,7 +147,6 @@ # "wagtailmenus.context_processors.wagtailmenus", "cdhweb.context_extras", "cdhweb.context_processors.template_settings", - "cdhweb.pages.context_processors.page_intro", "cdhweb.pages.context_processors.site_search", "cdhweb.context_processors.show_test_warning", ], @@ -188,7 +187,6 @@ "wagtail.admin", "wagtail_modeladmin", "wagtail", - "wagtailmenus", "wagtailautocomplete", "modelcluster", "taggit", From 0eda5ed00eecf89d00496860a964990e552e126f Mon Sep 17 00:00:00 2001 From: sarahframe Date: Mon, 8 Jul 2024 13:44:10 +1200 Subject: [PATCH 4/4] add deprecated embed block --- .../migrations/0022_alter_blogpost_body.py | 28 ++++++++++++++ .../migrations/0022_alter_event_body.py | 28 ++++++++++++++ cdhweb/pages/blocks/embed_block.py | 14 +++++++ ...tpage_body_alter_homepage_body_and_more.py | 38 +++++++++++++++++++ cdhweb/pages/models.py | 8 ++-- ...plecategorypage_body_alter_profile_body.py | 33 ++++++++++++++++ .../migrations/0030_alter_project_body.py | 28 ++++++++++++++ 7 files changed, 173 insertions(+), 4 deletions(-) create mode 100644 cdhweb/blog/migrations/0022_alter_blogpost_body.py create mode 100644 cdhweb/events/migrations/0022_alter_event_body.py create mode 100644 cdhweb/pages/blocks/embed_block.py create mode 100644 cdhweb/pages/migrations/0058_alter_contentpage_body_alter_homepage_body_and_more.py create mode 100644 cdhweb/people/migrations/0023_alter_peoplecategorypage_body_alter_profile_body.py create mode 100644 cdhweb/projects/migrations/0030_alter_project_body.py diff --git a/cdhweb/blog/migrations/0022_alter_blogpost_body.py b/cdhweb/blog/migrations/0022_alter_blogpost_body.py new file mode 100644 index 00000000..ba8ec6c9 --- /dev/null +++ b/cdhweb/blog/migrations/0022_alter_blogpost_body.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.5 on 2024-07-08 01:42 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.embed_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', '0021_alter_blogpost_attachments'), + ] + + 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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/0022_alter_event_body.py b/cdhweb/events/migrations/0022_alter_event_body.py new file mode 100644 index 00000000..b79c912a --- /dev/null +++ b/cdhweb/events/migrations/0022_alter_event_body.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.5 on 2024-07-08 01:42 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.embed_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', '0021_alter_event_attachments'), + ] + + 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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/blocks/embed_block.py b/cdhweb/pages/blocks/embed_block.py new file mode 100644 index 00000000..22be50bb --- /dev/null +++ b/cdhweb/pages/blocks/embed_block.py @@ -0,0 +1,14 @@ +from wagtail.embeds.blocks import EmbedBlock + + +class EmbedBlock(EmbedBlock): + class Meta: + icon = "warning" + group = "Deprecated" + + def __init__(self, *args, **kwargs): + kwargs[ + "help_text" + ] = """This block exists to help with data migration. It will be deleted when content loading is complete. + Please use the CDH Hosted Video instead. """ + super().__init__(*args, **kwargs) diff --git a/cdhweb/pages/migrations/0058_alter_contentpage_body_alter_homepage_body_and_more.py b/cdhweb/pages/migrations/0058_alter_contentpage_body_alter_homepage_body_and_more.py new file mode 100644 index 00000000..93d5f999 --- /dev/null +++ b/cdhweb/pages/migrations/0058_alter_contentpage_body_alter_homepage_body_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 5.0.5 on 2024-07-08 01:42 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.embed_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', '0057_delete_pageintro'), + ] + + 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock())], 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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 c57ba842..176b98ba 100644 --- a/cdhweb/pages/models.py +++ b/cdhweb/pages/models.py @@ -21,7 +21,6 @@ from wagtail.contrib.settings.models import BaseSiteSetting, register_setting from wagtail.documents.blocks import DocumentChooserBlock from wagtail.documents.models import AbstractDocument, DocumentQuerySet -from wagtail.embeds.blocks import EmbedBlock from wagtail.fields import RichTextField, StreamField from wagtail.images.blocks import ImageChooserBlock from wagtail.images.models import Image @@ -37,6 +36,7 @@ from .blocks.article_index_block import ArticleTileBlock from .blocks.cdh_hosted_video import HostedVideo from .blocks.download_block import DownloadBlock +from .blocks.embed_block import EmbedBlock from .blocks.event_index_block import EventTileBlock from .blocks.feature_block import FeatureBlock from .blocks.image_block import ImageBlock @@ -71,15 +71,13 @@ ALT_TEXT_HELP = """Alternative text for visually impaired users to briefly communicate the intended message of the image in this context.""" -EMBED_HELP = """This should be used for videos from Princeton's Media Central. Copy the "oEmbed URL" from the "Share" menu""" - STANDARD_BLOCKS = [ ("paragraph", RichText()), ("download_block", DownloadBlock()), ("cta_block", CTABlock()), ("accordion_block", AccordionBlock()), ("video_block", Video()), - ("embed", HostedVideo()), + ("cdh_hosted_video", HostedVideo()), ("pull_quote", PullQuote()), ("note", Note()), ("image", ImageBlock()), @@ -90,6 +88,7 @@ ("tile_block", StandardTileBlock()), ("article_tile_block", ArticleTileBlock()), ("event_tile_block", EventTileBlock()), + ("embed", EmbedBlock()), ] @@ -318,6 +317,7 @@ class ContentPage(BasePage, StandardHeroMixin, JumplinksMixin, SidebarNavigation content_panels = StandardHeroMixin.content_panels + [ FieldPanel("body"), + FieldPanel("attachments"), ] search_fields = StandardHeroMixin.search_fields + [index.SearchField("body")] diff --git a/cdhweb/people/migrations/0023_alter_peoplecategorypage_body_alter_profile_body.py b/cdhweb/people/migrations/0023_alter_peoplecategorypage_body_alter_profile_body.py new file mode 100644 index 00000000..5aee50c5 --- /dev/null +++ b/cdhweb/people/migrations/0023_alter_peoplecategorypage_body_alter_profile_body.py @@ -0,0 +1,33 @@ +# Generated by Django 5.0.5 on 2024-07-08 01:42 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.embed_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', '0022_alter_peoplecategorypage_attachments_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='peoplecategorypage', + 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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/0030_alter_project_body.py b/cdhweb/projects/migrations/0030_alter_project_body.py new file mode 100644 index 00000000..3757ff0b --- /dev/null +++ b/cdhweb/projects/migrations/0030_alter_project_body.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.5 on 2024-07-08 01:42 + +import cdhweb.pages.blocks.download_block +import cdhweb.pages.blocks.embed_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', '0029_alter_project_attachments'), + ] + + 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))])), ('cdh_hosted_video', 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, 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=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')], help_text='Define the maximum number of tiles to show in this group.', icon='placeholder')), ('see_more_link', wagtail.blocks.CharBlock(default='See All', help_text='Set text for the link which takes you to the landing page', label='Link title', max_length=80, required=False))])), ('embed', cdhweb.pages.blocks.embed_block.EmbedBlock()), ('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'), + ), + ]