diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7f174c6..321af56b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - name: âš Black, isort, flake8 & djlint run: | make quality - - name: đ§ Check pending migrations + - name: đ§ Check pending migrations # continue-on-error: true run: | poetry run django-admin makemigrations --check --dry-run --noinput - name: đ€čâ Run the unit tests diff --git a/.gitignore b/.gitignore index b58146f5..e4780fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -148,3 +148,4 @@ dmypy.json # Project-specific stuff config.json cron.json +temp.json diff --git a/blog/migrations/0009_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py b/blog/migrations/0009_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py new file mode 100644 index 00000000..1354ea22 --- /dev/null +++ b/blog/migrations/0009_alter_blogentrypage_body_alter_blogindexpage_body_and_more.py @@ -0,0 +1,6630 @@ +# Generated by Django 5.0.6 on 2024-05-23 15:04 + +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations + +import content_manager.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("blog", "0008_alter_blogentrypage_body_alter_blogindexpage_body_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="blogentrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "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", + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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 + ), + ), + ("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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", 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", "Erreur"), + ("success", "SuccĂšs"), + ("info", "Information"), + ("warning", "Attention"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name")), + ("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="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Ămeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Ăcume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "CafĂ© crĂšme"), + ("brown-caramel", "Caramel"), + ("brown-opera", "OpĂ©ra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ("url", wagtail.blocks.URLBlock(group="target", label="Link", required=False)), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + label="Horizontal card", + ), + ), + ( + "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, + ), + ), + ], + 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", + ), + ), + ], + label="Stepper", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(label="Markdown")), + ( + "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 + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Vertical card", + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="blogindexpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "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", + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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 + ), + ), + ("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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", 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", "Erreur"), + ("success", "SuccĂšs"), + ("info", "Information"), + ("warning", "Attention"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name")), + ("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="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Ămeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Ăcume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "CafĂ© crĂšme"), + ("brown-caramel", "Caramel"), + ("brown-opera", "OpĂ©ra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ("url", wagtail.blocks.URLBlock(group="target", label="Link", required=False)), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + label="Horizontal card", + ), + ), + ( + "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, + ), + ), + ], + 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", + ), + ), + ], + label="Stepper", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(label="Markdown")), + ( + "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 + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Vertical card", + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + migrations.AlterField( + model_name="category", + name="colophon", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "imageandtext", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ( + "image_side", + wagtail.blocks.ChoiceBlock( + choices=[("left", "Left"), ("right", "Right")], + label="Side where the image is displayed", + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[("3", "3/12"), ("5", "5/12"), ("6", "6/12")], label="Image width" + ), + ), + ("text", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "link", + wagtail.blocks.StructBlock( + [ + ( + "page", + wagtail.blocks.PageChooserBlock( + help_text="Link to a page of this site. Use either this or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", 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")), + ("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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Vertical card", + ), + ), + ], + label="Columns", + ), + ), + ], + label="Multi-colonnes", + ), + ), + ( + "contact_card", + wagtail.blocks.StructBlock( + [ + ("name", wagtail.blocks.CharBlock(label="Name", max_length=255)), + ("role", wagtail.blocks.CharBlock(label="Role", max_length=255)), + ("organization", wagtail.blocks.CharBlock(label="Organization", max_length=255)), + ( + "contact_info", + wagtail.blocks.CharBlock(label="Contact info", max_length=500, required=False), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image")), + ], + label="Contact card", + ), + ), + ], + blank=True, + help_text="Text displayed at the end of every page in the category", + ), + ), + ] diff --git a/content_manager/blocks.py b/content_manager/blocks.py index a334979b..32df06e4 100644 --- a/content_manager/blocks.py +++ b/content_manager/blocks.py @@ -2,13 +2,14 @@ from django.conf import settings from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _, pgettext_lazy -from dsfr.constants import COLOR_CHOICES, COLOR_CHOICES_ILLUSTRATION, COLOR_CHOICES_SYSTEM +from dsfr.constants import COLOR_CHOICES, COLOR_CHOICES_ILLUSTRATION, COLOR_CHOICES_SYSTEM, IMAGE_RATIOS from wagtail import blocks +from wagtail.blocks import StructValue from wagtail.documents.blocks import DocumentChooserBlock from wagtail.images.blocks import ImageChooserBlock from wagtailmarkdown.blocks import MarkdownBlock -from content_manager.constants import HEADING_CHOICES, LEVEL_CHOICES +from content_manager.constants import HEADING_CHOICES, HORIZONTAL_CARD_IMAGE_RATIOS, LEVEL_CHOICES from content_manager.widgets import DsfrIconPickerWidget @@ -55,6 +56,46 @@ class Meta: icon = "link" +class LinksVerticalListBlock(blocks.StreamBlock): + link = LinkBlock(label=_("Link")) + + class Meta: + icon = "list-ul" + template = "content_manager/blocks/links_vertical_list.html" + + +button_type_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")), +) + + +class ButtonBlock(LinkBlock): + button_type = blocks.ChoiceBlock(label=_("Button type"), choices=button_type_choices, required=False) + + class Meta: + value_class = LinkStructValue + icon = "link" + + +class ButtonsHorizontalListBlock(blocks.StreamBlock): + button = ButtonBlock(label=_("Button")) + + class Meta: + icon = "list-ul" + template = "content_manager/blocks/buttons_horizontal_list.html" + + +class ButtonsVerticalListBlock(blocks.StreamBlock): + button = ButtonBlock(label=_("Button")) + + class Meta: + icon = "list-ul" + 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 = { @@ -78,12 +119,9 @@ class Meta: ## Badges and Tags badge_level_choices = ( - COLOR_CHOICES_SYSTEM - + [ - ("new", _("New")), - ("grey", _("Grey")), - ] - + COLOR_CHOICES_ILLUSTRATION + ("", [("new", _("New")), ("grey", _("Grey"))]), + (_("System colors"), COLOR_CHOICES_SYSTEM), + (_("Illustration colors"), COLOR_CHOICES_ILLUSTRATION), ) @@ -128,6 +166,135 @@ class Meta: template = "content_manager/blocks/tags_list.html" +## Cards + + +class CardstructValue(StructValue): + def enlarge_link(self): + """ + Determine if we need (and can) enlarge the link on the card. + This requires: + - That a link is present + - That no other link is used on the card (such as a tag with a link, or a call-to-action) + """ + url = self.get("url") + document = self.get("document") + top_detail_badges_tags = self.get("top_detail_badges_tags") + call_to_action = self.get("call_to_action") + + if not (url or document): + return False + + enlarge = True + if len(call_to_action): + enlarge = False + elif len(top_detail_badges_tags) and top_detail_badges_tags.raw_data[0]["type"] == "tags": + tags_list = top_detail_badges_tags.raw_data[0]["value"] + for tag in tags_list: + if tag["value"]["link"]["page"] is not None or tag["value"]["link"]["external_url"] != "": + enlarge = False + + return enlarge + + def image_classes(self): + """ + Determine the image classes for a vertical card. Not used in horizontal card. + """ + ratio_class = self.get("image_ratio") + + if ratio_class: + image_classes = f"fr-responsive-img {ratio_class}" + else: + image_classes = "fr-responsive-img" + + return image_classes + + +class CardBlock(blocks.StructBlock): + title = blocks.CharBlock(label=_("Title")) + heading_tag = blocks.ChoiceBlock( + label=_("Heading level"), + choices=HEADING_CHOICES, + default="h3", + help_text=_("Adapt to the page layout. Defaults to heading 3."), + ) + description = blocks.TextBlock(label=_("Content"), help_text=_("Can contain HTML."), required=False) + image = ImageChooserBlock(label=_("Image"), required=False) + image_ratio = blocks.ChoiceBlock( + label=_("Image ratio"), + choices=IMAGE_RATIOS, + required=False, + default="h3", + ) + image_badge = BadgesListBlock( + label=_("Image area badge"), required=False, help_text=_("Only used if the card has an image."), max_num=1 + ) + url = blocks.URLBlock(label=_("Link"), required=False, group="target") + document = DocumentChooserBlock( + label=_("or Document"), + help_text=_("Select a document to make the card link to it (if the 'Link' field is not populated.)"), + required=False, + group="target", + ) + top_detail_text = blocks.CharBlock(label=_("Top detail: text"), required=False) + top_detail_icon = IconPickerBlock(label=_("Top detail: icon"), required=False) + top_detail_badges_tags = blocks.StreamBlock( + [ + ("badges", BadgesListBlock()), + ("tags", TagListBlock()), + ], + label=_("Top detail: badges or tags"), + max_num=1, + required=False, + ) + bottom_detail_text = blocks.CharBlock( + label=_("Bottom detail: text"), + help_text=_("Incompatible with the bottom call-to-action"), + required=False, + ) + bottom_detail_icon = IconPickerBlock(label=_("Bottom detail: icon"), required=False) + call_to_action = blocks.StreamBlock( + [ + ("links", LinksVerticalListBlock()), + ("buttons", ButtonsHorizontalListBlock()), + ], + label=_("Bottom call-to-action: links or buttons"), + help_text=_("Incompatible with the bottom detail text"), + max_num=1, + required=False, + ) + grey_background = blocks.BooleanBlock(label=_("Card with grey background"), required=False) + no_background = blocks.BooleanBlock(label=_("Card without background"), required=False) + no_border = blocks.BooleanBlock(label=_("Card without border"), required=False) + shadow = blocks.BooleanBlock(label=_("Card with a shadow"), required=False) + + class Meta: + icon = "tablet-alt" + template = "content_manager/blocks/card.html" + value_class = CardstructValue + + +class HorizontalCardBlock(CardBlock): + image_ratio = blocks.ChoiceBlock( + label=_("Image ratio"), + choices=HORIZONTAL_CARD_IMAGE_RATIOS, + required=False, + default="h3", + ) + + class Meta: + icon = "tablet-alt" + template = "content_manager/blocks/card_horizontal.html" + value_class = CardstructValue + + +class VerticalCardBlock(CardBlock): + class Meta: + icon = "tablet-alt" + template = "content_manager/blocks/card_vertical.html" + value_class = CardstructValue + + ## Basic blocks class AccordionBlock(blocks.StructBlock): title = blocks.CharBlock(label=_("Title")) @@ -162,23 +329,6 @@ class CalloutBlock(blocks.StructBlock): ) -class CardBlock(blocks.StructBlock): - title = blocks.CharBlock(label=_("Title")) - description = blocks.TextBlock(label=_("Content")) - image = ImageChooserBlock(label=_("Image"), required=False) - url = blocks.URLBlock(label=_("Link"), required=False, group="target") - document = DocumentChooserBlock( - label=_("or Document"), - help_text=_("Select a document to make the card link to it (if the 'Link' field is not populated.)"), - required=False, - group="target", - ) - - class Meta: - icon = "tablet-alt" - template = "content_manager/blocks/card.html" - - class IframeBlock(blocks.StructBlock): title = blocks.CharBlock( label=_("Title"), @@ -350,7 +500,7 @@ class Meta: class MultiColumnsBlock(CommonStreamBlock): - card = CardBlock(label=_("Vertical card")) + card = VerticalCardBlock(label=_("Vertical card")) class Meta: icon = "dots-horizontal" @@ -366,7 +516,9 @@ class MultiColumnsWithTitleBlock(blocks.StructBlock): bg_color = blocks.RegexBlock( label=_("Background color, hexadecimal format (obsolete)"), regex=r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", - help_text="(This field is obsolete and will be removed in the near future. Replace it with the background picture)", # noqa + help_text=_( + "This field is obsolete and will be removed in the near future. Replace it with the background color." # noqa + ), error_messages={"invalid": _("Incorrect color format, must be #fff or #f5f5f5")}, required=False, ) @@ -387,6 +539,7 @@ class Meta: class FullWidthBlock(CommonStreamBlock): image_and_text = ImageAndTextBlock(label=_("Image and text")) + card = HorizontalCardBlock(label=_("Horizontal card")) class Meta: icon = "minus" @@ -410,14 +563,12 @@ class Meta: ("paragraph", blocks.RichTextBlock(label=_("Rich text"))), ("badges_list", BadgesListBlock(label=_("Badge list"))), ("image", ImageBlock()), - ( - "imageandtext", - ImageAndTextBlock(label=_("Image and text")), - ), + ("imageandtext", ImageAndTextBlock(label=_("Image and text"))), ("alert", AlertBlock(label=_("Alert message"))), ("callout", CalloutBlock(label=_("Callout"))), ("quote", QuoteBlock(label=_("Quote"))), ("video", VideoBlock(label=_("Video"))), + ("card", HorizontalCardBlock(label=_("Horizontal card"))), ("accordions", AccordionsBlock(label=_("Accordions"))), ("stepper", StepperBlock(label=_("Stepper"))), ("tags_list", TagListBlock(label=_("Tag list"))), diff --git a/content_manager/constants.py b/content_manager/constants.py index 6f40be80..9c576a4f 100644 --- a/content_manager/constants.py +++ b/content_manager/constants.py @@ -23,3 +23,8 @@ ("info", "Information"), ("warning", "Attention"), ] + +HORIZONTAL_CARD_IMAGE_RATIOS = [ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), +] diff --git a/content_manager/locale/fr/LC_MESSAGES/django.mo b/content_manager/locale/fr/LC_MESSAGES/django.mo index aba9c918..b81ed45d 100644 Binary files a/content_manager/locale/fr/LC_MESSAGES/django.mo and b/content_manager/locale/fr/LC_MESSAGES/django.mo differ diff --git a/content_manager/locale/fr/LC_MESSAGES/django.po b/content_manager/locale/fr/LC_MESSAGES/django.po index ae498689..b8cdc0a4 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-04-26 12:07+0200\n" -"PO-Revision-Date: 2024-04-26 12:08+0200\n" +"POT-Creation-Date: 2024-05-23 16:57+0200\n" +"PO-Revision-Date: 2024-05-23 17:01+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:362 -#: content_manager/blocks.py:398 +#: content_manager/abstract.py:37 content_manager/blocks.py:513 +#: content_manager/blocks.py:552 msgid "Background color" msgstr "Couleur de fond" -#: content_manager/abstract.py:41 content_manager/blocks.py:364 -#: content_manager/blocks.py:400 +#: content_manager/abstract.py:41 content_manager/blocks.py:515 +#: content_manager/blocks.py:554 msgid "Uses the French Design System colors" msgstr "Utilise les couleurs du systĂšme de design de l'Ătat" @@ -48,7 +48,7 @@ msgstr "Assombrir lâimage de fond" msgid "Call to action text" msgstr "Texte de lâappel Ă action" -#: content_manager/abstract.py:54 content_manager/blocks.py:315 +#: content_manager/abstract.py:54 content_manager/blocks.py:466 msgid "Call to action label" msgstr "LibellĂ© de lâappel Ă action" @@ -76,137 +76,163 @@ msgstr "Page de base" msgid "Base pages" msgstr "Pages de base" -#: content_manager/blocks.py:35 +#: content_manager/blocks.py:36 msgid "Page" msgstr "Page" -#: content_manager/blocks.py:37 +#: content_manager/blocks.py:38 msgid "" "Link to a page of this site. Use either this or the external URL parameter." msgstr "" "Lien vers une page du site. Utilisez soit ce champ soit le champ URL externe." -#: content_manager/blocks.py:40 +#: content_manager/blocks.py:41 msgid "External URL" msgstr "URL externe" -#: content_manager/blocks.py:42 +#: content_manager/blocks.py:43 msgid "Use either this or the Page parameter." msgstr "Utilisez soit ce champ soit le champ Page." -#: content_manager/blocks.py:51 +#: content_manager/blocks.py:52 msgid "Link label" msgstr "LibellĂ© du lien" -#: content_manager/blocks.py:83 +#: content_manager/blocks.py:60 content_manager/blocks.py:233 +#: content_manager/blocks.py:370 content_manager/blocks.py:419 +#: content_manager/blocks.py:470 +msgid "Link" +msgstr "Lien" + +#: content_manager/blocks.py:68 +msgid "Primary" +msgstr "Primaire" + +#: content_manager/blocks.py:69 +msgid "Secundary" +msgstr "Secondaire" + +#: content_manager/blocks.py:70 +msgid "Tertiary" +msgstr "Tertiaire" + +#: content_manager/blocks.py:71 +msgid "Tertiary without border" +msgstr "Tertiaire sans bordure" + +#: content_manager/blocks.py:76 +msgid "Button type" +msgstr "Type de bouton" + +#: content_manager/blocks.py:84 content_manager/blocks.py:92 +msgid "Button" +msgstr "Bouton" + +#: content_manager/blocks.py:122 msgid "New" msgstr "Nouveau" -#: content_manager/blocks.py:84 +#: content_manager/blocks.py:122 msgid "Grey" msgstr "Gris" -#: content_manager/blocks.py:91 +#: content_manager/blocks.py:123 +msgid "System colors" +msgstr "Couleurs systĂšme" + +#: content_manager/blocks.py:124 +msgid "Illustration colors" +msgstr "Couleurs illustratives" + +#: content_manager/blocks.py:129 msgid "Badge label" msgstr "Texte du badge" -#: content_manager/blocks.py:92 +#: content_manager/blocks.py:130 msgid "Badge color" msgstr "Couleur du badge" -#: content_manager/blocks.py:93 +#: content_manager/blocks.py:131 msgid "Hide badge icon" msgstr "Masquer lâicĂŽne du badge" -#: content_manager/blocks.py:100 +#: content_manager/blocks.py:138 msgid "Badge" msgstr "Badge" -#: content_manager/blocks.py:108 content_manager/blocks.py:133 -#: content_manager/blocks.py:138 content_manager/blocks.py:166 -#: content_manager/blocks.py:184 content_manager/blocks.py:254 -#: content_manager/blocks.py:297 content_manager/blocks.py:306 -#: content_manager/blocks.py:327 content_manager/blocks.py:373 +#: content_manager/blocks.py:146 content_manager/blocks.py:215 +#: content_manager/blocks.py:301 content_manager/blocks.py:306 +#: content_manager/blocks.py:335 content_manager/blocks.py:405 +#: content_manager/blocks.py:448 content_manager/blocks.py:457 +#: content_manager/blocks.py:478 content_manager/blocks.py:526 #: content_manager/models.py:275 msgid "Title" msgstr "Titre" -#: content_manager/blocks.py:109 +#: content_manager/blocks.py:147 msgid "Small tag" msgstr "Petit tag" -#: content_manager/blocks.py:111 +#: content_manager/blocks.py:149 msgid "Tag color" msgstr "Couleur du tag" -#: content_manager/blocks.py:114 +#: content_manager/blocks.py:152 msgid "Only for clickable tags" msgstr "Uniquement pour les tags cliquables" -#: content_manager/blocks.py:116 +#: content_manager/blocks.py:154 msgid "Icon" msgstr "IcĂŽne" -#: content_manager/blocks.py:124 +#: content_manager/blocks.py:162 msgctxt "DSFR Tag" msgid "Tag" msgstr "Tag" -#: content_manager/blocks.py:134 content_manager/blocks.py:167 -#: content_manager/blocks.py:402 -msgid "Content" -msgstr "Contenu" - -#: content_manager/blocks.py:139 -msgid "Accordion" -msgstr "AccordĂ©on" - -#: content_manager/blocks.py:143 -msgid "Message title" -msgstr "Titre du message" - -#: content_manager/blocks.py:144 -msgid "Message text" -msgstr "Texte du message" - -#: content_manager/blocks.py:145 -msgid "Message type" -msgstr "Type de message" - -#: content_manager/blocks.py:147 content_manager/blocks.py:158 -#: content_manager/blocks.py:256 content_manager/blocks.py:375 +#: content_manager/blocks.py:217 content_manager/blocks.py:315 +#: content_manager/blocks.py:326 content_manager/blocks.py:407 +#: content_manager/blocks.py:528 msgid "Heading level" msgstr "Niveau de titre" -#: content_manager/blocks.py:150 content_manager/blocks.py:161 -#: content_manager/blocks.py:260 +#: content_manager/blocks.py:220 content_manager/blocks.py:318 +#: content_manager/blocks.py:329 content_manager/blocks.py:411 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:155 -msgid "Callout title" -msgstr "Titre de lâappel Ă action" +#: content_manager/blocks.py:222 content_manager/blocks.py:302 +#: content_manager/blocks.py:556 +msgid "Content" +msgstr "Contenu" -#: content_manager/blocks.py:156 -msgid "Callout text" -msgstr "Texte de lâappel Ă action" +#: content_manager/blocks.py:222 +msgid "Can contain HTML." +msgstr "Peut contenir du HTML." -#: content_manager/blocks.py:168 content_manager/blocks.py:199 -#: content_manager/blocks.py:262 content_manager/blocks.py:276 -#: content_manager/blocks.py:342 +#: content_manager/blocks.py:223 content_manager/blocks.py:350 +#: content_manager/blocks.py:413 content_manager/blocks.py:427 +#: content_manager/blocks.py:493 msgid "Image" msgstr "Image" -#: content_manager/blocks.py:169 content_manager/blocks.py:219 -#: content_manager/blocks.py:268 content_manager/blocks.py:319 -msgid "Link" -msgstr "Lien" +#: content_manager/blocks.py:225 content_manager/blocks.py:280 +msgid "Image ratio" +msgstr "Ratio de lâimage" + +#: content_manager/blocks.py:231 +msgid "Image area badge" +msgstr "Badge de la zone image" -#: content_manager/blocks.py:171 +#: content_manager/blocks.py:231 +msgid "Only used if the card has an image." +msgstr "Uniquement utilisĂ© si la carte a une image." + +#: content_manager/blocks.py:235 msgid "or Document" msgstr "ou Document" -#: content_manager/blocks.py:172 +#: content_manager/blocks.py:236 msgid "" "Select a document to make the card link to it (if the 'Link' field is not " "populated.)" @@ -214,7 +240,79 @@ msgstr "" "SĂ©lectionnez un document pour faire pointer la carte dessus (si le champ " "« Lien » est vide.)" -#: content_manager/blocks.py:185 +#: content_manager/blocks.py:240 +msgid "Top detail: text" +msgstr "DĂ©tail du haut : texte" + +#: content_manager/blocks.py:241 +msgid "Top detail: icon" +msgstr "DĂ©tail du haut : icĂŽne" + +#: content_manager/blocks.py:247 +msgid "Top detail: badges or tags" +msgstr "DĂ©tail du haut : badges ou tags" + +#: content_manager/blocks.py:252 +msgid "Bottom detail: text" +msgstr "DĂ©tail du bas : texte" + +#: content_manager/blocks.py:253 +msgid "Incompatible with the bottom call-to-action" +msgstr "Incompatible avec lâappel Ă action en bas de carte" + +#: content_manager/blocks.py:256 +msgid "Bottom detail: icon" +msgstr "DĂ©tail du bas : icĂŽne" + +#: content_manager/blocks.py:262 +msgid "Bottom call-to-action: links or buttons" +msgstr "Appel Ă action en bas de la carte" + +#: content_manager/blocks.py:263 +msgid "Incompatible with the bottom detail text" +msgstr "Incompatible avec le dĂ©tail du bas" + +#: content_manager/blocks.py:267 +msgid "Card with grey background" +msgstr "Carte avec arriĂšre-plan gris" + +#: content_manager/blocks.py:268 +msgid "Card without background" +msgstr "Carte sans arriĂšre-plan" + +#: content_manager/blocks.py:269 +msgid "Card without border" +msgstr "Carte sans bordure" + +#: content_manager/blocks.py:270 +msgid "Card with a shadow" +msgstr "Carte avec une ombre" + +#: content_manager/blocks.py:307 +msgid "Accordion" +msgstr "AccordĂ©on" + +#: content_manager/blocks.py:311 +msgid "Message title" +msgstr "Titre du message" + +#: content_manager/blocks.py:312 +msgid "Message text" +msgstr "Texte du message" + +#: content_manager/blocks.py:313 +msgid "Message type" +msgstr "Type de message" + +#: content_manager/blocks.py:323 +msgid "Callout title" +msgstr "Titre de lâappel Ă action" + +#: content_manager/blocks.py:324 +msgid "Callout text" +msgstr "Texte de lâappel Ă action" + +#: content_manager/blocks.py:336 msgid "" "Accessibility: The title should describe, in a clear and concise manner, the " "embedded content." @@ -222,49 +320,49 @@ msgstr "" "AccessibilitĂ© : Le titre doit dĂ©crire, de façon claire et concise, le " "contenu embarquĂ©." -#: content_manager/blocks.py:188 +#: content_manager/blocks.py:339 msgid "URL of the iframe" msgstr "URL de lâiframe" -#: content_manager/blocks.py:189 +#: content_manager/blocks.py:340 msgid "Example for Tally: https://tally.so/embed/w2jMRa" msgstr "Exemple pour Tally : https://tally.so/embed/w2jMRa" -#: content_manager/blocks.py:191 +#: content_manager/blocks.py:342 msgid "Height (in pixels)" msgstr "Hauteur (en pixels)" -#: content_manager/blocks.py:201 +#: content_manager/blocks.py:352 msgid "Side where the image is displayed" msgstr "CĂŽtĂ© oĂč afficher lâimage" -#: content_manager/blocks.py:203 +#: content_manager/blocks.py:354 msgid "Left" msgstr "Gauche" -#: content_manager/blocks.py:204 +#: content_manager/blocks.py:355 msgid "Right" msgstr "Droite" -#: content_manager/blocks.py:209 +#: content_manager/blocks.py:360 msgid "Image width" msgstr "Largeur de lâimage" -#: content_manager/blocks.py:217 content_manager/blocks.py:313 -#: content_manager/blocks.py:341 content_manager/blocks.py:410 +#: content_manager/blocks.py:368 content_manager/blocks.py:464 +#: content_manager/blocks.py:492 content_manager/blocks.py:564 msgid "Rich text" msgstr "Texte avec mise en forme" -#: content_manager/blocks.py:221 +#: content_manager/blocks.py:372 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:224 +#: content_manager/blocks.py:375 msgid "Link label (obsolete)" msgstr "LibellĂ© du lien (obsolĂšte)" -#: content_manager/blocks.py:227 content_manager/blocks.py:235 -#: content_manager/blocks.py:243 +#: content_manager/blocks.py:378 content_manager/blocks.py:386 +#: content_manager/blocks.py:394 msgid "" "This field is obsolete and will be removed in the near future. Please " "replace with the Link field above." @@ -272,160 +370,172 @@ msgstr "" "Ce champ est obsolĂšte et sera prochainement supprimĂ©. Merci de le remplacer " "avec le champ Lien ci-dessus." -#: content_manager/blocks.py:232 +#: content_manager/blocks.py:383 msgid "Internal link (obsolete)" msgstr "Lien interne (obsolĂšte)" -#: content_manager/blocks.py:240 +#: content_manager/blocks.py:391 msgid "Link URL (obsolete)" msgstr "URL du lien (obsolĂšte)" -#: content_manager/blocks.py:264 +#: content_manager/blocks.py:415 msgid "Alternative text (textual description of the image)" msgstr "Alternative textuelle (description textuelle de lâimage)" -#: content_manager/blocks.py:267 content_manager/blocks.py:328 +#: content_manager/blocks.py:418 content_manager/blocks.py:479 msgid "Caption" msgstr "LĂ©gende" -#: content_manager/blocks.py:277 content_manager/blocks.py:344 -#: content_manager/blocks.py:419 +#: content_manager/blocks.py:428 content_manager/blocks.py:495 +#: content_manager/blocks.py:570 msgid "Quote" msgstr "Citation" -#: content_manager/blocks.py:278 +#: content_manager/blocks.py:429 msgid "Author name" msgstr "Nom de lâauteur" -#: content_manager/blocks.py:279 +#: content_manager/blocks.py:430 msgid "Author title" msgstr "Titre de lâauteur" -#: content_manager/blocks.py:281 +#: content_manager/blocks.py:432 msgid "Color" msgstr "Couleur" -#: content_manager/blocks.py:292 +#: content_manager/blocks.py:443 msgid "Top margin" msgstr "Espacement au dessus" -#: content_manager/blocks.py:293 +#: content_manager/blocks.py:444 msgid "Bottom margin" msgstr "Espacement en dessous" -#: content_manager/blocks.py:298 +#: content_manager/blocks.py:449 msgid "Detail" msgstr "DĂ©tail" -#: content_manager/blocks.py:302 +#: content_manager/blocks.py:453 msgid "Step" msgstr "Ătape" -#: content_manager/blocks.py:307 +#: content_manager/blocks.py:458 msgid "Number of steps" msgstr "Nombre dâĂ©tapes" -#: content_manager/blocks.py:308 +#: content_manager/blocks.py:459 msgid "Current step" msgstr "Ătape actuelle" -#: content_manager/blocks.py:309 +#: content_manager/blocks.py:460 msgid "Steps" msgstr "Ătapes" -#: content_manager/blocks.py:316 +#: content_manager/blocks.py:467 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:330 +#: content_manager/blocks.py:481 msgid "Video URL" msgstr "URL de la vidĂ©o" -#: content_manager/blocks.py:343 content_manager/blocks.py:420 +#: content_manager/blocks.py:494 content_manager/blocks.py:571 msgid "Video" msgstr "VidĂ©o" -#: content_manager/blocks.py:345 +#: content_manager/blocks.py:496 msgid "Text and call to action" msgstr "Texte et appel Ă action" -#: content_manager/blocks.py:346 +#: content_manager/blocks.py:497 msgid "Iframe" msgstr "Iframe" -#: content_manager/blocks.py:353 +#: content_manager/blocks.py:504 msgid "Vertical card" msgstr "Carte verticale" -#: content_manager/blocks.py:360 content_manager/blocks.py:396 +#: content_manager/blocks.py:511 content_manager/blocks.py:550 msgid "Background image" msgstr "Image de fond" -#: content_manager/blocks.py:367 +#: content_manager/blocks.py:518 msgid "Background color, hexadecimal format (obsolete)" msgstr "Couleur de fond, format hexadĂ©cimal (obsolĂšte)" -#: content_manager/blocks.py:370 +#: content_manager/blocks.py:521 +msgid "" +"This field is obsolete and will be removed in the near future. Replace it " +"with the background color." +msgstr "" +"Ce champ est obsolĂšte et sera prochainement supprimĂ©. Merci de le remplacer " +"avec la couleur de fond." + +#: content_manager/blocks.py:523 msgid "Incorrect color format, must be #fff or #f5f5f5" msgstr "Format de couleur incorrect, doit ĂȘtre #fff ou #f5f5f5" -#: content_manager/blocks.py:379 +#: content_manager/blocks.py:532 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:381 +#: content_manager/blocks.py:534 msgid "Columns" msgstr "Colonnes" -#: content_manager/blocks.py:389 content_manager/blocks.py:415 +#: content_manager/blocks.py:542 content_manager/blocks.py:567 msgid "Image and text" msgstr "Image et texte" -#: content_manager/blocks.py:411 +#: content_manager/blocks.py:543 content_manager/blocks.py:572 +msgid "Horizontal card" +msgstr "Carte horizontale" + +#: content_manager/blocks.py:565 msgid "Badge list" msgstr "Liste de badges" -#: content_manager/blocks.py:417 +#: content_manager/blocks.py:568 msgid "Alert message" msgstr "Message dâalerte" -#: content_manager/blocks.py:418 +#: content_manager/blocks.py:569 msgid "Callout" msgstr "Texte mis en avant" -#: content_manager/blocks.py:421 +#: content_manager/blocks.py:573 msgid "Accordions" msgstr "AccordĂ©ons" -#: content_manager/blocks.py:422 +#: content_manager/blocks.py:574 msgid "Stepper" msgstr "Ătapier" -#: content_manager/blocks.py:423 +#: content_manager/blocks.py:575 msgid "Tag list" msgstr "Liste de tags" -#: content_manager/blocks.py:424 +#: content_manager/blocks.py:576 msgid "Markdown" msgstr "Markdown" -#: content_manager/blocks.py:425 +#: content_manager/blocks.py:577 msgid "Separator" msgstr "SĂ©parateur" -#: content_manager/blocks.py:426 +#: content_manager/blocks.py:578 msgid "Multiple columns" msgstr "Multi-colonnes" -#: content_manager/blocks.py:426 content_manager/blocks.py:427 +#: content_manager/blocks.py:578 content_manager/blocks.py:579 msgid "Page structure" msgstr "Structure de la page" -#: content_manager/blocks.py:427 +#: content_manager/blocks.py:579 msgid "Full width background" msgstr "Fond pleine largeur" -#: content_manager/blocks.py:441 +#: content_manager/blocks.py:593 msgid "" "Warning: Use HTML block with caution. Malicious code can compromise the " "security of the site." @@ -611,7 +721,7 @@ msgstr "Maximum 4 catĂ©gories, chacune contenant maximum 8 liens." msgid "Mega menu" msgstr "MĂ©ga menu" -#: content_manager/urls.py:18 +#: content_manager/urls.py:9 msgid "search/" msgstr "recherche/" diff --git a/content_manager/migrations/0025_alter_contentpage_body.py b/content_manager/migrations/0025_alter_contentpage_body.py new file mode 100644 index 00000000..2cdb08cb --- /dev/null +++ b/content_manager/migrations/0025_alter_contentpage_body.py @@ -0,0 +1,2799 @@ +# Generated by Django 5.0.6 on 2024-05-23 15:04 + +import wagtail.blocks +import wagtail.documents.blocks +import wagtail.fields +import wagtail.images.blocks +import wagtailmarkdown.blocks +from django.db import migrations + +import content_manager.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("content_manager", "0024_alter_socialmediaitem_options"), + ] + + operations = [ + migrations.AlterField( + model_name="contentpage", + name="body", + field=wagtail.fields.StreamField( + [ + ("paragraph", wagtail.blocks.RichTextBlock(label="Rich text")), + ( + "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", + ), + ), + ( + "image", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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 + ), + ), + ("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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ("text", wagtail.blocks.CharBlock(label="Link label", 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", "Erreur"), + ("success", "SuccĂšs"), + ("info", "Information"), + ("warning", "Attention"), + ], + label="Message type", + ), + ), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Alert message", + ), + ), + ( + "callout", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Callout title", required=False)), + ("text", wagtail.blocks.TextBlock(label="Callout text", required=False)), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ], + label="Callout", + ), + ), + ( + "quote", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ("quote", wagtail.blocks.CharBlock(label="Quote")), + ("author_name", wagtail.blocks.CharBlock(label="Author name")), + ("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="Quote", + ), + ), + ( + "video", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title", required=False)), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", label="Content", required=False + ), + ), + ("image", wagtail.images.blocks.ImageChooserBlock(label="Image", required=False)), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", required=False + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ("", [("new", "New"), ("grey", "Grey")]), + ( + "System colors", + [ + ("info", "Info"), + ("success", "Success"), + ("warning", "Warning"), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ("green-bourgeon", "Bourgeon"), + ("green-emeraude", "Ămeraude"), + ("green-menthe", "Menthe"), + ("green-archipel", "Archipel"), + ("blue-ecume", "Ăcume"), + ("blue-cumulus", "Cumulus"), + ("purple-glycine", "Glycine"), + ("pink-macaron", "Macaron"), + ("pink-tuile", "Tuile"), + ("yellow-tournesol", "Tournesol"), + ("yellow-moutarde", "Moutarde"), + ("orange-terre-battue", "Terre battue"), + ("brown-cafe-creme", "CafĂ© crĂšme"), + ("brown-caramel", "Caramel"), + ("brown-opera", "OpĂ©ra"), + ("beige-gris-galet", "Gris galet"), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", required=False + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ("url", wagtail.blocks.URLBlock(group="target", label="Link", required=False)), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", required=False + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-btn", "Primary"), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock(label="Card with grey background", required=False), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock(label="Card without background", required=False), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock(label="Card without border", required=False), + ), + ("shadow", wagtail.blocks.BooleanBlock(label="Card with a shadow", required=False)), + ], + label="Horizontal card", + ), + ), + ( + "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, + ), + ), + ], + 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", + ), + ), + ], + label="Stepper", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ], + required=False, + ), + ), + ], + label="Tag", + ), + ) + ], + label="Tag list", + ), + ), + ("markdown", wagtailmarkdown.blocks.MarkdownBlock(label="Markdown")), + ( + "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 + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "card", + wagtail.blocks.StructBlock( + [ + ("title", wagtail.blocks.CharBlock(label="Title")), + ( + "heading_tag", + wagtail.blocks.ChoiceBlock( + choices=[ + ("h2", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Vertical card", + ), + ), + ], + 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + 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, + ), + ), + ( + "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="Title", required=False), + ), + ("caption", wagtail.blocks.CharBlock(label="Caption")), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Use embed format (e.g. : https://www.youtube.com/embed/gLzXOViPX-0)", + label="Video URL", + ), + ), + ], + label="Video", + ), + ), + ( + "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")), + ( + "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="Quote", + ), + ), + ( + "text_cta", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.RichTextBlock( + label="Rich text", required=False + ), + ), + ( + "cta_label", + wagtail.blocks.CharBlock( + help_text="The link appears as a button under the text block", + label="Call to action label", + required=False, + ), + ), + ( + "cta_url", + wagtail.blocks.CharBlock(label="Link", required=False), + ), + ], + label="Text and call to action", + ), + ), + ( + "iframe", + wagtail.blocks.StructBlock( + [ + ( + "title", + wagtail.blocks.CharBlock( + help_text="Accessibility: The title should describe, in a clear and concise manner, the embedded content.", + label="Title", + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + help_text="Example for Tally: https://tally.so/embed/w2jMRa", + label="URL of the iframe", + ), + ), + ( + "height", + wagtail.blocks.IntegerBlock(label="Height (in pixels)"), + ), + ], + label="Iframe", + ), + ), + ( + "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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", 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", "En-tĂȘte 2"), + ("h3", "En-tĂȘte 3"), + ("h4", "En-tĂȘte 4"), + ("h5", "En-tĂȘte 5"), + ("h6", "En-tĂȘte 6"), + ("p", "Paragraphe"), + ], + help_text="Adapt to the page layout. Defaults to heading 3.", + label="Heading level", + ), + ), + ( + "description", + wagtail.blocks.TextBlock( + help_text="Can contain HTML.", + label="Content", + required=False, + ), + ), + ( + "image", + wagtail.images.blocks.ImageChooserBlock( + label="Image", required=False + ), + ), + ( + "image_ratio", + wagtail.blocks.ChoiceBlock( + choices=[ + ("fr-card--horizontal-tier", "1/3"), + ("fr-card--horizontal-half", "50/50"), + ], + label="Image ratio", + required=False, + ), + ), + ( + "image_badge", + wagtail.blocks.StreamBlock( + [ + ( + "badge", + wagtail.blocks.StructBlock( + [ + ( + "text", + wagtail.blocks.CharBlock( + label="Badge label", + required=False, + ), + ), + ( + "color", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "", + [ + ("new", "New"), + ("grey", "Grey"), + ], + ), + ( + "System colors", + [ + ("info", "Info"), + ( + "success", + "Success", + ), + ( + "warning", + "Warning", + ), + ("error", "Error"), + ], + ), + ( + "Illustration colors", + [ + ( + "green-tilleul-verveine", + "Tilleul verveine", + ), + ( + "green-bourgeon", + "Bourgeon", + ), + ( + "green-emeraude", + "Ămeraude", + ), + ( + "green-menthe", + "Menthe", + ), + ( + "green-archipel", + "Archipel", + ), + ( + "blue-ecume", + "Ăcume", + ), + ( + "blue-cumulus", + "Cumulus", + ), + ( + "purple-glycine", + "Glycine", + ), + ( + "pink-macaron", + "Macaron", + ), + ( + "pink-tuile", + "Tuile", + ), + ( + "yellow-tournesol", + "Tournesol", + ), + ( + "yellow-moutarde", + "Moutarde", + ), + ( + "orange-terre-battue", + "Terre battue", + ), + ( + "brown-cafe-creme", + "CafĂ© crĂšme", + ), + ( + "brown-caramel", + "Caramel", + ), + ( + "brown-opera", + "OpĂ©ra", + ), + ( + "beige-gris-galet", + "Gris galet", + ), + ], + ), + ], + label="Badge color", + required=False, + ), + ), + ( + "hide_icon", + wagtail.blocks.BooleanBlock( + label="Hide badge icon", + required=False, + ), + ), + ], + label="Badge", + ), + ) + ], + help_text="Only used if the card has an image.", + label="Image area badge", + max_num=1, + required=False, + ), + ), + ( + "url", + wagtail.blocks.URLBlock( + group="target", label="Link", required=False + ), + ), + ( + "document", + wagtail.documents.blocks.DocumentChooserBlock( + group="target", + help_text="Select a document to make the card link to it (if the 'Link' field is not populated.)", + label="or Document", + 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this 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 or the external URL parameter.", + label="Page", + required=False, + ), + ), + ( + "external_url", + wagtail.blocks.URLBlock( + help_text="Use either this or the Page parameter.", + label="External URL", + required=False, + ), + ), + ( + "text", + wagtail.blocks.CharBlock( + label="Link label", + required=False, + ), + ), + ( + "button_type", + wagtail.blocks.ChoiceBlock( + choices=[ + ( + "fr-btn", + "Primary", + ), + ( + "fr-btn fr-btn--secondary", + "Secundary", + ), + ( + "fr-btn fr-btn--tertiary", + "Tertiary", + ), + ( + "fr-btn fr-btn--tertiary-no-outline", + "Tertiary without border", + ), + ], + label="Button type", + required=False, + ), + ), + ], + label="Button", + ), + ) + ] + ), + ), + ], + help_text="Incompatible with the bottom detail text", + label="Bottom call-to-action: links or buttons", + max_num=1, + required=False, + ), + ), + ( + "grey_background", + wagtail.blocks.BooleanBlock( + label="Card with grey background", required=False + ), + ), + ( + "no_background", + wagtail.blocks.BooleanBlock( + label="Card without background", required=False + ), + ), + ( + "no_border", + wagtail.blocks.BooleanBlock( + label="Card without border", required=False + ), + ), + ( + "shadow", + wagtail.blocks.BooleanBlock( + label="Card with a shadow", required=False + ), + ), + ], + label="Horizontal card", + ), + ), + ], + label="Content", + ), + ), + ], + group="Page structure", + label="Full width background", + ), + ), + ( + "html", + wagtail.blocks.RawHTMLBlock( + help_text="Warning: Use HTML block with caution. Malicious code can compromise the security of the site.", + readonly=True, + ), + ), + ], + blank=True, + ), + ), + ] diff --git a/content_manager/templates/content_manager/blocks/blocks_stream.html b/content_manager/templates/content_manager/blocks/blocks_stream.html index a983b8b4..7dc3fa57 100644 --- a/content_manager/templates/content_manager/blocks/blocks_stream.html +++ b/content_manager/templates/content_manager/blocks/blocks_stream.html @@ -17,6 +17,8 @@ {% include_block block %} {% elif block.block_type == 'paragraph' %}
{{ value.description|linebreaksbr }}
-{{ value.description|safe }}
+ {% if value.top_detail_badges_tags or value.top_detail_text %} ++ {{ value.top_detail_text }} +
+ {% endif %} ++ {{ value.bottom_detail_text }} +
+{{ value.description|safe }}
+ {% if value.top_detail_badges_tags or value.top_detail_text %} ++ {{ value.top_detail_text }} +
+ {% endif %} ++ {{ value.bottom_detail_text }} +
+This is a sample card.
""", response.content.decode()) + + def test_card_with_no_link_does_not_have_enlarge_class(self): + url = self.content_page.url + response = self.client.get(url) + + # The page header and footer have the class on the bloc-marque, + # The card with no link should not, so count should be 2 + self.assertContains(response, "fr-enlarge-link", count=2) + + def test_card_with_main_link(self): + body = [ + ( + "card", + {"title": "Sample card", "description": "This is a sample card.", "url": "https://www.info.gouv.fr"}, + ) + ] + self.content_page.body = body + self.content_page.save() + + url = self.content_page.url + response = self.client.get(url) + + # Count = 3 (page header and footer, card) + self.assertContains(response, "fr-enlarge-link", count=3) + + self.assertInHTML("""Sample card""", response.content.decode()) + + def test_card_with_cta_links(self): + body = [ + ( + "card", + { + "title": "Sample card", + "description": "This is a sample card.", + "url": "https://www.info.gouv.fr", + "call_to_action": [ + { + "type": "links", + "value": [ + { + "type": "link", + "value": { + "page": None, + "text": "Lien externe", + "external_url": "https://numerique.gouv.fr", + }, + } + ], + } + ], + }, + ) + ] + self.content_page.body = body + self.content_page.save() + + url = self.content_page.url + response = self.client.get(url) + + # Count = 3 (page header and footer, but not the card as it has several links) + self.assertContains(response, "fr-enlarge-link", count=2) + + self.assertInHTML("""Sample card""", response.content.decode()) + + self.assertInHTML( + """