move featured events from settings to home page
This commit is contained in:
@ -23,10 +23,6 @@ from wagtail.admin.panels import (
|
||||
PageChooserPanel,
|
||||
TitleFieldPanel,
|
||||
)
|
||||
from wagtail.contrib.settings.models import (
|
||||
BaseSiteSetting,
|
||||
register_setting,
|
||||
)
|
||||
from wagtail.fields import StreamField
|
||||
from wagtail.images.blocks import ImageChooserBlock
|
||||
from wagtail.models import Orderable, Page
|
||||
@ -39,7 +35,6 @@ class EventIndex(Page):
|
||||
# there can only be one event index page
|
||||
max_count = 1
|
||||
subpage_types = ["events.EventPage"]
|
||||
graphql_fields = []
|
||||
|
||||
|
||||
@register_snippet
|
||||
@ -113,35 +108,6 @@ class EventOrganizer(ClusterableModel):
|
||||
return self.name
|
||||
|
||||
|
||||
@register_setting
|
||||
# @register_query_field("eventPromoSettings")
|
||||
class EventPromoSettings(ClusterableModel, BaseSiteSetting):
|
||||
panels = [InlinePanel("featured_events", heading="Fremhevede arrangementer")]
|
||||
|
||||
graphql_fields = [
|
||||
GraphQLCollection(
|
||||
GraphQLForeignKey,
|
||||
"featured_events",
|
||||
"events.EventPage",
|
||||
source="featured_events.event",
|
||||
required=True,
|
||||
item_required=True,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class FeaturedEventsOrderable(ClusterableModel):
|
||||
event_promo_settings = ParentalKey("events.EventPromoSettings", related_name="featured_events")
|
||||
event = models.ForeignKey(
|
||||
"events.EventPage",
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
|
||||
panels = [
|
||||
PageChooserPanel("event", "events.EventPage"),
|
||||
]
|
||||
|
||||
|
||||
class EventPage(Page):
|
||||
# no children
|
||||
subpage_types = []
|
||||
|
Reference in New Issue
Block a user