diff --git a/blog/migrations/0014_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py b/blog/migrations/0014_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py new file mode 100644 index 00000000..1873a9fe --- /dev/null +++ b/blog/migrations/0014_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py @@ -0,0 +1,16081 @@ +# Generated by Django 5.0.6 on 2024-06-04 12:08 + +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations + +import content_manager.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("blog", "0013_alter_blogentrypage_body_alter_blogindexpage_body_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="blogentrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", required=False + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ] + ), + ), + ( + "imageandtext", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], label="Image width" + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "alert", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Message title", required=False)), + ("description", wagtail.blocks.TextBlock(label="Message text", required=False)), + ( + "level", + wagtail.blocks.ChoiceBlock( + choices=[ + ("error", "Error"), + ("success", "Success"), + ("info", "Information"), + ("warning", "Warning"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + group="DSFR components", + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name", required=False)), + ("author_title", wagtail.blocks.CharBlock(label="Author title", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Video title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Transcription", label="Title", required=False), + ), + ( + "content", + wagtail.blocks.RichTextBlock(label="Transcription content", required=False), + ), + ], + label="Transcription", + ), + ), + ( + "badges_list", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.CharBlock(label="Badge label", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock(label="Hide badge icon", required=False), + ), + ], + label="Badge", + ), + ) + ], + label="Badge list", + ), + ), + ( + "tags_list", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock(label="Small tag", required=False), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ("fr-icon-arrow-right-line fr-link--icon-right", "Icon on the right side"), + ("fr-icon-arrow-right-line fr-link--icon-left", "Icon on the left side"), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-link--sm", "Small"), ("", "Medium"), ("fr-link--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock(label="Top detail: text", required=False), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock(label="Top detail: icon", required=False), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", label="Image", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ("is_small", wagtail.blocks.BooleanBlock(label="Small tile", required=False)), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Tile with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Tile without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Tile without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Tile with a shadow", required=False)), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock(label="Horizontal tile", required=False), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "accordions", + wagtail.blocks.StreamBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("content", wagtail.blocks.RichTextBlock(label="Content")), + ], + label="Accordion", + max_num=15, + min_num=1, + ), + ), + ], + group="DSFR components", + label="Accordions", + ), + ), + ( + "stepper", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("total", wagtail.blocks.IntegerBlock(label="Number of steps")), + ("current", wagtail.blocks.IntegerBlock(label="Current step")), + ( + "steps", + wagtail.blocks.StreamBlock( + [ + ( + "step", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("detail", wagtail.blocks.TextBlock(label="Detail")), + ], + label="Step", + ), + ) + ], + label="Steps", + ), + ), + ], + group="DSFR components", + label="Stepper", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(group="Expert syntax", label="Markdown")), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ("height", wagtail.blocks.IntegerBlock(label="Height (in pixels)")), + ], + label="Iframe", + ), + ), + ( + "separator", + wagtail.blocks.StructBlock( + [ + ( + "top_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Top margin", max_value=15, min_value=0 + ), + ), + ( + "bottom_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Bottom margin", max_value=15, min_value=0 + ), + ), + ], + group="Page structure", + label="Separator", + ), + ), + ( + "multicolumns", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "bg_color", + wagtail.blocks.RegexBlock( + error_messages={"invalid": "Incorrect color format, must be #fff or #f5f5f5"}, + help_text="This field is obsolete and will be removed in the near future. Replace it with the background color.", + label="Background color, hexadecimal format (obsolete)", + regex="^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 2.", + label="Heading level", + required=False, + ), + ), + ( + "columns", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ( + "column", + wagtail.blocks.StructBlock( + [ + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("3", "3/12"), + ("4", "4/12"), + ("5", "5/12"), + ("6", "6/12"), + ("7", "7/12"), + ("8", "8/12"), + ("9", "9/12"), + ], + help_text="The total width of all columns should be 12.", + label="Column width", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text" + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title", required=False + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image" + ), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + label="Link", required=False + ), + ), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "quote", + wagtail.blocks.CharBlock( + label="Quote" + ), + ), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", + required=False, + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ("green-menthe", "Menthe"), + ( + "green-archipel", + "Archipel", + ), + ("blue-ecume", "Écume"), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + label="Link", required=False + ), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock( + label="Height (in pixels)" + ), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", + required=False, + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", + required=False, + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", + required=False, + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", + required=False, + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", + required=False, + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ], + label="Column content", + ), + ), + ], + group="Page structure", + label="Adjustable column", + ), + ), + ], + label="Columns", + ), + ), + ], + group="Page structure", + label="Multiple columns", + ), + ), + ( + "fullwidthbackground", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "image_and_text", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], + label="Image width", + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + group="Expert syntax", + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="blogindexpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", required=False + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ] + ), + ), + ( + "imageandtext", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], label="Image width" + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "alert", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Message title", required=False)), + ("description", wagtail.blocks.TextBlock(label="Message text", required=False)), + ( + "level", + wagtail.blocks.ChoiceBlock( + choices=[ + ("error", "Error"), + ("success", "Success"), + ("info", "Information"), + ("warning", "Warning"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + group="DSFR components", + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name", required=False)), + ("author_title", wagtail.blocks.CharBlock(label="Author title", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Video title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Transcription", label="Title", required=False), + ), + ( + "content", + wagtail.blocks.RichTextBlock(label="Transcription content", required=False), + ), + ], + label="Transcription", + ), + ), + ( + "badges_list", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.CharBlock(label="Badge label", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock(label="Hide badge icon", required=False), + ), + ], + label="Badge", + ), + ) + ], + label="Badge list", + ), + ), + ( + "tags_list", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock(label="Small tag", required=False), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ("fr-icon-arrow-right-line fr-link--icon-right", "Icon on the right side"), + ("fr-icon-arrow-right-line fr-link--icon-left", "Icon on the left side"), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-link--sm", "Small"), ("", "Medium"), ("fr-link--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock(label="Top detail: text", required=False), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock(label="Top detail: icon", required=False), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", label="Image", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ("is_small", wagtail.blocks.BooleanBlock(label="Small tile", required=False)), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Tile with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Tile without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Tile without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Tile with a shadow", required=False)), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock(label="Horizontal tile", required=False), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "accordions", + wagtail.blocks.StreamBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("content", wagtail.blocks.RichTextBlock(label="Content")), + ], + label="Accordion", + max_num=15, + min_num=1, + ), + ), + ], + group="DSFR components", + label="Accordions", + ), + ), + ( + "stepper", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("total", wagtail.blocks.IntegerBlock(label="Number of steps")), + ("current", wagtail.blocks.IntegerBlock(label="Current step")), + ( + "steps", + wagtail.blocks.StreamBlock( + [ + ( + "step", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("detail", wagtail.blocks.TextBlock(label="Detail")), + ], + label="Step", + ), + ) + ], + label="Steps", + ), + ), + ], + group="DSFR components", + label="Stepper", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(group="Expert syntax", label="Markdown")), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ("height", wagtail.blocks.IntegerBlock(label="Height (in pixels)")), + ], + label="Iframe", + ), + ), + ( + "separator", + wagtail.blocks.StructBlock( + [ + ( + "top_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Top margin", max_value=15, min_value=0 + ), + ), + ( + "bottom_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Bottom margin", max_value=15, min_value=0 + ), + ), + ], + group="Page structure", + label="Separator", + ), + ), + ( + "multicolumns", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "bg_color", + wagtail.blocks.RegexBlock( + error_messages={"invalid": "Incorrect color format, must be #fff or #f5f5f5"}, + help_text="This field is obsolete and will be removed in the near future. Replace it with the background color.", + label="Background color, hexadecimal format (obsolete)", + regex="^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 2.", + label="Heading level", + required=False, + ), + ), + ( + "columns", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ( + "column", + wagtail.blocks.StructBlock( + [ + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("3", "3/12"), + ("4", "4/12"), + ("5", "5/12"), + ("6", "6/12"), + ("7", "7/12"), + ("8", "8/12"), + ("9", "9/12"), + ], + help_text="The total width of all columns should be 12.", + label="Column width", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text" + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title", required=False + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image" + ), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + label="Link", required=False + ), + ), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "quote", + wagtail.blocks.CharBlock( + label="Quote" + ), + ), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", + required=False, + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ("green-menthe", "Menthe"), + ( + "green-archipel", + "Archipel", + ), + ("blue-ecume", "Écume"), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + label="Link", required=False + ), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock( + label="Height (in pixels)" + ), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", + required=False, + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", + required=False, + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", + required=False, + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", + required=False, + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", + required=False, + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ], + label="Column content", + ), + ), + ], + group="Page structure", + label="Adjustable column", + ), + ), + ], + label="Columns", + ), + ), + ], + group="Page structure", + label="Multiple columns", + ), + ), + ( + "fullwidthbackground", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "image_and_text", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], + label="Image width", + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + group="Expert syntax", + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="category", + name="colophon", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "imageandtext", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], label="Image width" + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Bloc image et texte", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name", required=False)), + ("author_title", wagtail.blocks.CharBlock(label="Author title", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + label="Citation", + ), + ), + ( + "multicolumns", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "bg_color", + wagtail.blocks.RegexBlock( + error_messages={"invalid": "Incorrect color format, must be #fff or #f5f5f5"}, + help_text="This field is obsolete and will be removed in the near future. Replace it with the background color.", + label="Background color, hexadecimal format (obsolete)", + regex="^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 2.", + label="Heading level", + required=False, + ), + ), + ( + "columns", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ( + "column", + wagtail.blocks.StructBlock( + [ + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("3", "3/12"), + ("4", "4/12"), + ("5", "5/12"), + ("6", "6/12"), + ("7", "7/12"), + ("8", "8/12"), + ("9", "9/12"), + ], + help_text="The total width of all columns should be 12.", + label="Column width", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text" + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title", required=False + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image" + ), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + label="Link", required=False + ), + ), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "quote", + wagtail.blocks.CharBlock( + label="Quote" + ), + ), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", + required=False, + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ("green-menthe", "Menthe"), + ( + "green-archipel", + "Archipel", + ), + ("blue-ecume", "Écume"), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + label="Link", required=False + ), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock( + label="Height (in pixels)" + ), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", + required=False, + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", + required=False, + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", + required=False, + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", + required=False, + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", + required=False, + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ], + label="Column content", + ), + ), + ], + group="Page structure", + label="Adjustable column", + ), + ), + ], + label="Columns", + ), + ), + ], + label="Multi-colonnes", + ), + ), + ( + "contact_card", + wagtail.blocks.StructBlock( + [ + ("name", wagtail.blocks.CharBlock(label="Name", max_length=255)), + ("role", wagtail.blocks.CharBlock(label="Role", max_length=255)), + ("organization", wagtail.blocks.CharBlock(label="Organization", max_length=255)), + ( + "contact_info", + wagtail.blocks.CharBlock(label="Contact info", max_length=500, required=False), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ], + label="Contact card", + ), + ), + ], + blank=True, + help_text="Text displayed at the end of every page in the category", + ), + ), + ] diff --git a/content_manager/blocks.py b/content_manager/blocks.py index e5578c82..6ed75a93 100644 --- a/content_manager/blocks.py +++ b/content_manager/blocks.py @@ -200,7 +200,7 @@ class Meta: template = "content_manager/blocks/tags_list.html" -## Cards +## Cards and tiles class CardstructValue(StructValue): def enlarge_link(self): """ @@ -213,7 +213,7 @@ def enlarge_link(self): url = self.get("url") document = self.get("document") top_detail_badges_tags = self.get("top_detail_badges_tags") - call_to_action = self.get("call_to_action") + call_to_action = self.get("call_to_action", "") if not ((link and link.url()) or url or document): return False @@ -353,6 +353,47 @@ class Meta: value_class = CardstructValue +class TileBlock(blocks.StructBlock): + title = blocks.CharBlock(label=_("Title")) + heading_tag = blocks.ChoiceBlock( + label=_("Heading level"), + choices=HEADING_CHOICES, + default="h3", + help_text=_("Adapt to the page layout. Defaults to heading 3."), + ) + description = blocks.TextBlock(label=_("Content"), help_text=_("Can contain HTML."), required=False) + image = ImageChooserBlock(label=_("Image"), help_text=_("Prefer SVG files."), required=False) + link = LinkWithoutLabelBlock( + label=_("Link"), + required=False, + ) + top_detail_badges_tags = blocks.StreamBlock( + [ + ("badges", BadgesListBlock()), + ("tags", TagListBlock()), + ], + label=_("Top detail: badges or tags"), + max_num=1, + required=False, + ) + detail_text = blocks.CharBlock( + label=_("Detail text"), + required=False, + help_text=_("If the tile links to a downloadable document, the values are pre-filled."), + ) + is_small = blocks.BooleanBlock(label=_("Small tile"), required=False) + grey_background = blocks.BooleanBlock(label=_("Tile with grey background"), required=False) + no_background = blocks.BooleanBlock(label=_("Tile without background"), required=False) + no_border = blocks.BooleanBlock(label=_("Tile without border"), required=False) + shadow = blocks.BooleanBlock(label=_("Tile with a shadow"), required=False) + is_horizontal = blocks.BooleanBlock(label=_("Horizontal tile"), required=False) + + class Meta: + icon = "tablet-alt" + template = "content_manager/blocks/tile.html" + value_class = CardstructValue + + ## Basic blocks class AccordionBlock(blocks.StructBlock): title = blocks.CharBlock(label=_("Title")) @@ -593,17 +634,18 @@ class CommonStreamBlock(blocks.StreamBlock): image = ImageBlock(label=_("Image")) video = VideoBlock(label=_("Video")) transcription = TranscriptionBlock(label=_("Transcription")) - quote = QuoteBlock(label=_("Quote")) + quote = QuoteBlock(label=_("Quote"), group=_("DSFR components")) text_cta = TextAndCTA(label=_("Text and call to action")) link = SingleLinkBlock(label=_("Single link")) - iframe = IframeBlock(label=_("Iframe")) + iframe = IframeBlock(label=_("Iframe"), group=_("DSFR components")) + tile = TileBlock(label=_("Tile"), group=_("DSFR components")) class Meta: icon = "dots-horizontal" class ColumnBlock(CommonStreamBlock): - card = VerticalCardBlock(label=_("Vertical card")) + card = VerticalCardBlock(label=_("Vertical card"), group=_("DSFR components")) class AdjustableColumnBlock(blocks.StructBlock): @@ -628,7 +670,7 @@ class Meta: class MultiColumnsBlock(CommonStreamBlock): - card = VerticalCardBlock(label=_("Vertical card")) + card = VerticalCardBlock(label=_("Vertical card"), group=_("DSFR components")) column = AdjustableColumnBlock(label=_("Adjustable column"), group=_("Page structure")) class Meta: @@ -668,7 +710,7 @@ class Meta: class FullWidthBlock(CommonStreamBlock): image_and_text = ImageAndTextBlock(label=_("Image and text")) - card = HorizontalCardBlock(label=_("Horizontal card")) + card = HorizontalCardBlock(label=_("Horizontal card"), group=_("DSFR components")) class Meta: icon = "minus" @@ -701,6 +743,7 @@ class Meta: ("tags_list", TagListBlock(label=_("Tag list"))), ("link", SingleLinkBlock(label=_("Single link"))), ("card", HorizontalCardBlock(label=_("Horizontal card"), group=_("DSFR components"))), + ("tile", TileBlock(label=_("Tile"), group=_("DSFR components"))), ("accordions", AccordionsBlock(label=_("Accordions"), group=_("DSFR components"))), ("stepper", StepperBlock(label=_("Stepper"), group=_("DSFR components"))), ("markdown", MarkdownBlock(label=_("Markdown"), group=_("Expert syntax"))), diff --git a/content_manager/locale/fr/LC_MESSAGES/django.mo b/content_manager/locale/fr/LC_MESSAGES/django.mo index 4171c021..ef3f1e6d 100644 Binary files a/content_manager/locale/fr/LC_MESSAGES/django.mo and b/content_manager/locale/fr/LC_MESSAGES/django.mo differ diff --git a/content_manager/locale/fr/LC_MESSAGES/django.po b/content_manager/locale/fr/LC_MESSAGES/django.po index dcc9bee3..8f6683f5 100644 --- a/content_manager/locale/fr/LC_MESSAGES/django.po +++ b/content_manager/locale/fr/LC_MESSAGES/django.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-06-03 11:59+0200\n" -"PO-Revision-Date: 2024-06-03 12:01+0200\n" +"POT-Creation-Date: 2024-06-04 12:22+0200\n" +"PO-Revision-Date: 2024-06-04 12:23+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -26,13 +26,13 @@ msgstr "Afficher le titre sur l’image d’en-tête ?" msgid "Header image" msgstr "Image d’en-tête" -#: content_manager/abstract.py:37 content_manager/blocks.py:641 -#: content_manager/blocks.py:680 +#: content_manager/abstract.py:37 content_manager/blocks.py:682 +#: content_manager/blocks.py:721 msgid "Background color" msgstr "Couleur de fond" -#: content_manager/abstract.py:41 content_manager/blocks.py:643 -#: content_manager/blocks.py:682 +#: content_manager/abstract.py:41 content_manager/blocks.py:684 +#: content_manager/blocks.py:723 msgid "Uses the French Design System colors" msgstr "Utilise les couleurs du système de design de l'État" @@ -48,7 +48,7 @@ msgstr "Assombrir l’image de fond" msgid "Call to action text" msgstr "Texte de l’appel à action" -#: content_manager/abstract.py:54 content_manager/blocks.py:539 +#: content_manager/abstract.py:54 content_manager/blocks.py:580 msgid "Call to action label" msgstr "Libellé de l’appel à action" @@ -109,8 +109,8 @@ msgid "Link label" msgstr "Libellé du lien" #: content_manager/blocks.py:81 content_manager/blocks.py:270 -#: content_manager/blocks.py:431 content_manager/blocks.py:492 -#: content_manager/blocks.py:543 +#: content_manager/blocks.py:367 content_manager/blocks.py:472 +#: content_manager/blocks.py:533 content_manager/blocks.py:584 msgid "Link" msgstr "Lien" @@ -167,11 +167,11 @@ msgid "Badge" msgstr "Badge" #: content_manager/blocks.py:180 content_manager/blocks.py:251 -#: content_manager/blocks.py:358 content_manager/blocks.py:363 -#: content_manager/blocks.py:396 content_manager/blocks.py:466 -#: content_manager/blocks.py:521 content_manager/blocks.py:530 -#: content_manager/blocks.py:551 content_manager/blocks.py:654 -#: content_manager/models.py:275 +#: content_manager/blocks.py:357 content_manager/blocks.py:399 +#: content_manager/blocks.py:404 content_manager/blocks.py:437 +#: content_manager/blocks.py:507 content_manager/blocks.py:562 +#: content_manager/blocks.py:571 content_manager/blocks.py:592 +#: content_manager/blocks.py:695 content_manager/models.py:275 msgid "Title" msgstr "Titre" @@ -192,34 +192,35 @@ msgctxt "DSFR Tag" msgid "Tag" msgstr "Tag" -#: content_manager/blocks.py:253 content_manager/blocks.py:372 -#: content_manager/blocks.py:387 content_manager/blocks.py:468 -#: content_manager/blocks.py:656 +#: content_manager/blocks.py:253 content_manager/blocks.py:359 +#: content_manager/blocks.py:413 content_manager/blocks.py:428 +#: content_manager/blocks.py:509 content_manager/blocks.py:697 msgid "Heading level" msgstr "Niveau de titre" -#: content_manager/blocks.py:256 content_manager/blocks.py:375 -#: content_manager/blocks.py:390 content_manager/blocks.py:472 +#: content_manager/blocks.py:256 content_manager/blocks.py:362 +#: content_manager/blocks.py:416 content_manager/blocks.py:431 +#: content_manager/blocks.py:513 msgid "Adapt to the page layout. Defaults to heading 3." msgstr "À adapter à la structure de la page. Par défaut en-tête 3." -#: content_manager/blocks.py:258 content_manager/blocks.py:359 -#: content_manager/blocks.py:684 +#: content_manager/blocks.py:258 content_manager/blocks.py:364 +#: content_manager/blocks.py:400 content_manager/blocks.py:725 msgid "Content" msgstr "Contenu" -#: content_manager/blocks.py:258 +#: content_manager/blocks.py:258 content_manager/blocks.py:364 msgid "Can contain HTML." msgstr "Peut contenir du HTML." -#: content_manager/blocks.py:259 content_manager/blocks.py:411 -#: content_manager/blocks.py:474 content_manager/blocks.py:500 -#: content_manager/blocks.py:593 +#: content_manager/blocks.py:259 content_manager/blocks.py:365 +#: content_manager/blocks.py:452 content_manager/blocks.py:515 +#: content_manager/blocks.py:541 content_manager/blocks.py:634 msgid "Image" msgstr "Image" #: content_manager/blocks.py:261 content_manager/blocks.py:329 -#: content_manager/blocks.py:486 +#: content_manager/blocks.py:527 msgid "Image ratio" msgstr "Ratio de l’image" @@ -236,8 +237,8 @@ msgid "Link (obsolete)" msgstr "Lien (obsolète)" #: content_manager/blocks.py:278 content_manager/blocks.py:286 -#: content_manager/blocks.py:439 content_manager/blocks.py:447 -#: content_manager/blocks.py:455 +#: content_manager/blocks.py:480 content_manager/blocks.py:488 +#: content_manager/blocks.py:496 msgid "" "This field is obsolete and will be removed in the near future. Please " "replace with the Link field above." @@ -257,7 +258,7 @@ msgstr "Détail du haut : texte" msgid "Top detail: icon" msgstr "Détail du haut : icône" -#: content_manager/blocks.py:296 +#: content_manager/blocks.py:296 content_manager/blocks.py:375 msgid "Top detail: badges or tags" msgstr "Détail du haut : badges ou tags" @@ -305,31 +306,70 @@ msgstr "" "Incompatible avec l’appel à action en bas de carte. Si la carte pointe vers " "un document téléchargeable, les valeurs sont pré-remplies." -#: content_manager/blocks.py:364 +#: content_manager/blocks.py:365 +msgid "Prefer SVG files." +msgstr "Privilégier les fichiers SVG." + +#: content_manager/blocks.py:380 +msgid "Detail text" +msgstr "Texte de détail" + +#: content_manager/blocks.py:382 +msgid "" +"If the tile links to a downloadable document, the values are pre-filled." +msgstr "" +"Si la tuile pointe vers un document téléchargeable, les valeurs sont pré-" +"remplies." + +#: content_manager/blocks.py:384 +msgid "Small tile" +msgstr "Petite tuile" + +#: content_manager/blocks.py:385 +msgid "Tile with grey background" +msgstr "Tuile avec arrière-plan gris" + +#: content_manager/blocks.py:386 +msgid "Tile without background" +msgstr "Tuile sans arrière-plan" + +#: content_manager/blocks.py:387 +msgid "Tile without border" +msgstr "Tuile sans bordure" + +#: content_manager/blocks.py:388 +msgid "Tile with a shadow" +msgstr "Tuile avec une ombre" + +#: content_manager/blocks.py:389 +msgid "Horizontal tile" +msgstr "Tuile horizontale" + +#: content_manager/blocks.py:405 msgid "Accordion" msgstr "Accordéon" -#: content_manager/blocks.py:368 +#: content_manager/blocks.py:409 msgid "Message title" msgstr "Titre du message" -#: content_manager/blocks.py:369 +#: content_manager/blocks.py:410 msgid "Message text" msgstr "Texte du message" -#: content_manager/blocks.py:370 +#: content_manager/blocks.py:411 msgid "Message type" msgstr "Type de message" -#: content_manager/blocks.py:384 +#: content_manager/blocks.py:425 msgid "Callout title" msgstr "Titre de l’appel à action" -#: content_manager/blocks.py:385 +#: content_manager/blocks.py:426 msgid "Callout text" msgstr "Texte de l’appel à action" -#: content_manager/blocks.py:397 +#: content_manager/blocks.py:438 msgid "" "Accessibility: The title should describe, in a clear and concise manner, the " "embedded content." @@ -337,129 +377,129 @@ msgstr "" "Accessibilité : Le titre doit décrire, de façon claire et concise, le " "contenu embarqué." -#: content_manager/blocks.py:400 +#: content_manager/blocks.py:441 msgid "URL of the iframe" msgstr "URL de l‘iframe" -#: content_manager/blocks.py:401 +#: content_manager/blocks.py:442 msgid "Example for Tally: https://tally.so/embed/w2jMRa" msgstr "Exemple pour Tally : https://tally.so/embed/w2jMRa" -#: content_manager/blocks.py:403 +#: content_manager/blocks.py:444 msgid "Height (in pixels)" msgstr "Hauteur (en pixels)" -#: content_manager/blocks.py:413 +#: content_manager/blocks.py:454 msgid "Side where the image is displayed" msgstr "Côté où afficher l’image" -#: content_manager/blocks.py:415 +#: content_manager/blocks.py:456 msgid "Left" msgstr "Gauche" -#: content_manager/blocks.py:416 +#: content_manager/blocks.py:457 msgid "Right" msgstr "Droite" -#: content_manager/blocks.py:421 +#: content_manager/blocks.py:462 msgid "Image width" msgstr "Largeur de l’image" -#: content_manager/blocks.py:429 content_manager/blocks.py:537 -#: content_manager/blocks.py:592 content_manager/blocks.py:692 +#: content_manager/blocks.py:470 content_manager/blocks.py:578 +#: content_manager/blocks.py:633 content_manager/blocks.py:733 msgid "Rich text" msgstr "Texte avec mise en forme" -#: content_manager/blocks.py:433 +#: content_manager/blocks.py:474 msgid "The link is shown at the bottom of the text block, with an arrow" msgstr "Le lien est affiché en bas du bloc de texte, avec une flèche" -#: content_manager/blocks.py:436 +#: content_manager/blocks.py:477 msgid "Link label (obsolete)" msgstr "Libellé du lien (obsolète)" -#: content_manager/blocks.py:444 +#: content_manager/blocks.py:485 msgid "Internal link (obsolete)" msgstr "Lien interne (obsolète)" -#: content_manager/blocks.py:452 +#: content_manager/blocks.py:493 msgid "Link URL (obsolete)" msgstr "URL du lien (obsolète)" -#: content_manager/blocks.py:476 +#: content_manager/blocks.py:517 msgid "Alternative text (textual description of the image)" msgstr "Alternative textuelle (description textuelle de l’image)" -#: content_manager/blocks.py:480 content_manager/blocks.py:572 +#: content_manager/blocks.py:521 content_manager/blocks.py:613 msgid "Witdh" msgstr "Largeur" -#: content_manager/blocks.py:491 content_manager/blocks.py:561 +#: content_manager/blocks.py:532 content_manager/blocks.py:602 msgid "Caption" msgstr "Légende" -#: content_manager/blocks.py:501 content_manager/blocks.py:596 -#: content_manager/blocks.py:697 +#: content_manager/blocks.py:542 content_manager/blocks.py:637 +#: content_manager/blocks.py:738 msgid "Quote" msgstr "Citation" -#: content_manager/blocks.py:502 +#: content_manager/blocks.py:543 msgid "Author name" msgstr "Nom de l’auteur" -#: content_manager/blocks.py:503 +#: content_manager/blocks.py:544 msgid "Author title" msgstr "Titre de l’auteur" -#: content_manager/blocks.py:505 +#: content_manager/blocks.py:546 msgid "Color" msgstr "Couleur" -#: content_manager/blocks.py:516 +#: content_manager/blocks.py:557 msgid "Top margin" msgstr "Espacement au dessus" -#: content_manager/blocks.py:517 +#: content_manager/blocks.py:558 msgid "Bottom margin" msgstr "Espacement en dessous" -#: content_manager/blocks.py:522 +#: content_manager/blocks.py:563 msgid "Detail" msgstr "Détail" -#: content_manager/blocks.py:526 +#: content_manager/blocks.py:567 msgid "Step" msgstr "Étape" -#: content_manager/blocks.py:531 +#: content_manager/blocks.py:572 msgid "Number of steps" msgstr "Nombre d’étapes" -#: content_manager/blocks.py:532 +#: content_manager/blocks.py:573 msgid "Current step" msgstr "Étape actuelle" -#: content_manager/blocks.py:533 +#: content_manager/blocks.py:574 msgid "Steps" msgstr "Étapes" -#: content_manager/blocks.py:540 +#: content_manager/blocks.py:581 msgid "The link appears as a button under the text block" msgstr "Le lien apparaît comme un bouton sous le bloc de texte" -#: content_manager/blocks.py:552 +#: content_manager/blocks.py:593 msgid "Transcription content" msgstr "Contenu de la transcription" -#: content_manager/blocks.py:560 +#: content_manager/blocks.py:601 msgid "Video title" msgstr "Titre de la vidéo" -#: content_manager/blocks.py:563 +#: content_manager/blocks.py:604 msgid "Video URL" msgstr "URL de la vidéo" -#: content_manager/blocks.py:565 +#: content_manager/blocks.py:606 msgid "" "Use embed format, with a version that doesn't require a consent banner if " "available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For " @@ -470,65 +510,65 @@ msgstr "" "nocookie.com/embed/gLzXOViPX-0) Pour Youtube, cliquez sur « Intégrer la " "vidéo » puis cochez « Activer le mode de confidentialité avancé »." -#: content_manager/blocks.py:578 +#: content_manager/blocks.py:619 msgid "Video ratio" msgstr "Ratio de la vidéo" -#: content_manager/blocks.py:583 content_manager/blocks.py:595 -#: content_manager/blocks.py:699 +#: content_manager/blocks.py:624 content_manager/blocks.py:636 +#: content_manager/blocks.py:740 msgid "Transcription" msgstr "Transcription" -#: content_manager/blocks.py:594 content_manager/blocks.py:698 +#: content_manager/blocks.py:635 content_manager/blocks.py:739 msgid "Video" msgstr "Vidéo" -#: content_manager/blocks.py:597 +#: content_manager/blocks.py:638 msgid "Text and call to action" msgstr "Texte et appel à action" -#: content_manager/blocks.py:598 content_manager/blocks.py:702 +#: content_manager/blocks.py:639 content_manager/blocks.py:743 msgid "Single link" msgstr "Lien isolé" -#: content_manager/blocks.py:599 content_manager/blocks.py:707 +#: content_manager/blocks.py:640 content_manager/blocks.py:749 msgid "Iframe" msgstr "Iframe" -#: content_manager/blocks.py:606 content_manager/blocks.py:631 +#: content_manager/blocks.py:647 content_manager/blocks.py:672 msgid "Vertical card" msgstr "Carte verticale" -#: content_manager/blocks.py:614 +#: content_manager/blocks.py:652 msgid "Column width" msgstr "Largeur de colonne" -#: content_manager/blocks.py:624 +#: content_manager/blocks.py:662 msgid "The total width of all columns should be 12." msgstr "La largeur totale de toutes les colonnes doit être 12." -#: content_manager/blocks.py:627 +#: content_manager/blocks.py:665 msgid "Column content" msgstr "Contenu de la colonnne" -#: content_manager/blocks.py:632 +#: content_manager/blocks.py:673 msgid "Adjustable column" msgstr "Colonne ajustable" -#: content_manager/blocks.py:632 content_manager/blocks.py:708 -#: content_manager/blocks.py:709 content_manager/blocks.py:710 +#: content_manager/blocks.py:673 content_manager/blocks.py:750 +#: content_manager/blocks.py:751 content_manager/blocks.py:752 msgid "Page structure" msgstr "Structure de la page" -#: content_manager/blocks.py:639 content_manager/blocks.py:678 +#: content_manager/blocks.py:680 content_manager/blocks.py:719 msgid "Background image" msgstr "Image de fond" -#: content_manager/blocks.py:646 +#: content_manager/blocks.py:687 msgid "Background color, hexadecimal format (obsolete)" msgstr "Couleur de fond, format hexadécimal (obsolète)" -#: content_manager/blocks.py:649 +#: content_manager/blocks.py:690 msgid "" "This field is obsolete and will be removed in the near future. Replace it " "with the background color." @@ -536,77 +576,81 @@ msgstr "" "Ce champ est obsolète et sera prochainement supprimé. Merci de le remplacer " "avec la couleur de fond." -#: content_manager/blocks.py:651 +#: content_manager/blocks.py:692 msgid "Incorrect color format, must be #fff or #f5f5f5" msgstr "Format de couleur incorrect, doit être #fff ou #f5f5f5" -#: content_manager/blocks.py:660 +#: content_manager/blocks.py:701 msgid "Adapt to the page layout. Defaults to heading 2." msgstr "À adapter à la structure de la page. Par défaut en-tête 2." -#: content_manager/blocks.py:662 +#: content_manager/blocks.py:703 msgid "Columns" msgstr "Colonnes" -#: content_manager/blocks.py:670 content_manager/blocks.py:694 +#: content_manager/blocks.py:711 content_manager/blocks.py:735 msgid "Image and text" msgstr "Image et texte" -#: content_manager/blocks.py:671 content_manager/blocks.py:703 +#: content_manager/blocks.py:712 content_manager/blocks.py:744 msgid "Horizontal card" msgstr "Carte horizontale" -#: content_manager/blocks.py:695 +#: content_manager/blocks.py:736 msgid "Alert message" msgstr "Message d’alerte" -#: content_manager/blocks.py:696 +#: content_manager/blocks.py:737 msgid "Callout" msgstr "Texte mis en avant" -#: content_manager/blocks.py:696 content_manager/blocks.py:697 -#: content_manager/blocks.py:703 content_manager/blocks.py:704 -#: content_manager/blocks.py:705 +#: content_manager/blocks.py:737 content_manager/blocks.py:738 +#: content_manager/blocks.py:744 content_manager/blocks.py:745 +#: content_manager/blocks.py:746 content_manager/blocks.py:747 msgid "DSFR components" msgstr "Composants du DSFR" -#: content_manager/blocks.py:700 +#: content_manager/blocks.py:741 msgid "Badge list" msgstr "Liste de badges" -#: content_manager/blocks.py:701 +#: content_manager/blocks.py:742 msgid "Tag list" msgstr "Liste de tags" -#: content_manager/blocks.py:704 +#: content_manager/blocks.py:745 +msgid "Tile" +msgstr "Tuile" + +#: content_manager/blocks.py:746 msgid "Accordions" msgstr "Accordéons" -#: content_manager/blocks.py:705 +#: content_manager/blocks.py:747 msgid "Stepper" msgstr "Étapier" -#: content_manager/blocks.py:706 +#: content_manager/blocks.py:748 msgid "Markdown" msgstr "Markdown" -#: content_manager/blocks.py:706 content_manager/blocks.py:726 +#: content_manager/blocks.py:748 content_manager/blocks.py:768 msgid "Expert syntax" msgstr "Syntaxe experte" -#: content_manager/blocks.py:708 +#: content_manager/blocks.py:750 msgid "Separator" msgstr "Séparateur" -#: content_manager/blocks.py:709 +#: content_manager/blocks.py:751 msgid "Multiple columns" msgstr "Multi-colonnes" -#: content_manager/blocks.py:710 +#: content_manager/blocks.py:752 msgid "Full width background" msgstr "Fond pleine largeur" -#: content_manager/blocks.py:724 +#: content_manager/blocks.py:766 msgid "" "Warning: Use HTML block with caution. Malicious code can compromise the " "security of the site." diff --git a/content_manager/migrations/0030_alter_contentpage_body.py b/content_manager/migrations/0030_alter_contentpage_body.py new file mode 100644 index 00000000..34f0e318 --- /dev/null +++ b/content_manager/migrations/0030_alter_contentpage_body.py @@ -0,0 +1,6359 @@ +# Generated by Django 5.0.6 on 2024-06-04 12:08 + +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations + +import content_manager.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("content_manager", "0029_alter_contentpage_body"), + ] + + operations = [ + migrations.AlterField( + model_name="contentpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", required=False + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ] + ), + ), + ( + "imageandtext", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], label="Image width" + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "alert", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Message title", required=False)), + ("description", wagtail.blocks.TextBlock(label="Message text", required=False)), + ( + "level", + wagtail.blocks.ChoiceBlock( + choices=[ + ("error", "Error"), + ("success", "Success"), + ("info", "Information"), + ("warning", "Warning"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + group="DSFR components", + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name", required=False)), + ("author_title", wagtail.blocks.CharBlock(label="Author title", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Video title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption", required=False)), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(default="Transcription", label="Title", required=False), + ), + ( + "content", + wagtail.blocks.RichTextBlock(label="Transcription content", required=False), + ), + ], + label="Transcription", + ), + ), + ( + "badges_list", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.CharBlock(label="Badge label", required=False)), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock(label="Hide badge icon", required=False), + ), + ], + label="Badge", + ), + ) + ], + label="Badge list", + ), + ), + ( + "tags_list", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock(label="Small tag", required=False), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", required=False)), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ("fr-icon-arrow-right-line fr-link--icon-right", "Icon on the right side"), + ("fr-icon-arrow-right-line fr-link--icon-left", "Icon on the left side"), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-link--sm", "Small"), ("", "Medium"), ("fr-link--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock(label="Top detail: text", required=False), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock(label="Top detail: icon", required=False), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", label="Image", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [("new", "New"), ("grey", "Grey")], + ), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ("label", wagtail.blocks.CharBlock(label="Title")), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ( + "orange-terre-battue", + "Terre battue", + ), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ("is_small", wagtail.blocks.BooleanBlock(label="Small tile", required=False)), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Tile with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Tile without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Tile without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Tile with a shadow", required=False)), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock(label="Horizontal tile", required=False), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "accordions", + wagtail.blocks.StreamBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "accordion", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("content", wagtail.blocks.RichTextBlock(label="Content")), + ], + label="Accordion", + max_num=15, + min_num=1, + ), + ), + ], + group="DSFR components", + label="Accordions", + ), + ), + ( + "stepper", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("total", wagtail.blocks.IntegerBlock(label="Number of steps")), + ("current", wagtail.blocks.IntegerBlock(label="Current step")), + ( + "steps", + wagtail.blocks.StreamBlock( + [ + ( + "step", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ("detail", wagtail.blocks.TextBlock(label="Detail")), + ], + label="Step", + ), + ) + ], + label="Steps", + ), + ), + ], + group="DSFR components", + label="Stepper", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(group="Expert syntax", label="Markdown")), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ("height", wagtail.blocks.IntegerBlock(label="Height (in pixels)")), + ], + label="Iframe", + ), + ), + ( + "separator", + wagtail.blocks.StructBlock( + [ + ( + "top_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Top margin", max_value=15, min_value=0 + ), + ), + ( + "bottom_margin", + wagtail.blocks.IntegerBlock( + default=3, label="Bottom margin", max_value=15, min_value=0 + ), + ), + ], + group="Page structure", + label="Separator", + ), + ), + ( + "multicolumns", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "bg_color", + wagtail.blocks.RegexBlock( + error_messages={"invalid": "Incorrect color format, must be #fff or #f5f5f5"}, + help_text="This field is obsolete and will be removed in the near future. Replace it with the background color.", + label="Background color, hexadecimal format (obsolete)", + regex="^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", + required=False, + ), + ), + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 2.", + label="Heading level", + required=False, + ), + ), + ( + "columns", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ( + "column", + wagtail.blocks.StructBlock( + [ + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("3", "3/12"), + ("4", "4/12"), + ("5", "5/12"), + ("6", "6/12"), + ("7", "7/12"), + ("8", "8/12"), + ("9", "9/12"), + ], + help_text="The total width of all columns should be 12.", + label="Column width", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text" + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title", required=False + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image" + ), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + label="Link", required=False + ), + ), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + label="Caption", required=False + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-content-media--sm", + "Small", + ), + ("", "Medium"), + ( + "fr-content-media--lg", + "Large", + ), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "quote", + wagtail.blocks.CharBlock( + label="Quote" + ), + ), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", + required=False, + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ("green-menthe", "Menthe"), + ( + "green-archipel", + "Archipel", + ), + ("blue-ecume", "Écume"), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ("pink-tuile", "Tuile"), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ("brown-opera", "Opéra"), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + label="Link", required=False + ), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock( + label="Height (in pixels)" + ), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", + required=False, + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", + required=False, + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", + required=False, + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", + required=False, + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", + required=False, + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", + required=False, + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", + required=False, + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", + required=False, + ), + ), + ], + group="DSFR components", + label="Vertical card", + ), + ), + ], + label="Column content", + ), + ), + ], + group="Page structure", + label="Adjustable column", + ), + ), + ], + label="Columns", + ), + ), + ], + group="Page structure", + label="Multiple columns", + ), + ), + ( + "fullwidthbackground", + wagtail.blocks.StructBlock( + [ + ( + "bg_image", + wagtail.images.blocks.ImageChooserBlock(label="Background image", required=False), + ), + ( + "bg_color_class", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "Primary colors", + [("blue-france", "Blue France"), ("red-marianne", "Red Marianne")], + ), + ("Neutral colors", [("grey", "Grey")]), + ( + "Illustration colors", + [ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + help_text="Uses the French Design System colors", + label="Background color", + required=False, + ), + ), + ( + "content", + wagtail.blocks.StreamBlock( + [ + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "image", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock(label="Title", required=False), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "alt", + wagtail.blocks.CharBlock( + label="Alternative text (textual description of the image)", + required=False, + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ("url", wagtail.blocks.URLBlock(label="Link", required=False)), + ], + label="Image", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + label="Video title", required=False + ), + ), + ( + "caption", + wagtail.blocks.CharBlock(label="Caption", required=False), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format, with a version that doesn't require a consent banner if available. (e.g. : https://www.youtube-nocookie.com/embed/gLzXOViPX-0) For Youtube, use Embed video and check Enable privacy-enhanced mode.", + label="Video URL", + ), + ), + ( + "width", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-content-media--sm", "Small"), + ("", "Medium"), + ("fr-content-media--lg", "Large"), + ], + label="Witdh", + required=False, + ), + ), + ( + "video_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ], + label="Video ratio", + required=False, + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", + label="Title", + required=False, + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", + required=False, + ), + ), + ], + label="Transcription", + required=False, + ), + ), + ], + label="Video", + ), + ), + ( + "transcription", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + default="Transcription", label="Title", required=False + ), + ), + ( + "content", + wagtail.blocks.RichTextBlock( + label="Transcription content", required=False + ), + ), + ], + label="Transcription", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ( + "author_name", + wagtail.blocks.CharBlock( + label="Author name", required=False + ), + ), + ( + "author_title", + wagtail.blocks.CharBlock( + label="Author title", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("green-tilleul-verveine", "Tilleul verveine"), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Émeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Écume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "Café crème"), + ("brown-caramel", "Caramel"), + ("brown-opera", "Opéra"), + ("beige-gris-galet", "Gris galet"), + ], + label="Color", + required=False, + ), + ), + ], + group="DSFR components", + label="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + label="Single link", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + group="DSFR components", + label="Iframe", + ), + ), + ( + "tile", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + help_text="Prefer SVG files.", + label="Image", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "detail_text", + wagtail.blocks.CharBlock( + help_text="If the tile links to a downloadable document, the values are pre-filled.", + label="Detail text", + required=False, + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tile", required=False + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Tile with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Tile without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Tile without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Tile with a shadow", required=False + ), + ), + ( + "is_horizontal", + wagtail.blocks.BooleanBlock( + label="Horizontal tile", required=False + ), + ), + ], + group="DSFR components", + label="Tile", + ), + ), + ( + "image_and_text", + wagtail.blocks.StructBlock( + [ + ( + "image", + wagtail.images.blocks.ImageChooserBlock(label="Image"), + ), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], + label="Image width", + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "icon", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", "No icon"), + ( + "fr-icon-arrow-right-line fr-link--icon-right", + "Icon on the right side", + ), + ( + "fr-icon-arrow-right-line fr-link--icon-left", + "Icon on the left side", + ), + ], + help_text="Only used for internal links.", + label="Icon", + required=False, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-link--sm", "Small"), + ("", "Medium"), + ("fr-link--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + help_text="The link is shown at the bottom of the text block, with an arrow", + label="Link", + required=False, + ), + ), + ( + "link_label", + wagtail.blocks.CharBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link label (obsolete)", + required=False, + ), + ), + ( + "page", + wagtail.blocks.PageChooserBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Internal link (obsolete)", + required=False, + ), + ), + ( + "link_url", + wagtail.blocks.URLBlock( + group="obsolete", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link URL (obsolete)", + required=False, + ), + ), + ], + label="Image and text", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "Heading 2"), + ("h3", "Heading 3"), + ("h4", "Heading 4"), + ("h5", "Heading 5"), + ("h6", "Heading 6"), + ("p", "Paragraph"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + label="Link", + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="Link (obsolete)", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="This field is obsolete and will be removed in the near future. Please replace with the Link field above.", + label="or Document (obsolete)", + required=False, + ), + ), + ( + "top_detail_text", + wagtail.blocks.CharBlock( + label="Top detail: text", required=False + ), + ), + ( + "top_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Top detail: icon", required=False + ), + ), + ( + "top_detail_badges_tags", + wagtail.blocks.StreamBlock( + [ + ( + "badges", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ( + "new", + "New", + ), + ( + "grey", + "Grey", + ), + ], + ), + ( + "System colors", + [ + ( + "info", + "Info", + ), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ( + "error", + "Error", + ), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ] + ), + ), + ( + "tags", + wagtail.blocks.StreamBlock( + [ + ( + "tag", + wagtail.blocks.StructBlock( + [ + ( + "label", + wagtail.blocks.CharBlock( + label="Title" + ), + ), + ( + "is_small", + wagtail.blocks.BooleanBlock( + label="Small tag", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Émeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Écume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "Café crème", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "Opéra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + help_text="Only for clickable tags", + label="Tag color", + required=False, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ] + ), + ), + ], + label="Top detail: badges or tags", + max_num=1, + required=False, + ), + ), + ( + "bottom_detail_text", + wagtail.blocks.CharBlock( + help_text="Incompatible with the bottom call-to-action. If the card links to a downloadable document, the values are pre-filled.", + label="Bottom detail: text", + required=False, + ), + ), + ( + "bottom_detail_icon", + content_manager.blocks.IconPickerBlock( + label="Bottom detail: icon", required=False + ), + ), + ( + "call_to_action", + wagtail.blocks.StreamBlock( + [ + ( + "links", + wagtail.blocks.StreamBlock( + [ + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ], + label="Link", + ), + ) + ] + ), + ), + ( + "buttons", + wagtail.blocks.StreamBlock( + [ + ( + "button", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this, the document, or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + help_text="Use either this, the external URL or the page parameter.", + label="Document", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this, the document or the page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text.", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + group="DSFR components", + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + group="Expert syntax", + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + ] diff --git a/content_manager/templates/content_manager/blocks/blocks_stream.html b/content_manager/templates/content_manager/blocks/blocks_stream.html index 019dacd6..a2c7d1d0 100644 --- a/content_manager/templates/content_manager/blocks/blocks_stream.html +++ b/content_manager/templates/content_manager/blocks/blocks_stream.html @@ -15,8 +15,12 @@ {% include_block block %} {% elif block.block_type == 'paragraph' %}
{{ block.value|richtext }}
+ {% elif block.block_type == 'alert' %} +
{% include_block block %}
{% elif block.block_type == 'card' %}
{% include_block block %}
+ {% elif block.block_type == 'tile' %} +
{% include_block block %}
{% elif block.block_type == 'accordions' %} {% include "content_manager/blocks/accordions.html" with accordions_id=forloop.counter0|lower %} {% elif block.block_type == 'stepper' %} diff --git a/content_manager/templates/content_manager/blocks/card_horizontal.html b/content_manager/templates/content_manager/blocks/card_horizontal.html index 872a868a..602bda57 100644 --- a/content_manager/templates/content_manager/blocks/card_horizontal.html +++ b/content_manager/templates/content_manager/blocks/card_horizontal.html @@ -6,7 +6,7 @@ <{{ value.heading_tag | default:"h3" }} class="fr-card__title"> {% if value.link and value.link.url %} - {{ value.title }} {{value.link.url}} + {{ value.title }} {% if value.link.url.0 != '/' and request.get_host not in value.link.url %} {% translate "Opens a new window" %} {% endif %} @@ -44,17 +44,7 @@ {% elif value.link.document %}

- {% if value.link.document.file_extension %} - {{ value.link.document.file_extension|upper }} - {% else %} - {% translate "Unknown file format" %} - {% endif %} - - - {% if value.link.document.file_size %} - {{ value.link.document.file_size|filesizeformat }} - {% else %} - {% translate "Unknown file size" %} - {% endif %} + {% include "content_manager/blocks/download_info.html" with document=value.link.document %}

{% endif %} diff --git a/content_manager/templates/content_manager/blocks/download_info.html b/content_manager/templates/content_manager/blocks/download_info.html new file mode 100644 index 00000000..3ef3181c --- /dev/null +++ b/content_manager/templates/content_manager/blocks/download_info.html @@ -0,0 +1,12 @@ +{% load i18n %} +{% if document.file_extension %} + {{ document.file_extension|upper }} +{% else %} + {% translate "Unknown file format" %} +{% endif %} +- +{% if document.file_size %} + {{ document.file_size|filesizeformat }} +{% else %} + {% translate "Unknown file size" %} +{% endif %} diff --git a/content_manager/templates/content_manager/blocks/link.html b/content_manager/templates/content_manager/blocks/link.html index 424841fd..80e555f9 100644 --- a/content_manager/templates/content_manager/blocks/link.html +++ b/content_manager/templates/content_manager/blocks/link.html @@ -10,17 +10,7 @@ {% endif %} {% if value.document %} - {% if value.document.file_extension %} - {{ value.document.file_extension|upper }} - {% else %} - {% translate "Unknown file format" %} - {% endif %} - - - {% if value.document.file_size %} - {{ value.document.file_size|filesizeformat }} - {% else %} - {% translate "Unknown file size" %} - {% endif %} + {% include "content_manager/blocks/download_info.html" with document=value.document %} {% endif %}
diff --git a/content_manager/templates/content_manager/blocks/tile.html b/content_manager/templates/content_manager/blocks/tile.html new file mode 100644 index 00000000..c60a0475 --- /dev/null +++ b/content_manager/templates/content_manager/blocks/tile.html @@ -0,0 +1,51 @@ + +{% load dsfr_tags wagtailcore_tags wagtailimages_tags %} +