Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Correction d'un bug d'accessibilité sur le composant alerte #59

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions content_manager/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@

# Wagtail Block Documentation : https://docs.wagtail.org/en/stable/reference/streamfield/blocks.html

HEADING_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"),
]

LEVEL_CHOICES = [
("error", "Erreur"),
("success", "Succès"),
("info", "Information"),
("warning", "Attention"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai l'impression qu'"Attention" c'est un peu étrange. Est-ce que "Avertissement" ça te conviendrait ?

]


## Basic blocks
class AccordionBlock(blocks.StructBlock):
Expand All @@ -17,18 +33,16 @@ class AccordionsBlock(blocks.StreamBlock):
accordion = AccordionBlock(label="Accordéon", min_num=1, max_num=15)


level_choices = [
("error", "Erreur"),
("success", "Succès"),
("info", "Information"),
("warning", "Attention"),
]


class AlertBlock(blocks.StructBlock):
title = blocks.CharBlock(label="Titre du message", required=False)
description = blocks.TextBlock(label="Texte du message", required=False)
level = blocks.ChoiceBlock(label="Type de message", choices=level_choices)
level = blocks.ChoiceBlock(label="Type de message", choices=LEVEL_CHOICES)
heading_tag = blocks.ChoiceBlock(
label="Niveau de titre",
choices=HEADING_CHOICES,
default="h3",
help_text="À adapter à la structure de la page. Par défaut en-tête 3.",
)


badge_level_choices = [
Expand All @@ -53,22 +67,12 @@ class BadgesListBlock(blocks.StreamBlock):
badge = BadgeBlock(label="Badge")


heading_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"),
]


class CalloutBlock(blocks.StructBlock):
title = blocks.CharBlock(label="Titre de la mise en vant", required=False)
text = blocks.TextBlock(label="Texte mis en avant", required=False)
heading_tag = blocks.ChoiceBlock(
label="Niveau de titre",
choices=heading_choices,
choices=HEADING_CHOICES,
default="h3",
help_text="À adapter à la structure de la page. Par défaut en-tête 3.",
)
Expand Down
Loading