make a common stream field, support all block types everywhere

This commit is contained in:
2024-05-20 22:42:30 +02:00
parent e88aa5e142
commit a7e83a3163
11 changed files with 117 additions and 61 deletions

View File

@ -1,23 +1,15 @@
from grapple.models import GraphQLStreamfield
from wagtail import blocks
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from wagtail.models import Page
from dnscms.blocks import ImageSliderBlock, ImageWithTextBlock
from dnscms.fields import CommonStreamField
class GenericPage(Page):
subpage_types = ["generic.GenericPage"]
show_in_menus = True
body = StreamField(
[
("paragraph", blocks.RichTextBlock(label="Rik tekst")),
("image", ImageWithTextBlock(label="Bilde")),
("image_slider", ImageSliderBlock(label="Bildegalleri")),
]
)
body = CommonStreamField
content_panels = Page.content_panels + [
FieldPanel("body", heading="Innhold"),