add lead and body to /lokaler

This commit is contained in:
2024-07-14 17:58:33 +02:00
parent fb95bb9694
commit b81bee1140
12 changed files with 379 additions and 17 deletions

View File

@ -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):