From 4afcec81efc30bb88b8881113493224e15f685d5 Mon Sep 17 00:00:00 2001 From: Sylvain Boissel Date: Wed, 3 Jul 2024 15:37:56 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20listes=20de=20boutons=20aux=20app?= =?UTF-8?q?els=20=C3=A0=20action=20(#184)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve icon picker * Moved inline style to a class * Add ability to use a button list in a text and call to action block * Update translations * Add buttons list to the heading * Update test --- ...ogentrypage_header_cta_buttons_and_more.py | 19972 ++++++++++++++++ content_manager/abstract.py | 29 +- content_manager/blocks.py | 84 +- content_manager/constants.py | 5 + .../locale/fr/LC_MESSAGES/django.mo | Bin 15981 -> 16639 bytes .../locale/fr/LC_MESSAGES/django.po | 441 +- ...contentpage_header_cta_buttons_and_more.py | 7887 ++++++ .../content_manager/blocks/button.html | 5 +- .../blocks/buttons_horizontal_list.html | 12 +- .../content_manager/blocks/heading.html | 14 +- .../content_manager/blocks/messages.html | 40 +- .../content_manager/blocks/text_and_cta.html | 11 +- .../widgets/dsfr-icon-picker-widget.html | 31 +- content_manager/tests/test_blocks.py | 2 +- forms/locale/fr/LC_MESSAGES/django.mo | Bin 1540 -> 1581 bytes forms/locale/fr/LC_MESSAGES/django.po | 26 +- static/css/admin.css | 4 + static/css/style.css | 2 +- static/css/style.sass | 6 +- 19 files changed, 28285 insertions(+), 286 deletions(-) create mode 100644 blog/migrations/0021_blogentrypage_header_cta_buttons_and_more.py create mode 100644 content_manager/migrations/0036_contentpage_header_cta_buttons_and_more.py diff --git a/blog/migrations/0021_blogentrypage_header_cta_buttons_and_more.py b/blog/migrations/0021_blogentrypage_header_cta_buttons_and_more.py new file mode 100644 index 00000000..d11b9ee6 --- /dev/null +++ b/blog/migrations/0021_blogentrypage_header_cta_buttons_and_more.py @@ -0,0 +1,19972 @@ +# Generated by Django 5.0.6 on 2024-07-03 09:03 + +import content_manager.blocks +import wagtail.blocks +import wagtail.blocks.static_block +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("blog", "0020_alter_blogentrypage_body_alter_blogindexpage_body_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="blogentrypage", + name="header_cta_buttons", + field=wagtail.fields.StreamField( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + blank=True, + null=True, + ), + ), + migrations.AddField( + model_name="blogindexpage", + name="header_cta_buttons", + field=wagtail.fields.StreamField( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + blank=True, + null=True, + ), + ), + 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="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", + ), + ), + ("icon_class", content_manager.blocks.IconPickerBlock(label="Icon", required=False)), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-text--sm", "Small"), ("", "Medium"), ("fr-text--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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.RichTextBlock( + features=["bold", "italic", "superscript", "subscript", "strikethrough"], + 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)")), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + group="Expert syntax", + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)" + ), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "subpageslist", + wagtail.blocks.static_block.StaticBlock( + admin_text="A simple, alphabetical list of the subpages of the current page.", + group="Website structure", + label="Subpages list", + template="content_manager/blocks/subpages_list.html", + ), + ), + ( + "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="blogentrypage", + name="header_cta_label", + field=models.CharField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action label", + ), + ), + migrations.AlterField( + model_name="blogentrypage", + name="header_cta_link", + field=models.URLField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action link", + ), + ), + migrations.AlterField( + model_name="blogentrypage", + name="header_cta_text", + field=wagtail.fields.RichTextField(blank=True, null=True, verbose_name="Call to action text"), + ), + 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="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", + ), + ), + ("icon_class", content_manager.blocks.IconPickerBlock(label="Icon", required=False)), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-text--sm", "Small"), ("", "Medium"), ("fr-text--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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.RichTextBlock( + features=["bold", "italic", "superscript", "subscript", "strikethrough"], + 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)")), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + group="Expert syntax", + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)" + ), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "subpageslist", + wagtail.blocks.static_block.StaticBlock( + admin_text="A simple, alphabetical list of the subpages of the current page.", + group="Website structure", + label="Subpages list", + template="content_manager/blocks/subpages_list.html", + ), + ), + ( + "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="header_cta_label", + field=models.CharField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action label", + ), + ), + migrations.AlterField( + model_name="blogindexpage", + name="header_cta_link", + field=models.URLField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action link", + ), + ), + migrations.AlterField( + model_name="blogindexpage", + name="header_cta_text", + field=wagtail.fields.RichTextField(blank=True, null=True, verbose_name="Call to action text"), + ), + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)" + ), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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/abstract.py b/content_manager/abstract.py index cbae1a43..95da2d09 100644 --- a/content_manager/abstract.py +++ b/content_manager/abstract.py @@ -2,12 +2,12 @@ from django.utils.translation import gettext_lazy as _ from dsfr.constants import COLOR_CHOICES from wagtail.admin.panels import FieldPanel, MultiFieldPanel -from wagtail.fields import StreamField +from wagtail.fields import RichTextField, StreamField from wagtail.images import get_image_model_string from wagtail.models import Page from wagtail.search import index -from content_manager.blocks import STREAMFIELD_COMMON_BLOCKS +from content_manager.blocks import STREAMFIELD_COMMON_BLOCKS, ButtonsHorizontalListBlock from content_manager.utils import get_streamfield_raw_text @@ -44,20 +44,39 @@ class SitesFacilesBasePage(Page): header_large = models.BooleanField(_("Full width"), default=False) # type: ignore header_darken = models.BooleanField(_("Darken background image"), default=False) # type: ignore - header_cta_text = models.CharField( + header_cta_text = RichTextField( _("Call to action text"), null=True, blank=True, ) + header_cta_buttons = StreamField( + [ + ( + "buttons", + ButtonsHorizontalListBlock( + help_text=_("Please use only one primary button. If you use icons, align them on the same side.") + ), + ), + ], + max_num=1, + null=True, + blank=True, + ) header_cta_label = models.CharField( _("Call to action label"), + help_text=_( + "This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above." + ), null=True, blank=True, ) header_cta_link = models.URLField( _("Call to action link"), + help_text=_( + "This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above." + ), null=True, blank=True, ) @@ -76,6 +95,10 @@ class SitesFacilesBasePage(Page): FieldPanel("header_large"), FieldPanel("header_darken"), FieldPanel("header_cta_text"), + FieldPanel( + "header_cta_buttons", + heading=_("Call-to-action buttons"), + ), FieldPanel("header_cta_label"), FieldPanel("header_cta_link"), ], diff --git a/content_manager/blocks.py b/content_manager/blocks.py index bfcec621..51c275ca 100644 --- a/content_manager/blocks.py +++ b/content_manager/blocks.py @@ -9,6 +9,7 @@ from wagtailmarkdown.blocks import MarkdownBlock from content_manager.constants import ( + BUTTON_ICON_SIDE, BUTTON_TYPE_CHOICES, HEADING_CHOICES, HORIZONTAL_CARD_IMAGE_RATIOS, @@ -33,6 +34,27 @@ class Meta: icon = "view" +class IconPickerBlock(blocks.FieldBlock): + def __init__(self, required=True, help_text=None, validators=(), **kwargs): + self.field_options = { + "required": required, + "help_text": help_text, + "max_length": 70, + "min_length": 0, + "validators": [], + } + super().__init__(**kwargs) + + @cached_property + def field(self): + field_kwargs = {"widget": DsfrIconPickerWidget()} + field_kwargs.update(self.field_options) + return forms.CharField(**field_kwargs) + + class Meta: + icon = "radio-full" + + class LinkStructValue(blocks.StructValue): def url(self): link = self.get("external_url", "") @@ -88,6 +110,13 @@ class Meta: class ButtonBlock(LinkBlock): button_type = blocks.ChoiceBlock(label=_("Button type"), choices=BUTTON_TYPE_CHOICES, required=False) + icon_class = IconPickerBlock(label=_("Icon"), required=False) + icon_side = blocks.ChoiceBlock( + label=_("Icon side"), + choices=BUTTON_ICON_SIDE, + required=False, + default="", + ) class Meta: value_class = LinkStructValue @@ -110,27 +139,6 @@ class Meta: template = "content_manager/blocks/buttons_vertical_list.html" -class IconPickerBlock(blocks.FieldBlock): - def __init__(self, required=True, help_text=None, validators=(), **kwargs): - self.field_options = { - "required": required, - "help_text": help_text, - "max_length": 70, - "min_length": 0, - "validators": [], - } - super().__init__(**kwargs) - - @cached_property - def field(self): - field_kwargs = {"widget": DsfrIconPickerWidget()} - field_kwargs.update(self.field_options) - return forms.CharField(**field_kwargs) - - class Meta: - icon = "radio-full" - - class SingleLinkBlock(LinkBlock): icon = blocks.ChoiceBlock( label=_("Icon"), @@ -307,7 +315,12 @@ class CardBlock(blocks.StructBlock): call_to_action = blocks.StreamBlock( [ ("links", LinksVerticalListBlock()), - ("buttons", ButtonsHorizontalListBlock()), + ( + "buttons", + ButtonsHorizontalListBlock( + help_text=_("Please use only one primary button. If you use icons, align them on the same side.") + ), + ), ], label=_("Bottom call-to-action: links or buttons"), help_text=_("Incompatible with the bottom detail text."), @@ -614,12 +627,33 @@ class StepperBlock(blocks.StructBlock): class TextAndCTA(blocks.StructBlock): text = blocks.RichTextBlock(label=_("Rich text"), required=False) + cta_buttons = blocks.StreamBlock( + [ + ( + "buttons", + ButtonsHorizontalListBlock( + help_text=_("Please use only one primary button. If you use icons, align them on the same side.") + ), + ), + ], + label=_("Call-to-action buttons"), + max_num=1, + required=False, + ) cta_label = blocks.CharBlock( - label=_("Call to action label"), - help_text=_("The link appears as a button under the text block"), + label=_("Call to action label (obsolete)"), + help_text=_( + "This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above." + ), + required=False, + ) + cta_url = blocks.CharBlock( + label=_("Link (obsolete)"), + help_text=_( + "This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above." + ), required=False, ) - cta_url = blocks.CharBlock(label=_("Link"), required=False) class Meta: icon = "link" diff --git a/content_manager/constants.py b/content_manager/constants.py index 7e458174..73b83792 100644 --- a/content_manager/constants.py +++ b/content_manager/constants.py @@ -7,6 +7,11 @@ ("fr-btn fr-btn--tertiary-no-outline", _("Tertiary without border")), ) +BUTTON_ICON_SIDE = ( + ("fr-btn--icon-left", _("Left")), + ("fr-btn--icon-right", _("Right")), +) + HEADING_CHOICES = [ ("h2", _("Heading 2")), ("h3", _("Heading 3")), diff --git a/content_manager/locale/fr/LC_MESSAGES/django.mo b/content_manager/locale/fr/LC_MESSAGES/django.mo index 4321fd1df894600d41fefba75cb77aeb1975383c..d2bae9d3e892f96f249efe09e5349f485338bac8 100644 GIT binary patch delta 5345 zcmZA433N?&0>|+`iG( zscP-5Vj8seAzkR$I<{$R7)(!(jyh+~m^oF>nD6i1e|pZ$J$~==|KE4-f4l$t@Wb3k z3#x^$HHuziIBt-~NNTJxnbnNxR8MD(`LU5PId~r@VRmCpxK)KSB*8F2SwGV>I=a z*cMZfv6!LO$*6$@QSB|n82UFW?TIx=o8}#Ka6hVnE7reb6Y7tUMKVpO$Yf-3Od2L) z7B+{Wa2JPG}R(MJ?e9Yq>qY1v_zmKZfuYw#RYJ z-A%g)bzcQ)4;`~!#C+?AsFAlpJ%Vi1v&=;`G~U*y zqgE<}9dQY2z#n21euNs}A!MxPGmJbETfdLmLkY=|iG@uP1@@6iN4_&pp*CL;Y9LEd z19%hF(RS1$`v7&{VblySqB_2YBk(rrhp0Epp$_vfvinij=SS*cW2V{@KGZXuW$O!3 z16hum$sSC>)2Qq2q6YXA>e1A7+!aef4I~3K;4D=i26Pc8-^*2qo9Unpl+Cl z8u233jmuCgunKklZCl@lYH%Ow*&ajPf6~^^pjPOz^)7Cv9>Xkh@O=zxSKp!F#l%*| zOvgnyMdwis4rduOz|qLYH(pf3i%>IPhZ^W^T!8zK4R0P#b@$2$YY}SZLDYo8sl5N% z#Va@wg_}^%Y#XZK1Gat!yHmf8y)eFwF_$nGIb~X>xeX3N4P-QGW%5yvYO1vawSx0- zA}&c|{ng>$I3fRy8ez@0ZbOYxyEhSaV;4-R#vo8XEaTf5GXXcD?t6slFs?n%8=F{1 zq1t~P^_Fc#t>~dJg=`9E?FF?uxHE5odha`<-q*gUC7X$w;XKr9xES>|tU+DB8TH!k zMO}X!b^STyX_`x@-CwjLyi1NjKLwOhKFNIoQ(W2^ZC%*uoL+WF(;8X z&3udMFq#cj6C0ss+5+`jcR_WWhno2`tWE!B4uv>QEI}>tD%8lzQ5Wt(HCTz-E2mM{ z-9*j!d+SfAJrtMj-d7Jb&=jO2(+73mVARSD$C~tS3MpvDGcXfNPz`TI-MAm?;0a`s z<{WBe9-ua9T!#C7GOFQ@7>&JA1Mi2L$PmO&cMT6S^ohP+I4d`nGgBxFw0S! zWe;jVr%(euhg#ap*Z{vl&G3$`NAvu&DHCuic0&itkvG#EL~X`fs0mi<&id;aHR#Uo zG$x`t8i{&F<59nO9@K!ssE*fKcVK<$2T=`vfqn5S)MiZV;cmJl)Xdu;Z=UIm8ql;b z1y;?xhHBtAHp26$mAGY%Wu4jJrXy+(j74=EM6JkTjK`O;C2l}X;3(=5oI*cdLcOj7 zc|MwWxX2cKs2PS(E3gvPz#4mgBdVbT*bzTPwuku#YDrUix!?E21nSRV6D&YY=mo5c z%TVo?Bab$0Hd3g?iLI#DY!B+jBdDdnh`Qk}YQ+CSy~qDS%{YeVrg{r(h^tKRMa+M!mU z4>rRIs2K-Q*Db|axB~f$)+PYS*>Uh!?c3UfPEYYgnAT@0N6xsP?N~Gj|G=>hgJ`i6e&k}7; z9olTiNea=vd53f*^T{@{iL58TBYLbl*n^RywKdZJekvD;HrD}in0!b+Bl?xn@kbIO z%T?hxL%Kvt#{9)P2G5fXWDZ$Dw10GbN=A~QtSJIa}MGA~bLOootWNCt@~1IVw)yF@>mI_8qS zk&^rWg|{eAC7tZKHuyPNW$WTG@&s8z+LLlJh&bdA>i;DQtw;<>AXmsVvWV#T#3l0C zmd|}8*`6!4idb8I53iEdWGm@RJ|ZW`5z>oP9r^m@=s|6|J+lM*lO|+hMRB7qt2Zbp z^!Oa7U7)Zu;PV7M?aR^=(i^1*1L*}tL2tnC6o!JqfWNe2RKmB_qlyClip*v|)EMsb z6qI_L5DEBwv-$8iGfTY11tqiX4H?ehsm|;`C~}RL`${`G1wQXIzZ0D9Ddq<0lok~8 z;ho~iC`(T6Q_JTm3Oc&DVr+6|^|B+*;f4dA>sK`dr=Tz}%TwW`Jcy2aJiSY%)3rx- zm#m65X%C~ys&z=JV<%C$U9(8;kR97U5Q+>vr^D>1_yLuBgOxj+DIUjnbAGwEsB*90 zQ}J&yy-N*#Oo z9BwaV;qS4%dRbntPimFg0hE^IbZASOtSbL?u!L!WPI%l#qmwC`-yKiz`sj z7$_F7LQpga$`dQd(t?0X1;K>~f$6liU?gF*x+f})H`MHi|*9s_YY>Vi4e`KX4UKy_rLt*^xZ>YK0+ zZb5EsKCm{UI?{@|-wkX}`=))gb0QQuXW~#74zy-t5cR3nd}I<#DaPRvjKzA?bxo)a z9>os$F=`;6V;FvojNDwsAlf%=6m+B8I)Sk<&JPl-Db`^a&i6T}2B)G%Qh}_RS!(Mm zPz|p`HM|kEL|afZ@F}VT7tx~&uTn_D?@&GO!rkeM>4ECdVAT1Ms42b=b=`xg8%;)y zY%Xd^Dy>VbtE}s+n@}BjC6@WuRPN=3Mt02p;GC_uSX)sI-$Heyoy+N92-0Vhh~se> zs$(lrOYtmf2DYL)xC6Df_Mv9(xQqE$;f(#_BBoGp#afJGUHajA)aE>Z`u(@4z0zh4 z?rO{|>Is;Rb=V8{TE9SUX|AI>6dCUf$mOwx?x-0^MD;u!HPRf^QcS`bIM3FPVFLAL z)Kvb2n)>!U!&>_Y)SAbkW@G~D`$?#d&qU39DAbE40o70%YHEj}emC0I@3-|_>vYs+FT!{||4&os$%!4PwLO9A&{@<{ ze1n>ypHL$XWZu=m2vmd7s0QOv-zTFwHVAc}Y}D_kpgKAObzLEbdMK3HFCNzk>dR3# zT#H)Eji?*EZ0n7v8F|xs0voAc!Zcjzc3#=^uOn4bS!3R;_d48dyDjXfBE8&C~2pgOb-H6w4M zMtstG*4kpdV*L@-k=v+tLI*el>WSgBZ$?qjCV9v@2Q`v~w!Rqkyg!GU((O0}51@V* zKF~QIgW3}VP-~oF&u61LJ{{HZa@3w#fu2kXjTF}6MdZmcWvRww;X2gRoj~2-EUE+F z;C#G^V{sl^S(~W|d2-Dss6Fx>szV*poQ{T}W;7ZjuxlFguaWh)C&nUwN6aHwiVM+= z&B%jduA??#V!AWJF{q`<#bKC-nvoY!OS2jEVrxWo=m@Ie^VX~B%zrp1u5%&`JF;^| zqYJeO^H7^@7HZ_h$c8q{P#t;|8KgObx?XRyNC-#GM4~kZS$^{vYBO&_wd?gz(3Bj< zDEtsLm6uQ>xQ$wZ4nugYVian`8P<`gk&Q!*JRfyk3F^8k?2mQGYMEWA8Em%Sd;Uuy zniGC(1dY&z8bKi&5Jw^Uqlz~LEY#Ss>3a)HT@TA&$J)mJkG(W z>$+iA%*3%c33IRk2YUFU(?Wq&Fr7v@o8lhS6i!0z);v@PAGOw@8eWezxE1xgNd7W0 zr6virG(%8RpN+9N0kt;@k!H;w3FCMEOZNb_kkdNBG1vF$d}tOHj|% zm}w&W$$R8&a-960GSSwHQIFw0q%Zk^yh-#H?}j3ato4kX)&j@KM~p9}dMNzRb7 zMif05Li^#|18R8;`NCt@`I>wVsUy1*D zfFF`Skq5{|@>}9hwvuELPu36}L&;0zQB^n&k}kdyFE~BzW2n4Brjk#H@wP>t^{c-U z-ObxI=C6LYlmMdH!i3yIKHRGT~xVXK?yf?7gpBl_KPZO7rDzzeD`%1JB^goPaXcLw{gVG G!2bbCkosN# diff --git a/content_manager/locale/fr/LC_MESSAGES/django.po b/content_manager/locale/fr/LC_MESSAGES/django.po index ec98e045..e2c96608 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-26 16:26+0200\n" -"PO-Revision-Date: 2024-06-26 17:57+0200\n" +"POT-Creation-Date: 2024-07-03 15:09+0200\n" +"PO-Revision-Date: 2024-07-03 15:09+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:720 -#: content_manager/blocks.py:759 +#: content_manager/abstract.py:37 content_manager/blocks.py:757 +#: content_manager/blocks.py:796 msgid "Background color" msgstr "Couleur de fond" -#: content_manager/abstract.py:41 content_manager/blocks.py:722 -#: content_manager/blocks.py:761 +#: content_manager/abstract.py:41 content_manager/blocks.py:759 +#: content_manager/blocks.py:798 msgid "Uses the French Design System colors" msgstr "Utilise les couleurs du système de design de l'État" @@ -48,39 +48,61 @@ 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:615 +#: content_manager/abstract.py:58 content_manager/blocks.py:321 +#: content_manager/blocks.py:635 +msgid "" +"Please use only one primary button. If you use icons, align them on the same " +"side." +msgstr "" +"Merci de n’utiliser qu’un seul bouton primaire. Si vous utilisez des icônes, " +"alignez-les du même côté." + +#: content_manager/abstract.py:67 msgid "Call to action label" msgstr "Libellé de l’appel à action" -#: content_manager/abstract.py:60 +#: content_manager/abstract.py:69 content_manager/abstract.py:78 +#: content_manager/blocks.py:646 content_manager/blocks.py:653 +msgid "" +"This field is obsolete and will be removed in the near future. Please " +"replace with the CTA buttons above." +msgstr "" +"Ce champ est obsolète et sera prochainement supprimé. Merci de le remplacer " +"avec les boutons de l’appel à action ci-dessus." + +#: content_manager/abstract.py:76 msgid "Call to action link" msgstr "Lien de l’appel à action" -#: content_manager/abstract.py:66 +#: content_manager/abstract.py:85 msgid "Body" msgstr "Corps" -#: content_manager/abstract.py:70 +#: content_manager/abstract.py:89 msgid "Common page configuration" msgstr "Configuration commune" -#: content_manager/abstract.py:82 +#: content_manager/abstract.py:100 content_manager/blocks.py:639 +msgid "Call-to-action buttons" +msgstr "Boutons de l’appel à action" + +#: content_manager/abstract.py:105 msgid "Header options" msgstr "Options d’en-tête" -#: content_manager/abstract.py:102 +#: content_manager/abstract.py:125 msgid "Base page" msgstr "Page de base" -#: content_manager/abstract.py:103 +#: content_manager/abstract.py:126 msgid "Base pages" msgstr "Pages de base" -#: content_manager/blocks.py:52 +#: content_manager/blocks.py:75 msgid "Page" msgstr "Page" -#: content_manager/blocks.py:54 +#: content_manager/blocks.py:77 msgid "" "Link to a page of this site. Use either this, the document, or the external " "URL parameter." @@ -88,157 +110,161 @@ msgstr "" "Lien vers une page du site. Utilisez soit ce champ, soit le champ document, " "soit le champ URL externe." -#: content_manager/blocks.py:57 +#: content_manager/blocks.py:80 msgid "Document" msgstr "Document" -#: content_manager/blocks.py:58 +#: content_manager/blocks.py:81 msgid "Use either this, the external URL or the page parameter." msgstr "Utilisez soit ce champ, soit le champ URL externe, soit le champ Page." -#: content_manager/blocks.py:62 +#: content_manager/blocks.py:85 msgid "External URL" msgstr "URL externe" -#: content_manager/blocks.py:64 +#: content_manager/blocks.py:87 msgid "Use either this, the document or the page parameter." msgstr "Utilisez soit ce champ, soit le champ Document, soit le champ Page." -#: content_manager/blocks.py:73 +#: content_manager/blocks.py:96 msgid "Link label" msgstr "Libellé du lien" -#: content_manager/blocks.py:81 content_manager/blocks.py:270 -#: content_manager/blocks.py:367 content_manager/blocks.py:507 -#: content_manager/blocks.py:568 content_manager/blocks.py:619 +#: content_manager/blocks.py:104 content_manager/blocks.py:279 +#: content_manager/blocks.py:383 content_manager/blocks.py:523 +#: content_manager/blocks.py:584 msgid "Link" msgstr "Lien" -#: content_manager/blocks.py:89 +#: content_manager/blocks.py:112 msgid "Button type" msgstr "Type de bouton" -#: content_manager/blocks.py:97 content_manager/blocks.py:105 -#: content_manager/blocks.py:435 -msgid "Button" -msgstr "Bouton" - -#: content_manager/blocks.py:135 content_manager/blocks.py:188 -#: content_manager/blocks.py:432 +#: content_manager/blocks.py:113 content_manager/blocks.py:144 +#: content_manager/blocks.py:197 content_manager/blocks.py:448 msgid "Icon" msgstr "Icône" -#: content_manager/blocks.py:136 +#: content_manager/blocks.py:115 +msgid "Icon side" +msgstr "Côté de l’icône" + +#: content_manager/blocks.py:127 content_manager/blocks.py:135 +#: content_manager/blocks.py:451 +msgid "Button" +msgstr "Bouton" + +#: content_manager/blocks.py:145 msgid "Only used for internal links." msgstr "Uniquement pour les liens internes." -#: content_manager/blocks.py:142 content_manager/blocks.py:455 +#: content_manager/blocks.py:151 content_manager/blocks.py:471 msgid "Size" msgstr "Taille" -#: content_manager/blocks.py:156 +#: content_manager/blocks.py:165 msgid "New" msgstr "Nouveau" -#: content_manager/blocks.py:156 +#: content_manager/blocks.py:165 msgid "Grey" msgstr "Gris" -#: content_manager/blocks.py:157 +#: content_manager/blocks.py:166 msgid "System colors" msgstr "Couleurs système" -#: content_manager/blocks.py:158 +#: content_manager/blocks.py:167 msgid "Illustration colors" msgstr "Couleurs illustratives" -#: content_manager/blocks.py:163 +#: content_manager/blocks.py:172 msgid "Badge label" msgstr "Texte du badge" -#: content_manager/blocks.py:164 +#: content_manager/blocks.py:173 msgid "Badge color" msgstr "Couleur du badge" -#: content_manager/blocks.py:165 +#: content_manager/blocks.py:174 msgid "Hide badge icon" msgstr "Masquer l’icône du badge" -#: content_manager/blocks.py:172 +#: content_manager/blocks.py:181 msgid "Badge" msgstr "Badge" -#: content_manager/blocks.py:180 content_manager/blocks.py:251 -#: content_manager/blocks.py:357 content_manager/blocks.py:399 -#: content_manager/blocks.py:404 content_manager/blocks.py:425 -#: content_manager/blocks.py:467 content_manager/blocks.py:542 -#: content_manager/blocks.py:597 content_manager/blocks.py:606 -#: content_manager/blocks.py:627 content_manager/blocks.py:733 +#: content_manager/blocks.py:189 content_manager/blocks.py:260 +#: content_manager/blocks.py:371 content_manager/blocks.py:415 +#: content_manager/blocks.py:420 content_manager/blocks.py:441 +#: content_manager/blocks.py:483 content_manager/blocks.py:558 +#: content_manager/blocks.py:613 content_manager/blocks.py:622 +#: content_manager/blocks.py:664 content_manager/blocks.py:770 #: content_manager/models.py:275 msgid "Title" msgstr "Titre" -#: content_manager/blocks.py:181 +#: content_manager/blocks.py:190 msgid "Small tag" msgstr "Petit tag" -#: content_manager/blocks.py:183 +#: content_manager/blocks.py:192 msgid "Tag color" msgstr "Couleur du tag" -#: content_manager/blocks.py:186 +#: content_manager/blocks.py:195 msgid "Only for clickable tags" msgstr "Uniquement pour les tags cliquables" -#: content_manager/blocks.py:196 +#: content_manager/blocks.py:205 msgctxt "DSFR Tag" msgid "Tag" msgstr "Tag" -#: content_manager/blocks.py:253 content_manager/blocks.py:359 -#: content_manager/blocks.py:413 content_manager/blocks.py:427 -#: content_manager/blocks.py:544 content_manager/blocks.py:735 +#: content_manager/blocks.py:262 content_manager/blocks.py:373 +#: content_manager/blocks.py:429 content_manager/blocks.py:443 +#: content_manager/blocks.py:560 content_manager/blocks.py:772 msgid "Heading level" msgstr "Niveau de titre" -#: content_manager/blocks.py:256 content_manager/blocks.py:362 -#: content_manager/blocks.py:416 content_manager/blocks.py:430 -#: content_manager/blocks.py:548 +#: content_manager/blocks.py:265 content_manager/blocks.py:376 +#: content_manager/blocks.py:432 content_manager/blocks.py:446 +#: content_manager/blocks.py:564 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:364 -#: content_manager/blocks.py:400 content_manager/blocks.py:434 -#: content_manager/blocks.py:448 content_manager/blocks.py:763 +#: content_manager/blocks.py:267 content_manager/blocks.py:379 +#: content_manager/blocks.py:416 content_manager/blocks.py:450 +#: content_manager/blocks.py:464 content_manager/blocks.py:800 msgid "Content" msgstr "Contenu" -#: content_manager/blocks.py:259 content_manager/blocks.py:365 -#: content_manager/blocks.py:487 content_manager/blocks.py:550 -#: content_manager/blocks.py:576 content_manager/blocks.py:669 +#: content_manager/blocks.py:268 content_manager/blocks.py:381 +#: content_manager/blocks.py:503 content_manager/blocks.py:566 +#: content_manager/blocks.py:592 content_manager/blocks.py:706 msgid "Image" msgstr "Image" -#: content_manager/blocks.py:261 content_manager/blocks.py:329 -#: content_manager/blocks.py:562 +#: content_manager/blocks.py:270 content_manager/blocks.py:343 +#: content_manager/blocks.py:578 msgid "Image ratio" msgstr "Ratio de l’image" -#: content_manager/blocks.py:267 +#: content_manager/blocks.py:276 msgid "Image area badge" msgstr "Badge de la zone image" -#: content_manager/blocks.py:267 +#: content_manager/blocks.py:276 msgid "Only used if the card has an image." msgstr "Uniquement utilisé si la carte a une image." -#: content_manager/blocks.py:274 +#: content_manager/blocks.py:283 content_manager/blocks.py:651 msgid "Link (obsolete)" msgstr "Lien (obsolète)" -#: content_manager/blocks.py:278 content_manager/blocks.py:286 -#: content_manager/blocks.py:515 content_manager/blocks.py:523 -#: content_manager/blocks.py:531 +#: content_manager/blocks.py:287 content_manager/blocks.py:295 +#: content_manager/blocks.py:531 content_manager/blocks.py:539 +#: content_manager/blocks.py:547 msgid "" "This field is obsolete and will be removed in the near future. Please " "replace with the Link field above." @@ -246,59 +272,59 @@ msgstr "" "Ce champ est obsolète et sera prochainement supprimé. Merci de le remplacer " "avec le champ Lien ci-dessus." -#: content_manager/blocks.py:282 +#: content_manager/blocks.py:291 msgid "or Document (obsolete)" msgstr "ou Document (obsolète)" -#: content_manager/blocks.py:289 +#: content_manager/blocks.py:298 msgid "Top detail: text" msgstr "Détail du haut : texte" -#: content_manager/blocks.py:290 +#: content_manager/blocks.py:299 msgid "Top detail: icon" msgstr "Détail du haut : icône" -#: content_manager/blocks.py:296 content_manager/blocks.py:375 +#: content_manager/blocks.py:305 content_manager/blocks.py:391 msgid "Top detail: badges or tags" msgstr "Détail du haut : badges ou tags" -#: content_manager/blocks.py:301 content_manager/blocks.py:335 +#: content_manager/blocks.py:310 content_manager/blocks.py:349 msgid "Bottom detail: text" msgstr "Détail du bas : texte" -#: content_manager/blocks.py:302 +#: content_manager/blocks.py:311 msgid "Incompatible with the bottom call-to-action." msgstr "Incompatible avec l’appel à action en bas de carte." -#: content_manager/blocks.py:305 +#: content_manager/blocks.py:314 msgid "Bottom detail: icon" msgstr "Détail du bas : icône" -#: content_manager/blocks.py:311 +#: content_manager/blocks.py:325 msgid "Bottom call-to-action: links or buttons" msgstr "Appel à action en bas de la carte" -#: content_manager/blocks.py:312 +#: content_manager/blocks.py:326 msgid "Incompatible with the bottom detail text." msgstr "Incompatible avec le détail du bas." -#: content_manager/blocks.py:316 +#: content_manager/blocks.py:330 msgid "Card with grey background" msgstr "Carte avec arrière-plan gris" -#: content_manager/blocks.py:317 +#: content_manager/blocks.py:331 msgid "Card without background" msgstr "Carte sans arrière-plan" -#: content_manager/blocks.py:318 +#: content_manager/blocks.py:332 msgid "Card without border" msgstr "Carte sans bordure" -#: content_manager/blocks.py:319 +#: content_manager/blocks.py:333 msgid "Card with a shadow" msgstr "Carte avec une ombre" -#: content_manager/blocks.py:337 +#: content_manager/blocks.py:351 msgid "" "Incompatible with the bottom call-to-action. If the card links to a " "downloadable document, the values are pre-filled." @@ -306,67 +332,67 @@ 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:365 +#: content_manager/blocks.py:381 msgid "Prefer SVG files." msgstr "Privilégier les fichiers SVG." -#: content_manager/blocks.py:380 +#: content_manager/blocks.py:396 msgid "Detail text" msgstr "Texte de détail" -#: content_manager/blocks.py:382 +#: content_manager/blocks.py:398 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 +#: content_manager/blocks.py:400 msgid "Small tile" msgstr "Petite tuile" -#: content_manager/blocks.py:385 +#: content_manager/blocks.py:401 msgid "Tile with grey background" msgstr "Tuile avec arrière-plan gris" -#: content_manager/blocks.py:386 +#: content_manager/blocks.py:402 msgid "Tile without background" msgstr "Tuile sans arrière-plan" -#: content_manager/blocks.py:387 +#: content_manager/blocks.py:403 msgid "Tile without border" msgstr "Tuile sans bordure" -#: content_manager/blocks.py:388 +#: content_manager/blocks.py:404 msgid "Tile with a shadow" msgstr "Tuile avec une ombre" -#: content_manager/blocks.py:389 +#: content_manager/blocks.py:405 msgid "Horizontal tile" msgstr "Tuile horizontale" -#: content_manager/blocks.py:405 +#: content_manager/blocks.py:421 msgid "Accordion" msgstr "Accordéon" -#: content_manager/blocks.py:409 +#: content_manager/blocks.py:425 msgid "Message title" msgstr "Titre du message" -#: content_manager/blocks.py:410 +#: content_manager/blocks.py:426 msgid "Message text" msgstr "Texte du message" -#: content_manager/blocks.py:411 +#: content_manager/blocks.py:427 msgid "Message type" msgstr "Type de message" -#: content_manager/blocks.py:437 content_manager/blocks.py:450 -#: content_manager/blocks.py:581 +#: content_manager/blocks.py:453 content_manager/blocks.py:466 +#: content_manager/blocks.py:597 msgid "Color" msgstr "Couleur" -#: content_manager/blocks.py:468 +#: content_manager/blocks.py:484 msgid "" "Accessibility: The title should describe, in a clear and concise manner, the " "embedded content." @@ -374,133 +400,133 @@ msgstr "" "Accessibilité : Le titre doit décrire, de façon claire et concise, le " "contenu embarqué." -#: content_manager/blocks.py:471 +#: content_manager/blocks.py:487 msgid "URL of the iframe" msgstr "URL de l‘iframe" -#: content_manager/blocks.py:472 +#: content_manager/blocks.py:488 msgid "Example for Tally: https://tally.so/embed/w2jMRa" msgstr "Exemple pour Tally : https://tally.so/embed/w2jMRa" -#: content_manager/blocks.py:474 +#: content_manager/blocks.py:490 msgid "Height (in pixels)" msgstr "Hauteur (en pixels)" -#: content_manager/blocks.py:476 +#: content_manager/blocks.py:492 msgid "Parameters" msgstr "Paramètres" -#: content_manager/blocks.py:477 +#: content_manager/blocks.py:493 msgid "For example: \"allow='geolocation'\"." msgstr "Par exemple : « allow='geolocation' »." -#: content_manager/blocks.py:489 +#: content_manager/blocks.py:505 msgid "Side where the image is displayed" msgstr "Côté où afficher l’image" -#: content_manager/blocks.py:491 +#: content_manager/blocks.py:507 content_manager/constants.py:11 msgid "Left" msgstr "Gauche" -#: content_manager/blocks.py:492 +#: content_manager/blocks.py:508 content_manager/constants.py:12 msgid "Right" msgstr "Droite" -#: content_manager/blocks.py:497 +#: content_manager/blocks.py:513 msgid "Image width" msgstr "Largeur de l’image" -#: content_manager/blocks.py:505 content_manager/blocks.py:613 -#: content_manager/blocks.py:668 content_manager/blocks.py:771 +#: content_manager/blocks.py:521 content_manager/blocks.py:629 +#: content_manager/blocks.py:705 content_manager/blocks.py:808 msgid "Rich text" msgstr "Texte avec mise en forme" -#: content_manager/blocks.py:509 +#: content_manager/blocks.py:525 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:512 +#: content_manager/blocks.py:528 msgid "Link label (obsolete)" msgstr "Libellé du lien (obsolète)" -#: content_manager/blocks.py:520 +#: content_manager/blocks.py:536 msgid "Internal link (obsolete)" msgstr "Lien interne (obsolète)" -#: content_manager/blocks.py:528 +#: content_manager/blocks.py:544 msgid "Link URL (obsolete)" msgstr "URL du lien (obsolète)" -#: content_manager/blocks.py:552 +#: content_manager/blocks.py:568 msgid "Alternative text (textual description of the image)" msgstr "Alternative textuelle (description textuelle de l’image)" -#: content_manager/blocks.py:556 content_manager/blocks.py:648 +#: content_manager/blocks.py:572 content_manager/blocks.py:685 msgid "Witdh" msgstr "Largeur" -#: content_manager/blocks.py:567 content_manager/blocks.py:637 +#: content_manager/blocks.py:583 content_manager/blocks.py:674 msgid "Caption" msgstr "Légende" -#: content_manager/blocks.py:577 content_manager/blocks.py:674 -#: content_manager/blocks.py:777 +#: content_manager/blocks.py:593 content_manager/blocks.py:711 +#: content_manager/blocks.py:814 msgid "Quote" msgstr "Citation" -#: content_manager/blocks.py:578 +#: content_manager/blocks.py:594 msgid "Author name" msgstr "Nom de l’auteur" -#: content_manager/blocks.py:579 +#: content_manager/blocks.py:595 msgid "Author title" msgstr "Titre de l’auteur" -#: content_manager/blocks.py:592 +#: content_manager/blocks.py:608 msgid "Top margin" msgstr "Espacement au dessus" -#: content_manager/blocks.py:593 +#: content_manager/blocks.py:609 msgid "Bottom margin" msgstr "Espacement en dessous" -#: content_manager/blocks.py:598 +#: content_manager/blocks.py:614 msgid "Detail" msgstr "Détail" -#: content_manager/blocks.py:602 +#: content_manager/blocks.py:618 msgid "Step" msgstr "Étape" -#: content_manager/blocks.py:607 +#: content_manager/blocks.py:623 msgid "Number of steps" msgstr "Nombre d’étapes" -#: content_manager/blocks.py:608 +#: content_manager/blocks.py:624 msgid "Current step" msgstr "Étape actuelle" -#: content_manager/blocks.py:609 +#: content_manager/blocks.py:625 msgid "Steps" msgstr "Étapes" -#: content_manager/blocks.py:616 -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:644 +msgid "Call to action label (obsolete)" +msgstr "Libellé de l’appel à action (obsolète)" -#: content_manager/blocks.py:628 +#: content_manager/blocks.py:665 msgid "Transcription content" msgstr "Contenu de la transcription" -#: content_manager/blocks.py:636 +#: content_manager/blocks.py:673 msgid "Video title" msgstr "Titre de la vidéo" -#: content_manager/blocks.py:639 +#: content_manager/blocks.py:676 msgid "Video URL" msgstr "URL de la vidéo" -#: content_manager/blocks.py:641 +#: content_manager/blocks.py:678 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 " @@ -511,88 +537,88 @@ 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:654 +#: content_manager/blocks.py:691 msgid "Video ratio" msgstr "Ratio de la vidéo" -#: content_manager/blocks.py:659 content_manager/blocks.py:671 -#: content_manager/blocks.py:779 +#: content_manager/blocks.py:696 content_manager/blocks.py:708 +#: content_manager/blocks.py:816 msgid "Transcription" msgstr "Transcription" -#: content_manager/blocks.py:670 content_manager/blocks.py:778 +#: content_manager/blocks.py:707 content_manager/blocks.py:815 msgid "Video" msgstr "Vidéo" -#: content_manager/blocks.py:672 content_manager/blocks.py:775 +#: content_manager/blocks.py:709 content_manager/blocks.py:812 msgid "Callout" msgstr "Mise en avant" -#: content_manager/blocks.py:672 content_manager/blocks.py:673 -#: content_manager/blocks.py:674 content_manager/blocks.py:677 -#: content_manager/blocks.py:678 content_manager/blocks.py:685 -#: content_manager/blocks.py:710 content_manager/blocks.py:750 -#: content_manager/blocks.py:775 content_manager/blocks.py:776 -#: content_manager/blocks.py:777 content_manager/blocks.py:783 -#: content_manager/blocks.py:784 content_manager/blocks.py:785 -#: content_manager/blocks.py:786 +#: content_manager/blocks.py:709 content_manager/blocks.py:710 +#: content_manager/blocks.py:711 content_manager/blocks.py:714 +#: content_manager/blocks.py:715 content_manager/blocks.py:722 +#: content_manager/blocks.py:747 content_manager/blocks.py:787 +#: content_manager/blocks.py:812 content_manager/blocks.py:813 +#: content_manager/blocks.py:814 content_manager/blocks.py:820 +#: content_manager/blocks.py:821 content_manager/blocks.py:822 +#: content_manager/blocks.py:823 msgid "DSFR components" msgstr "Composants du DSFR" -#: content_manager/blocks.py:673 content_manager/blocks.py:776 +#: content_manager/blocks.py:710 content_manager/blocks.py:813 msgid "Highlight" msgstr "Mise en exergue" -#: content_manager/blocks.py:675 +#: content_manager/blocks.py:712 msgid "Text and call to action" msgstr "Texte et appel à action" -#: content_manager/blocks.py:676 content_manager/blocks.py:782 +#: content_manager/blocks.py:713 content_manager/blocks.py:819 msgid "Single link" msgstr "Lien isolé" -#: content_manager/blocks.py:677 content_manager/blocks.py:788 +#: content_manager/blocks.py:714 content_manager/blocks.py:825 msgid "Iframe" msgstr "Iframe" -#: content_manager/blocks.py:678 content_manager/blocks.py:784 +#: content_manager/blocks.py:715 content_manager/blocks.py:821 msgid "Tile" msgstr "Tuile" -#: content_manager/blocks.py:685 content_manager/blocks.py:710 +#: content_manager/blocks.py:722 content_manager/blocks.py:747 msgid "Vertical card" msgstr "Carte verticale" -#: content_manager/blocks.py:690 +#: content_manager/blocks.py:727 msgid "Column width" msgstr "Largeur de colonne" -#: content_manager/blocks.py:700 +#: content_manager/blocks.py:737 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:703 +#: content_manager/blocks.py:740 msgid "Column content" msgstr "Contenu de la colonnne" -#: content_manager/blocks.py:711 +#: content_manager/blocks.py:748 msgid "Adjustable column" msgstr "Colonne ajustable" -#: content_manager/blocks.py:711 content_manager/blocks.py:789 -#: content_manager/blocks.py:790 content_manager/blocks.py:791 +#: content_manager/blocks.py:748 content_manager/blocks.py:826 +#: content_manager/blocks.py:827 content_manager/blocks.py:828 msgid "Page structure" msgstr "Structure de la page" -#: content_manager/blocks.py:718 content_manager/blocks.py:757 +#: content_manager/blocks.py:755 content_manager/blocks.py:794 msgid "Background image" msgstr "Image de fond" -#: content_manager/blocks.py:725 +#: content_manager/blocks.py:762 msgid "Background color, hexadecimal format (obsolete)" msgstr "Couleur de fond, format hexadécimal (obsolète)" -#: content_manager/blocks.py:728 +#: content_manager/blocks.py:765 msgid "" "This field is obsolete and will be removed in the near future. Replace it " "with the background color." @@ -600,81 +626,81 @@ msgstr "" "Ce champ est obsolète et sera prochainement supprimé. Merci de le remplacer " "avec la couleur de fond." -#: content_manager/blocks.py:730 +#: content_manager/blocks.py:767 msgid "Incorrect color format, must be #fff or #f5f5f5" msgstr "Format de couleur incorrect, doit être #fff ou #f5f5f5" -#: content_manager/blocks.py:739 +#: content_manager/blocks.py:776 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:741 +#: content_manager/blocks.py:778 msgid "Columns" msgstr "Colonnes" -#: content_manager/blocks.py:749 content_manager/blocks.py:773 +#: content_manager/blocks.py:786 content_manager/blocks.py:810 msgid "Image and text" msgstr "Image et texte" -#: content_manager/blocks.py:750 content_manager/blocks.py:783 +#: content_manager/blocks.py:787 content_manager/blocks.py:820 msgid "Horizontal card" msgstr "Carte horizontale" -#: content_manager/blocks.py:774 +#: content_manager/blocks.py:811 msgid "Alert message" msgstr "Message d’alerte" -#: content_manager/blocks.py:780 +#: content_manager/blocks.py:817 msgid "Badge list" msgstr "Liste de badges" -#: content_manager/blocks.py:781 +#: content_manager/blocks.py:818 msgid "Tag list" msgstr "Liste de tags" -#: content_manager/blocks.py:785 +#: content_manager/blocks.py:822 msgid "Accordions" msgstr "Accordéons" -#: content_manager/blocks.py:786 +#: content_manager/blocks.py:823 msgid "Stepper" msgstr "Étapier" -#: content_manager/blocks.py:787 +#: content_manager/blocks.py:824 msgid "Markdown" msgstr "Markdown" -#: content_manager/blocks.py:787 content_manager/blocks.py:788 -#: content_manager/blocks.py:814 +#: content_manager/blocks.py:824 content_manager/blocks.py:825 +#: content_manager/blocks.py:851 msgid "Expert syntax" msgstr "Syntaxe experte" -#: content_manager/blocks.py:789 +#: content_manager/blocks.py:826 msgid "Separator" msgstr "Séparateur" -#: content_manager/blocks.py:790 +#: content_manager/blocks.py:827 msgid "Multiple columns" msgstr "Multi-colonnes" -#: content_manager/blocks.py:791 +#: content_manager/blocks.py:828 msgid "Full width background" msgstr "Fond pleine largeur" -#: content_manager/blocks.py:795 +#: content_manager/blocks.py:832 msgid "Subpages list" msgstr "Liste des sous-pages" -#: content_manager/blocks.py:796 +#: content_manager/blocks.py:833 msgid "A simple, alphabetical list of the subpages of the current page." msgstr "" "Une liste alphabétique toute simple des sous-pages de la page actuelle." -#: content_manager/blocks.py:798 +#: content_manager/blocks.py:835 msgid "Website structure" msgstr "Structure du site" -#: content_manager/blocks.py:812 +#: content_manager/blocks.py:849 msgid "" "Warning: Use HTML block with caution. Malicious code can compromise the " "security of the site." @@ -698,70 +724,70 @@ msgstr "Tertiaire" msgid "Tertiary without border" msgstr "Tertiaire sans bordure" -#: content_manager/constants.py:11 +#: content_manager/constants.py:16 msgid "Heading 2" msgstr "En-tête 2" -#: content_manager/constants.py:12 +#: content_manager/constants.py:17 msgid "Heading 3" msgstr "En-tête 3" -#: content_manager/constants.py:13 +#: content_manager/constants.py:18 msgid "Heading 4" msgstr "En-tête 4" -#: content_manager/constants.py:14 +#: content_manager/constants.py:19 msgid "Heading 5" msgstr "En-tête 5" -#: content_manager/constants.py:15 +#: content_manager/constants.py:20 msgid "Heading 6" msgstr "En-tête 6" -#: content_manager/constants.py:16 +#: content_manager/constants.py:21 msgid "Paragraph" msgstr "Paragraphe" -#: content_manager/constants.py:26 +#: content_manager/constants.py:31 msgid "Error" msgstr "Erreur" -#: content_manager/constants.py:27 +#: content_manager/constants.py:32 msgid "Success" msgstr "Succès" -#: content_manager/constants.py:28 +#: content_manager/constants.py:33 msgid "Information" msgstr "Information" -#: content_manager/constants.py:29 +#: content_manager/constants.py:34 msgid "Warning" msgstr "Avertissement" -#: content_manager/constants.py:43 content_manager/constants.py:55 -#: content_manager/constants.py:61 +#: content_manager/constants.py:56 content_manager/constants.py:68 +#: content_manager/constants.py:74 msgid "Small" msgstr "Petit" -#: content_manager/constants.py:44 content_manager/constants.py:56 -#: content_manager/constants.py:62 +#: content_manager/constants.py:57 content_manager/constants.py:69 +#: content_manager/constants.py:75 msgid "Medium" msgstr "Medium" -#: content_manager/constants.py:45 content_manager/constants.py:57 -#: content_manager/constants.py:63 +#: content_manager/constants.py:58 content_manager/constants.py:70 +#: content_manager/constants.py:76 msgid "Large" msgstr "Large" -#: content_manager/constants.py:49 +#: content_manager/constants.py:62 msgid "No icon" msgstr "Pas d’icône" -#: content_manager/constants.py:50 +#: content_manager/constants.py:63 msgid "Icon on the right side" msgstr "Icône du côté droit" -#: content_manager/constants.py:51 +#: content_manager/constants.py:64 msgid "Icon on the left side" msgstr "Icône du côté gauche" @@ -971,6 +997,10 @@ msgstr "Voir sur le site" msgid "Tags" msgstr "Étiquettes" +#: content_manager/templates/content_manager/widgets/dsfr-icon-picker-widget.html:9 +msgid "Select icon" +msgstr "Sélectionner une icône" + #: content_manager/urls.py:8 msgid "search/" msgstr "recherche/" @@ -989,6 +1019,9 @@ msgstr "Pages avec l’étiquette {tag}" msgid "List of pages tagged with {tag}" msgstr "Liste de pages avec l’étiquette {tag}" +#~ msgid "The link appears as a button under the text block" +#~ msgstr "Le lien apparaît comme un bouton sous le bloc de texte" + #~ msgid "Can contain HTML." #~ msgstr "Peut contenir du HTML." diff --git a/content_manager/migrations/0036_contentpage_header_cta_buttons_and_more.py b/content_manager/migrations/0036_contentpage_header_cta_buttons_and_more.py new file mode 100644 index 00000000..29d25186 --- /dev/null +++ b/content_manager/migrations/0036_contentpage_header_cta_buttons_and_more.py @@ -0,0 +1,7887 @@ +# Generated by Django 5.0.6 on 2024-07-03 09:03 + +import content_manager.blocks +import wagtail.blocks +import wagtail.blocks.static_block +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("content_manager", "0035_alter_contentpage_body"), + ] + + operations = [ + migrations.AddField( + model_name="contentpage", + name="header_cta_buttons", + field=wagtail.fields.StreamField( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + blank=True, + null=True, + ), + ), + 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="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", + ), + ), + ("icon_class", content_manager.blocks.IconPickerBlock(label="Icon", required=False)), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock(label="Icon", required=False), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[("fr-text--sm", "Small"), ("", "Medium"), ("fr-text--lg", "Large")], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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.RichTextBlock( + features=["bold", "italic", "superscript", "subscript", "strikethrough"], + 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)")), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + group="Expert syntax", + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)" + ), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "callout", + 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", + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + required=False, + ), + ), + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", required=False + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn--icon-left", "Left"), + ("fr-btn--icon-right", "Right"), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + 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="Callout", + ), + ), + ( + "highlight", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + label="Content", + ), + ), + ( + "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, + ), + ), + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-text--sm", "Small"), + ("", "Medium"), + ("fr-text--lg", "Large"), + ], + label="Size", + required=False, + ), + ), + ], + group="DSFR components", + label="Highlight", + ), + ), + ( + "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_buttons", + wagtail.blocks.StreamBlock( + [ + ( + "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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ) + ], + label="Call-to-action buttons", + max_num=1, + required=False, + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Call to action label (obsolete)", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock( + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + label="Link (obsolete)", + 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)"), + ), + ( + "parameters", + wagtail.blocks.CharBlock( + help_text="For example: \"allow='geolocation'\".", + label="Parameters", + required=False, + ), + ), + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "superscript", + "subscript", + "strikethrough", + ], + 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.RichTextBlock( + features=[ + "bold", + "italic", + "link", + "document-link", + "superscript", + "subscript", + "strikethrough", + ], + 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, + ), + ), + ( + "icon_class", + content_manager.blocks.IconPickerBlock( + label="Icon", + required=False, + ), + ), + ( + "icon_side", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn--icon-left", + "Left", + ), + ( + "fr-btn--icon-right", + "Right", + ), + ], + label="Icon side", + required=False, + ), + ), + ], + label="Button", + ), + ) + ], + help_text="Please use only one primary button. If you use icons, align them on the same side.", + ), + ), + ], + 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", + ), + ), + ( + "subpageslist", + wagtail.blocks.static_block.StaticBlock( + admin_text="A simple, alphabetical list of the subpages of the current page.", + group="Website structure", + label="Subpages list", + template="content_manager/blocks/subpages_list.html", + ), + ), + ( + "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="contentpage", + name="header_cta_label", + field=models.CharField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action label", + ), + ), + migrations.AlterField( + model_name="contentpage", + name="header_cta_link", + field=models.URLField( + blank=True, + help_text="This field is obsolete and will be removed in the near future. Please replace with the CTA buttons above.", + null=True, + verbose_name="Call to action link", + ), + ), + migrations.AlterField( + model_name="contentpage", + name="header_cta_text", + field=wagtail.fields.RichTextField(blank=True, null=True, verbose_name="Call to action text"), + ), + ] diff --git a/content_manager/templates/content_manager/blocks/button.html b/content_manager/templates/content_manager/blocks/button.html index 7a7f3ebc..d7931c6b 100644 --- a/content_manager/templates/content_manager/blocks/button.html +++ b/content_manager/templates/content_manager/blocks/button.html @@ -1,8 +1,9 @@ {% if button.external_url %} - {{ button.text }} {% else %} - {{ button.text }} + {{ button.text }} {% endif %} diff --git a/content_manager/templates/content_manager/blocks/buttons_horizontal_list.html b/content_manager/templates/content_manager/blocks/buttons_horizontal_list.html index d9f5c40f..916fb869 100644 --- a/content_manager/templates/content_manager/blocks/buttons_horizontal_list.html +++ b/content_manager/templates/content_manager/blocks/buttons_horizontal_list.html @@ -1,7 +1,9 @@ {% load static wagtailcore_tags %} -
    - {% for button in block.value %} -
  • {% include "content_manager/blocks/button.html" with button=button.value %}
  • - {% endfor %} -
+{% with block.value.0.value.icon_side as icons_side %} +
    + {% for button in block.value %} +
  • {% include "content_manager/blocks/button.html" with button=button.value %}
  • + {% endfor %} +
+{% endwith %} diff --git a/content_manager/templates/content_manager/blocks/heading.html b/content_manager/templates/content_manager/blocks/heading.html index 12296fff..18aa8529 100644 --- a/content_manager/templates/content_manager/blocks/heading.html +++ b/content_manager/templates/content_manager/blocks/heading.html @@ -1,19 +1,23 @@ -{% load static wagtailimages_tags %} +{% load static wagtailcore_tags wagtailimages_tags %} {% if page.header_image or page.header_color_class %} {% image page.header_image fill-1200x350 as bg_img %}
- {% if page.header_with_title or page.header_cta_link and page.header_cta_label %} -
+ {% if page.header_with_title or page.header_cta_buttons or page.header_cta_link and page.header_cta_label %} +
{% if page.header_with_title %}

{{ page.title }}

{% endif %} - {% if page.header_cta_text %}

{{ page.header_cta_text }}

{% endif %} - {% if page.header_cta_link and page.header_cta_label %} + {% if page.header_cta_text %}{{ page.header_cta_text|richtext }}{% endif %} + {% if page.header_cta_buttons %} + {% for block in page.header_cta_buttons %} + {% include_block block %} + {% endfor %} + {% elif page.header_cta_url and page.header_cta_label %} {{ page.header_cta_label }} {% endif %} diff --git a/content_manager/templates/content_manager/blocks/messages.html b/content_manager/templates/content_manager/blocks/messages.html index 11810e66..4f810598 100644 --- a/content_manager/templates/content_manager/blocks/messages.html +++ b/content_manager/templates/content_manager/blocks/messages.html @@ -1,25 +1,25 @@ {# Display Django message info from previous form #} {% if messages %} -
-
-
- {% for message in messages %} - {% if message.tags == "success" %} -
-

{{ message }}

-
- {% elif message.tags == "info" %} -
-

{{ message }}

-
- {% elif message.tags == "error" %} - - {% endif %} - {% endfor %} +
+
+
+ {% for message in messages %} + {% if message.tags == "success" %} +
+

{{ message }}

-
+ {% elif message.tags == "info" %} +
+

{{ message }}

+
+ {% elif message.tags == "error" %} + + {% endif %} + {% endfor %} +
+
{% endif %} diff --git a/content_manager/templates/content_manager/blocks/text_and_cta.html b/content_manager/templates/content_manager/blocks/text_and_cta.html index 0b0d0aed..bd7bb54e 100644 --- a/content_manager/templates/content_manager/blocks/text_and_cta.html +++ b/content_manager/templates/content_manager/blocks/text_and_cta.html @@ -1,8 +1,15 @@ {% load wagtailcore_tags %}
{{ value.text|richtext }} - {% if value.cta_url and value.cta_label %} -

+ + {% if value.cta_buttons %} +

+ {% for block in value.cta_buttons %} + {% include_block block %} + {% endfor %} +
+ {% elif value.cta_url and value.cta_label %} +

{# It doesn't use dsfr_link or dsfr_button because it's a link with a button style #} {{ value.cta_label }}

diff --git a/content_manager/templates/content_manager/widgets/dsfr-icon-picker-widget.html b/content_manager/templates/content_manager/widgets/dsfr-icon-picker-widget.html index 3b212e3a..1b6b9095 100644 --- a/content_manager/templates/content_manager/widgets/dsfr-icon-picker-widget.html +++ b/content_manager/templates/content_manager/widgets/dsfr-icon-picker-widget.html @@ -1,9 +1,13 @@ -{% load static %} +{% load static i18n %}
- {% include "django/forms/widgets/text.html" %} +
{% include "django/forms/widgets/text.html" %}
{% with widget.attrs.id as widget_id %} - + + {% endwith %}
diff --git a/content_manager/tests/test_blocks.py b/content_manager/tests/test_blocks.py index bf8a2a51..f31b12ed 100644 --- a/content_manager/tests/test_blocks.py +++ b/content_manager/tests/test_blocks.py @@ -155,7 +155,7 @@ def test_card_with_cta_buttons(self): self.assertInHTML("""Sample card""", response.content.decode()) self.assertInHTML( - """