Skip to content

Commit

Permalink
add richtextblock
Browse files Browse the repository at this point in the history
  • Loading branch information
RachellCalhoun authored and tim-schilling committed Dec 28, 2023
1 parent 1115b12 commit a53b6a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion home/blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from wagtail.core import blocks
from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.blocks import StreamBlock
from wagtail.blocks import StreamBlock, RichTextBlock
from wagtail.images.blocks import ImageChooserBlock


Expand Down Expand Up @@ -183,3 +183,4 @@ class BaseStreamBlock(StreamBlock):
video_embed = VideoEmbed()
table = TableBlock()
code_block = CodeBlock()
rich_text = RichTextBlock()
22 changes: 22 additions & 0 deletions home/puput_migrations/0003_alter_entrypage_body.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.1.5 on 2023-12-27 17:52

from django.db import migrations
import wagtail.blocks
import wagtail.contrib.table_block.blocks
import wagtail.fields
import wagtail.images.blocks


class Migration(migrations.Migration):

dependencies = [
('puput', '0002_entrypage_markdown_body'),
]

operations = [
migrations.AlterField(
model_name='entrypage',
name='body',
field=wagtail.fields.StreamField([('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='heading-blog', max_length=255))])), ('paragraph', wagtail.blocks.CharBlock(max_length=255)), ('html', wagtail.blocks.RawHTMLBlock(icon='code', label='Raw HTML')), ('image', wagtail.images.blocks.ImageChooserBlock()), ('text_with_heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('text_with_heading_and_right_image', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='heading-blog', max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('text_with_heading_and_left_image', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='blog', max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('right_image_left_text', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('text', wagtail.blocks.TextBlock())])), ('left_image_right_text', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('text', wagtail.blocks.TextBlock())])), ('left_quote_right_image', wagtail.blocks.StructBlock([('quote', wagtail.blocks.TextBlock()), ('byline', wagtail.blocks.CharBlock(max_length=255)), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('video_embed', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=255)), ('text', wagtail.blocks.TextBlock())])), ('table', wagtail.contrib.table_block.blocks.TableBlock()), ('code_block', wagtail.blocks.StructBlock([('language', wagtail.blocks.ChoiceBlock(choices=[('Python', 'python'), ('Markup', 'html'), ('CSS', 'css'), ('Clojure', 'clojure'), ('Bash', 'shell'), ('Django', 'django'), ('Jinja2', 'jinja2'), ('Docker', 'dockerfile'), ('Git', 'git'), ('GraphQL', 'graphql'), ('Handlebars', 'handlebars'), ('.ignore', 'gitignore'), ('JSON', 'json'), ('JSON5', 'json5'), ('Markdown', 'md'), ('Markdown', 'md'), ('React JSX', 'jsx'), ('React TSX', 'tsx'), ('SASS', 'sass'), ('SCSS', 'scss'), ('TypeScript', 'ts'), ('vim', 'vim')])), ('caption', wagtail.blocks.CharBlock(blank=True, max_length=255)), ('page', wagtail.blocks.CharBlock(blank=True, max_length=255)), ('code', wagtail.blocks.TextBlock(blank=True, max_length=1000))])), ('rich_text', wagtail.blocks.RichTextBlock())], null=True, use_json_field=True, verbose_name='StreamField Body'),
),
]

0 comments on commit a53b6a6

Please sign in to comment.