add lead and body to /lokaler
This commit is contained in:
@ -1,16 +1,34 @@
|
||||
from django.db import models
|
||||
from grapple.models import GraphQLBoolean, GraphQLImage, GraphQLStreamfield, GraphQLString
|
||||
from grapple.helpers import register_singular_query_field
|
||||
from grapple.models import (
|
||||
GraphQLBoolean,
|
||||
GraphQLImage,
|
||||
GraphQLRichText,
|
||||
GraphQLStreamfield,
|
||||
GraphQLString,
|
||||
)
|
||||
from wagtail.admin.panels import FieldPanel, FieldRowPanel, MultiFieldPanel
|
||||
from wagtail.fields import RichTextField
|
||||
from wagtail.models import Page
|
||||
|
||||
from dnscms.fields import CommonStreamField
|
||||
|
||||
|
||||
@register_singular_query_field("venueIndex")
|
||||
class VenueIndex(Page):
|
||||
# there can only be one venue index page
|
||||
max_count = 1
|
||||
subpage_types = ["venues.VenuePage"]
|
||||
graphql_fields = []
|
||||
|
||||
lead = RichTextField(features=["bold", "italic", "link"], blank=True)
|
||||
body = CommonStreamField
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel("lead", heading="Ingress"),
|
||||
FieldPanel("body", heading="Innhold"),
|
||||
]
|
||||
|
||||
graphql_fields = [GraphQLRichText("lead"), GraphQLStreamfield("body")]
|
||||
|
||||
|
||||
class VenuePage(Page):
|
||||
|
Reference in New Issue
Block a user