simplify fact box types
This commit is contained in:
+5
-13
@@ -2,6 +2,7 @@ from grapple.helpers import register_streamfield_block
|
||||
from grapple.models import (
|
||||
GraphQLImage,
|
||||
GraphQLPage,
|
||||
GraphQLRichText,
|
||||
GraphQLStreamfield,
|
||||
GraphQLString,
|
||||
)
|
||||
@@ -203,27 +204,18 @@ class AccordionBlock(blocks.StructBlock):
|
||||
|
||||
@register_streamfield_block
|
||||
class FactBoxBlock(blocks.StructBlock):
|
||||
heading = blocks.CharBlock(max_length=64, required=True, label="Overskrift")
|
||||
background_color = blocks.ChoiceBlock(
|
||||
label="Bakgrunnsfarge",
|
||||
required=False,
|
||||
choices=BACKGROUND_COLOR_CHOICES,
|
||||
)
|
||||
body = blocks.StreamBlock(
|
||||
[
|
||||
(
|
||||
"paragraph",
|
||||
blocks.RichTextBlock(
|
||||
features=["bold", "italic", "link", "ol", "ul", "h2", "h3", "h4", "h5", "h6"],
|
||||
label="Tekst",
|
||||
),
|
||||
),
|
||||
]
|
||||
body = blocks.RichTextBlock(
|
||||
features=["bold", "italic", "link", "ol", "ul", "h2", "h3"],
|
||||
label="Innhold",
|
||||
)
|
||||
|
||||
graphql_fields = [
|
||||
GraphQLString("heading", required=True),
|
||||
GraphQLStreamfield("body", required=True),
|
||||
GraphQLRichText("body", required=True),
|
||||
GraphQLString("background_color", required=False),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user