Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout des blocs accordéons et étapier au multi-colonnes et au fonds pleine largeur #217

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions content_manager/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ class AccordionsBlock(blocks.StreamBlock):
title = blocks.CharBlock(label=_("Title"))
accordion = AccordionBlock(label=_("Accordion"), min_num=1, max_num=15)

class Meta:
template = "content_manager/blocks/accordions.html"


class AlertBlock(blocks.StructBlock):
title = blocks.CharBlock(label=_("Message title"), required=False)
Expand Down Expand Up @@ -623,10 +626,13 @@ class StepsListBlock(blocks.StreamBlock):

class StepperBlock(blocks.StructBlock):
title = blocks.CharBlock(label=_("Title"))
total = blocks.IntegerBlock(label=_("Number of steps"))
current = blocks.IntegerBlock(label=_("Current step"))
total = blocks.IntegerBlock(label=_("Number of steps"), min_value=1, max_value=8)
current = blocks.IntegerBlock(label=_("Current step"), min_value=1, max_value=8)
steps = StepsListBlock(label=_("Steps"))

class Meta:
template = "content_manager/blocks/stepper.html"


class TextAndCTA(blocks.StructBlock):
text = blocks.RichTextBlock(label=_("Rich text"), required=False)
Expand Down Expand Up @@ -843,9 +849,11 @@ class CommonStreamBlock(blocks.StreamBlock):
image = ImageBlock(label=_("Image"))
video = VideoBlock(label=_("Video"))
transcription = TranscriptionBlock(label=_("Transcription"))
accordions = AccordionsBlock(label=_("Accordions"), group=_("DSFR components"))
callout = CalloutBlock(label=_("Callout"), group=_("DSFR components"))
highlight = HighlightBlock(label=_("Highlight"), group=_("DSFR components"))
quote = QuoteBlock(label=_("Quote"), group=_("DSFR components"))
stepper = StepperBlock(label=_("Stepper"), group=_("DSFR components"))
text_cta = TextAndCTA(label=_("Text and call to action"))
link = SingleLinkBlock(label=_("Single link"))
iframe = IframeBlock(label=_("Iframe"), group=_("DSFR components"))
Expand Down Expand Up @@ -1012,6 +1020,7 @@ class Meta:
("image", ImageBlock()),
("imageandtext", ImageAndTextBlock(label=_("Image and text"))),
("alert", AlertBlock(label=_("Alert message"))),
("accordions", AccordionsBlock(label=_("Accordions"), group=_("DSFR components"))),
("callout", CalloutBlock(label=_("Callout"), group=_("DSFR components"))),
("highlight", HighlightBlock(label=_("Highlight"), group=_("DSFR components"))),
("quote", QuoteBlock(label=_("Quote"), group=_("DSFR components"))),
Expand All @@ -1020,11 +1029,10 @@ class Meta:
("badges_list", BadgesListBlock(label=_("Badge list"))),
("tags_list", TagListBlock(label=_("Tag list"))),
("link", SingleLinkBlock(label=_("Single link"))),
("stepper", StepperBlock(label=_("Stepper"), group=_("DSFR components"))),
("card", HorizontalCardBlock(label=_("Horizontal card"), group=_("DSFR components"))),
("tile", TileBlock(label=_("Tile"), group=_("DSFR components"))),
("accordions", AccordionsBlock(label=_("Accordions"), group=_("DSFR components"))),
("tabs", TabsBlock(label=_("Tabs"), group=_("DSFR components"))),
("stepper", StepperBlock(label=_("Stepper"), group=_("DSFR components"))),
("markdown", MarkdownBlock(label=_("Markdown"), group=_("Expert syntax"))),
("iframe", IframeBlock(label=_("Iframe"), group=_("Expert syntax"))),
("separator", SeparatorBlock(label=_("Separator"), group=_("Page structure"))),
Expand Down
Loading
Loading