add image carousel to venues
This commit is contained in:
@ -8,11 +8,12 @@ from grapple.models import (
|
||||
GraphQLString,
|
||||
)
|
||||
from wagtail.admin.panels import FieldPanel, FieldRowPanel, MultiFieldPanel
|
||||
from wagtail.fields import RichTextField
|
||||
from wagtail.fields import RichTextField, StreamField
|
||||
from wagtail.models import Page
|
||||
from wagtail.search import index
|
||||
from wagtail_wordpress_import.models import WPImportedPageMixin
|
||||
|
||||
from dnscms.blocks import ImageSliderBlock
|
||||
from dnscms.fields import CommonStreamField
|
||||
|
||||
|
||||
@ -63,7 +64,22 @@ class VenuePage(WPImportedPageMixin, Page):
|
||||
blank=True,
|
||||
on_delete=models.SET_NULL,
|
||||
related_name="+",
|
||||
help_text=("Bilde av lokalet"),
|
||||
help_text=(
|
||||
"Bilde av lokalet som brukes i oversiktvisninger. "
|
||||
"Blir ikke automatisk med i bildekarusellen."
|
||||
),
|
||||
)
|
||||
|
||||
images = StreamField(
|
||||
[
|
||||
("image_slider", ImageSliderBlock()),
|
||||
],
|
||||
block_counts={"image_slider": {"max_num": 1}},
|
||||
blank=True,
|
||||
help_text=(
|
||||
"Bilder som vises i bildekarusellen når man leser mer om lokalet. "
|
||||
"Inkluderer ikke automatisk bildet over."
|
||||
),
|
||||
)
|
||||
|
||||
body = CommonStreamField
|
||||
@ -117,7 +133,8 @@ class VenuePage(WPImportedPageMixin, Page):
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel("featured_image"),
|
||||
FieldPanel("body"),
|
||||
FieldPanel("images", heading="Bilder"),
|
||||
FieldPanel("body", heading="Innhold"),
|
||||
FieldPanel("floor", heading="Etasje"),
|
||||
FieldPanel("preposition", heading="Preposisjon"),
|
||||
FieldPanel("show_as_bookable", heading="Vis på utleieside"),
|
||||
@ -135,6 +152,7 @@ class VenuePage(WPImportedPageMixin, Page):
|
||||
|
||||
graphql_fields = [
|
||||
GraphQLImage("featured_image"),
|
||||
GraphQLStreamfield("images"),
|
||||
GraphQLStreamfield("body"),
|
||||
GraphQLString("floor"),
|
||||
GraphQLString("preposition"),
|
||||
|
Reference in New Issue
Block a user