-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#114 use a new gallery with layout struct block to be able to use a t…
…emplate based on the layout -> this needs a body migration
- Loading branch information
Showing
9 changed files
with
345 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
216 changes: 216 additions & 0 deletions
216
cast/migrations/0052_alter_blog_template_base_dir_alter_post_body_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
# Generated by Django 5.0 on 2023-12-22 22:25 | ||
|
||
import cast.blocks | ||
import wagtail.blocks | ||
import wagtail.embeds.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cast", "0051_use_own_image_chooser_block"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="blog", | ||
name="template_base_dir", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[ | ||
("bootstrap4", "Bootstrap 4"), | ||
("plain", "Just HTML"), | ||
("vue", "Vue.js"), | ||
("bootstrap5", "Bootstrap 5"), | ||
], | ||
default=None, | ||
help_text="The theme to use for this blog implemented as a template base directory. If not set, the template base directory will be determined by a site setting.", | ||
max_length=128, | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="post", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
( | ||
"overview", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"heading", | ||
wagtail.blocks.CharBlock( | ||
form_classname="full title" | ||
), | ||
), | ||
("paragraph", wagtail.blocks.RichTextBlock()), | ||
( | ||
"code", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"language", | ||
wagtail.blocks.CharBlock( | ||
help_text="The language of the code block" | ||
), | ||
), | ||
( | ||
"source", | ||
wagtail.blocks.TextBlock( | ||
help_text="The source code of the block", | ||
rows=8, | ||
), | ||
), | ||
], | ||
icon="code", | ||
), | ||
), | ||
( | ||
"image", | ||
cast.blocks.CastImageChooserBlock( | ||
template="cast/image/image.html" | ||
), | ||
), | ||
( | ||
"gallery", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"gallery", | ||
cast.blocks.GalleryBlock( | ||
wagtail.images.blocks.ImageChooserBlock() | ||
), | ||
), | ||
( | ||
"layout", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=[ | ||
( | ||
"web_component", | ||
"Web Component with Modal", | ||
), | ||
("htmx", "HTMX based layout"), | ||
] | ||
), | ||
), | ||
] | ||
), | ||
), | ||
("embed", wagtail.embeds.blocks.EmbedBlock()), | ||
( | ||
"video", | ||
cast.blocks.VideoChooserBlock( | ||
icon="media", template="cast/video/video.html" | ||
), | ||
), | ||
( | ||
"audio", | ||
cast.blocks.AudioChooserBlock( | ||
icon="media", template="cast/audio/audio.html" | ||
), | ||
), | ||
] | ||
), | ||
), | ||
( | ||
"detail", | ||
wagtail.blocks.StreamBlock( | ||
[ | ||
( | ||
"heading", | ||
wagtail.blocks.CharBlock( | ||
form_classname="full title" | ||
), | ||
), | ||
("paragraph", wagtail.blocks.RichTextBlock()), | ||
( | ||
"code", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"language", | ||
wagtail.blocks.CharBlock( | ||
help_text="The language of the code block" | ||
), | ||
), | ||
( | ||
"source", | ||
wagtail.blocks.TextBlock( | ||
help_text="The source code of the block", | ||
rows=8, | ||
), | ||
), | ||
], | ||
icon="code", | ||
), | ||
), | ||
( | ||
"image", | ||
cast.blocks.CastImageChooserBlock( | ||
template="cast/image/image.html" | ||
), | ||
), | ||
( | ||
"gallery", | ||
wagtail.blocks.StructBlock( | ||
[ | ||
( | ||
"gallery", | ||
cast.blocks.GalleryBlock( | ||
wagtail.images.blocks.ImageChooserBlock() | ||
), | ||
), | ||
( | ||
"layout", | ||
wagtail.blocks.ChoiceBlock( | ||
choices=[ | ||
( | ||
"web_component", | ||
"Web Component with Modal", | ||
), | ||
("htmx", "HTMX based layout"), | ||
] | ||
), | ||
), | ||
] | ||
), | ||
), | ||
("embed", wagtail.embeds.blocks.EmbedBlock()), | ||
( | ||
"video", | ||
cast.blocks.VideoChooserBlock( | ||
icon="media", template="cast/video/video.html" | ||
), | ||
), | ||
( | ||
"audio", | ||
cast.blocks.AudioChooserBlock( | ||
icon="media", template="cast/audio/audio.html" | ||
), | ||
), | ||
] | ||
), | ||
), | ||
], | ||
use_json_field=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="templatebasedirectory", | ||
name="name", | ||
field=models.CharField( | ||
choices=[ | ||
("bootstrap4", "Bootstrap 4"), | ||
("plain", "Just HTML"), | ||
("vue", "Vue.js"), | ||
("bootstrap5", "Bootstrap 5"), | ||
], | ||
default="bootstrap4", | ||
help_text="The theme to use for this site implemented as a template base directory. It's possible to overwrite this setting for each blog.If you want to use a custom theme, you have to create a new directory in your template directory named cast/<your-theme-name>/ and put all required templates in there.", | ||
max_length=128, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.0 on 2023-12-23 08:13 | ||
|
||
import cast.blocks | ||
import wagtail.blocks | ||
import wagtail.embeds.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('cast', '0052_alter_blog_template_base_dir_alter_post_body_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='post', | ||
name='body', | ||
field=wagtail.fields.StreamField([('overview', wagtail.blocks.StreamBlock([('heading', wagtail.blocks.CharBlock(form_classname='full title')), ('paragraph', wagtail.blocks.RichTextBlock()), ('code', wagtail.blocks.StructBlock([('language', wagtail.blocks.CharBlock(help_text='The language of the code block')), ('source', wagtail.blocks.TextBlock(help_text='The source code of the block', rows=8))], icon='code')), ('image', cast.blocks.CastImageChooserBlock(template='cast/image/image.html')), ('gallery', wagtail.blocks.StructBlock([('gallery', cast.blocks.GalleryBlock(wagtail.images.blocks.ImageChooserBlock())), ('layout', wagtail.blocks.ChoiceBlock(choices=[('default', 'Web Component with Modal'), ('htmx', 'HTMX based layout')]))])), ('embed', wagtail.embeds.blocks.EmbedBlock()), ('video', cast.blocks.VideoChooserBlock(icon='media', template='cast/video/video.html')), ('audio', cast.blocks.AudioChooserBlock(icon='media', template='cast/audio/audio.html'))])), ('detail', wagtail.blocks.StreamBlock([('heading', wagtail.blocks.CharBlock(form_classname='full title')), ('paragraph', wagtail.blocks.RichTextBlock()), ('code', wagtail.blocks.StructBlock([('language', wagtail.blocks.CharBlock(help_text='The language of the code block')), ('source', wagtail.blocks.TextBlock(help_text='The source code of the block', rows=8))], icon='code')), ('image', cast.blocks.CastImageChooserBlock(template='cast/image/image.html')), ('gallery', wagtail.blocks.StructBlock([('gallery', cast.blocks.GalleryBlock(wagtail.images.blocks.ImageChooserBlock())), ('layout', wagtail.blocks.ChoiceBlock(choices=[('default', 'Web Component with Modal'), ('htmx', 'HTMX based layout')]))])), ('embed', wagtail.embeds.blocks.EmbedBlock()), ('video', cast.blocks.VideoChooserBlock(icon='media', template='cast/video/video.html')), ('audio', cast.blocks.AudioChooserBlock(icon='media', template='cast/audio/audio.html'))]))], use_json_field=True), | ||
), | ||
] |
Oops, something went wrong.