add 360 photosphere element support

This commit is contained in:
2026-04-15 23:43:47 +02:00
parent d0a886a4ae
commit 3dd2c056b8
9 changed files with 314 additions and 34 deletions
+20
View File
@@ -203,6 +203,25 @@ class AccordionBlock(blocks.StructBlock):
label = "Trekkspill"
@register_streamfield_block
class PhotoSphereBlock(blocks.StructBlock):
image = ImageChooserBlock(label="360°-bilde")
title = blocks.CharBlock(
max_length=512,
label="Bildetekst",
required=False,
)
graphql_fields = [
GraphQLImage("image", required=True),
GraphQLString("title", required=False),
]
class Meta:
icon = "globe"
label = "360°-bilde"
@register_streamfield_block
class FactBoxBlock(blocks.StructBlock):
background_color = blocks.ChoiceBlock(
@@ -234,6 +253,7 @@ BASE_BLOCKS = [
("page_section_navigation", PageSectionNavigationBlock()),
("accordion", AccordionBlock()),
("fact_box", FactBoxBlock()),
("photo_sphere", PhotoSphereBlock()),
("embed", EmbedBlock()),
("raw_html", blocks.RawHTMLBlock()),
]