diff --git a/ov_collections/migrations/0013_alter_collection_content.py b/ov_collections/migrations/0013_alter_collection_content.py new file mode 100644 index 0000000..02d86b4 --- /dev/null +++ b/ov_collections/migrations/0013_alter_collection_content.py @@ -0,0 +1,279 @@ +# Generated by Django 5.0.6 on 2024-05-20 20:58 + +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("ov_collections", "0012_remove_collection_aapb_records_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="collection", + name="content", + field=wagtail.fields.StreamField( + [ + ( + "interviews", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="openquote", + label="Interviews", + ), + ), + ( + "archival_footage", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="clipboard-list", + label="Archival Footage", + ), + ), + ( + "photographs", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="copy", + label="Photographs", + ), + ), + ( + "original_footage", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="doc-full-inverse", + label="Original Footage", + ), + ), + ( + "programs", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="desktop", + label="Programs", + ), + ), + ( + "related_content", + wagtail.blocks.StructBlock( + [ + ( + "guids", + wagtail.blocks.TextBlock( + help_text="AAPB record IDs, separated by whitespace", + required=True, + ), + ), + ( + "show_title", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset title(s)", + required=False, + ), + ), + ( + "show_thumbnail", + wagtail.blocks.BooleanBlock( + default=True, + help_text="Show asset thumbnail(s)", + required=False, + ), + ), + ( + "title", + wagtail.blocks.RichTextBlock( + features=["italic"], + help_text="The title of this group", + max_length=1024, + required=False, + ), + ), + ], + icon="table", + label="Related Content", + ), + ), + ("credits", wagtail.blocks.RichTextBlock(icon="form")), + ( + "heading", + wagtail.blocks.RichTextBlock( + features=["italic"], form_classname="title", icon="title" + ), + ), + ("text", wagtail.blocks.RichTextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("html", wagtail.blocks.RawHTMLBlock(label="HTML")), + ] + ), + ), + ] diff --git a/ov_collections/models.py b/ov_collections/models.py index 506b391..98b587d 100644 --- a/ov_collections/models.py +++ b/ov_collections/models.py @@ -3,11 +3,7 @@ from django.db import models from wagtail.admin.panels import FieldPanel, MultiFieldPanel from wagtail.api import APIField -from wagtail.blocks import ( - RawHTMLBlock, - RichTextBlock, - TextBlock, -) +from wagtail.blocks import RawHTMLBlock, RichTextBlock from wagtail.fields import RichTextField, StreamField from wagtail.images.api.fields import ImageRenditionField from wagtail.images.blocks import ImageChooserBlock @@ -45,7 +41,7 @@ class Collection(HeadlessMixin, Page): form_classname='title', features=['italic'], icon='title' ), ), - ('text', TextBlock()), + ('text', RichTextBlock()), ('image', ImageChooserBlock()), ('html', RawHTMLBlock(label='HTML')), ],