make a common stream field, support all block types everywhere
This commit is contained in:
@ -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"),
|
||||
|
Reference in New Issue
Block a user