Add typed table block

This commit is contained in:
Jake Howard 2022-08-19 13:48:45 +01:00
parent 5affe274bd
commit 09c4b93245
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 1710 additions and 0 deletions

View file

@ -0,0 +1,890 @@
# Generated by Django 4.0.6 on 2022-08-19 12:45
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", "0017_alter_blogcollectionlistpage_body_and_more"),
]
operations = [
migrations.AlterField(
model_name="blogcollectionlistpage",
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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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="blogcollectionpage",
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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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="bloglistpage",
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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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,310 @@
# Generated by Django 4.0.6 on 2022-08-19 12:45
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", "0017_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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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

@ -5,6 +5,7 @@ from django.utils import lorem_ipsum
from django.utils.html import format_html_join from django.utils.html import format_html_join
from django.utils.text import slugify from django.utils.text import slugify
from wagtail import blocks from wagtail import blocks
from wagtail.contrib.typed_table_block.blocks import TypedTableBlock
from wagtail.embeds.blocks import EmbedBlock from wagtail.embeds.blocks import EmbedBlock
from wagtail.images.blocks import ImageChooserBlock from wagtail.images.blocks import ImageChooserBlock
@ -73,6 +74,19 @@ def get_blocks() -> list[tuple[str, blocks.BaseBlock]]:
("code", CodeBlock()), ("code", CodeBlock()),
("tangent", TangentBlock()), ("tangent", TangentBlock()),
("mermaid", MermaidBlock()), ("mermaid", MermaidBlock()),
(
"table",
TypedTableBlock(
[
(
"rich_text",
blocks.RichTextBlock(features=RICH_TEXT_FEATURES_PLAIN),
),
("numeric", blocks.FloatBlock()),
("text", blocks.CharBlock()),
]
),
),
] ]

View file

@ -0,0 +1,165 @@
# Generated by Django 4.0.6 on 2022-08-19 12:45
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", "0003_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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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,165 @@
# Generated by Django 4.0.6 on 2022-08-19 12:45
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", "0002_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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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

@ -39,6 +39,7 @@ INSTALLED_APPS = [
"wagtail.contrib.redirects", "wagtail.contrib.redirects",
"wagtail.contrib.modeladmin", "wagtail.contrib.modeladmin",
"wagtail.contrib.routable_page", "wagtail.contrib.routable_page",
"wagtail.contrib.typed_table_block",
"wagtail.embeds", "wagtail.embeds",
"wagtail.sites", "wagtail.sites",
"wagtail.users", "wagtail.users",

View file

@ -0,0 +1,165 @@
# Generated by Django 4.0.6 on 2022-08-19 12:45
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", "0003_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",
]
),
),
]
),
),
(
"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",
]
),
),
]
),
),
(
"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,
),
),
]