add lead to events

This commit is contained in:
2024-08-09 03:49:31 +02:00
parent c48c79848a
commit 996b63911c
6 changed files with 39 additions and 7 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 5.0.7 on 2024-08-09 01:48
import wagtail.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0052_alter_eventpage_price_member_and_more'),
]
operations = [
migrations.AddField(
model_name='eventpage',
name='lead',
field=wagtail.fields.RichTextField(blank=True),
),
]

View File

@ -11,6 +11,7 @@ from grapple.models import (
GraphQLCollection,
GraphQLForeignKey,
GraphQLImage,
GraphQLRichText,
GraphQLStreamfield,
GraphQLString,
)
@ -25,6 +26,7 @@ from wagtail.admin.panels import (
MultipleChooserPanel,
TitleFieldPanel,
)
from wagtail.fields import RichTextField
from wagtail.models import Orderable, Page, PageManager, PageQuerySet
from wagtail.search import index
from wagtail.snippets.models import register_snippet
@ -256,6 +258,7 @@ class EventPage(WPImportedPageMixin, Page):
"La denne gjerne stå tom om du fikk plass til det meste i tittelen."
),
)
lead = RichTextField(features=["italic", "link"], blank=True)
body = CommonStreamField
categories = ParentalManyToManyField(
@ -325,6 +328,7 @@ class EventPage(WPImportedPageMixin, Page):
content_panels = Page.content_panels + [
FieldPanel("subtitle", heading="Undertittel"),
FieldPanel("featured_image"),
FieldPanel("lead", heading="Ingress"),
FieldPanel("body"),
FieldPanel("categories", widget=forms.CheckboxSelectMultiple),
MultiFieldPanel(
@ -362,6 +366,7 @@ class EventPage(WPImportedPageMixin, Page):
graphql_fields = [
GraphQLString("subtitle"),
GraphQLImage("featured_image"),
GraphQLRichText("lead"),
GraphQLStreamfield("body"),
GraphQLString("pig"),
GraphQLString("ticket_url"),