Ensure captions are optional

This commit is contained in:
Jake Howard 2022-08-20 18:38:28 +01:00
parent 900aaad850
commit 32a1486840
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 1722 additions and 2 deletions

View file

@ -0,0 +1,905 @@
# Generated by Django 4.0.6 on 2022-08-20 17:38
import wagtail.blocks
import wagtail.contrib.typed_table_block.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
import website.contrib.code_block.blocks
class Migration(migrations.Migration):
dependencies = [
(
"blog",
"0019_rename_blogcollectionlistpage_blogpostcollectionlistpage_and_more",
),
]
operations = [
migrations.AlterField(
model_name="blogpostcollectionlistpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="blogpostcollectionpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="blogpostlistpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="blogpostpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="blogposttaglistpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="blogposttagpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
]

View file

@ -0,0 +1,314 @@
# Generated by Django 4.0.6 on 2022-08-20 17:38
import wagtail.blocks
import wagtail.contrib.typed_table_block.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
import website.contrib.code_block.blocks
class Migration(migrations.Migration):
dependencies = [
("common", "0018_alter_contentpage_body_alter_listingpage_body"),
]
operations = [
migrations.AlterField(
model_name="contentpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
migrations.AlterField(
model_name="listingpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
]

View file

@ -37,7 +37,7 @@ class LoremBlock(blocks.StructBlock):
class ImageCaptionBlock(blocks.StructBlock): class ImageCaptionBlock(blocks.StructBlock):
image = ImageChooserBlock() image = ImageChooserBlock()
caption = blocks.RichTextBlock(features=RICH_TEXT_FEATURES_PLAIN) caption = blocks.RichTextBlock(features=RICH_TEXT_FEATURES_PLAIN, required=False)
class Meta: class Meta:
icon = "image" icon = "image"

View file

@ -0,0 +1,167 @@
# Generated by Django 4.0.6 on 2022-08-20 17:38
import wagtail.blocks
import wagtail.contrib.typed_table_block.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
import website.contrib.code_block.blocks
class Migration(migrations.Migration):
dependencies = [
("contact", "0004_alter_contactpage_body"),
]
operations = [
migrations.AlterField(
model_name="contactpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
]

View file

@ -25,7 +25,7 @@ class MermaidStructValue(StructValue):
class MermaidBlock(StructBlock): class MermaidBlock(StructBlock):
source = TextBlock() source = TextBlock()
caption = RichTextBlock(features=RICH_TEXT_FEATURES_PLAIN) caption = RichTextBlock(features=RICH_TEXT_FEATURES_PLAIN, required=False)
class Meta: class Meta:
icon = "edit" icon = "edit"

View file

@ -0,0 +1,167 @@
# Generated by Django 4.0.6 on 2022-08-20 17:38
import wagtail.blocks
import wagtail.contrib.typed_table_block.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
import website.contrib.code_block.blocks
class Migration(migrations.Migration):
dependencies = [
("search", "0003_alter_searchpage_body"),
]
operations = [
migrations.AlterField(
model_name="searchpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
]

View file

@ -0,0 +1,167 @@
# Generated by Django 4.0.6 on 2022-08-20 17:38
import wagtail.blocks
import wagtail.contrib.typed_table_block.blocks
import wagtail.embeds.blocks
import wagtail.fields
import wagtail.images.blocks
from django.db import migrations
import website.contrib.code_block.blocks
class Migration(migrations.Migration):
dependencies = [
("spotify", "0004_alter_spotifyplaylistpage_body"),
]
operations = [
migrations.AlterField(
model_name="spotifyplaylistpage",
name="body",
field=wagtail.fields.StreamField(
[
("embed", wagtail.embeds.blocks.EmbedBlock()),
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"h2",
"h3",
"h4",
"h5",
"h6",
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
"snippet-embed",
]
),
),
(
"lorem",
wagtail.blocks.StructBlock(
[("paragraphs", wagtail.blocks.IntegerBlock(min_value=1))]
),
),
("html", wagtail.blocks.RawHTMLBlock()),
(
"image",
wagtail.blocks.StructBlock(
[
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"code",
wagtail.blocks.StructBlock(
[
(
"language",
wagtail.blocks.ChoiceBlock(
choices=website.contrib.code_block.blocks.get_language_choices
),
),
("source", wagtail.blocks.TextBlock()),
]
),
),
(
"tangent",
wagtail.blocks.StructBlock(
[
("name", wagtail.blocks.CharBlock(max_length=64)),
(
"content",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"ol",
"ul",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
]
),
),
(
"mermaid",
wagtail.blocks.StructBlock(
[
("source", wagtail.blocks.TextBlock()),
(
"caption",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
],
required=False,
),
),
]
),
),
(
"table",
wagtail.contrib.typed_table_block.blocks.TypedTableBlock(
[
(
"rich_text",
wagtail.blocks.RichTextBlock(
features=[
"bold",
"italic",
"link",
"document-link",
"code",
"strikethrough",
"snippet-link",
]
),
),
("numeric", wagtail.blocks.FloatBlock()),
("text", wagtail.blocks.CharBlock()),
]
),
),
],
blank=True,
use_json_field=True,
),
),
]