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

Améliorer l'affichage des labels pour les messages #771

Merged
merged 1 commit into from
Mar 3, 2025
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
16 changes: 6 additions & 10 deletions core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,13 @@ def __init__(self, *args, **kwargs):


class MessageForm(DSFRForm, WithNextUrlMixin, WithContentTypeMixin, forms.ModelForm):
recipients = ContactModelMultipleChoiceField(
queryset=Contact.objects.none(), label_suffix="", label="Destinataires :"
)
recipients = ContactModelMultipleChoiceField(queryset=Contact.objects.none(), label="Destinataires*")
recipients_structures_only = ContactModelMultipleChoiceField(
queryset=Contact.objects.none(), label_suffix="", label="Destinataires :"
)
recipients_copy = ContactModelMultipleChoiceField(
queryset=Contact.objects.none(), required=False, label="Copie :", label_suffix=""
queryset=Contact.objects.none(), label="Destinataires*"
)
recipients_copy = ContactModelMultipleChoiceField(queryset=Contact.objects.none(), required=False, label="Copie")
recipients_copy_structures_only = ContactModelMultipleChoiceField(
queryset=Contact.objects.none(), required=False, label="Copie :", label_suffix=""
queryset=Contact.objects.none(), required=False, label="Copie"
)
recipients_limited_recipients = forms.MultipleChoiceField(
choices=[("mus", "MUS"), ("bsv", "BSV")],
Expand Down Expand Up @@ -214,13 +210,13 @@ def _get_structures(self, obj):
def _get_recipients_label(self, obj):
structure_ids = ",".join([str(c.id) for c in self._get_structures(obj)])
return mark_safe(
f"Destinataires :<a href='#' class='fr-link destinataires-shortcut' data-structures='{structure_ids}'>Ajouter toutes les structures de la fiche</a>"
f"Destinataires*<a href='#' class='fr-link destinataires-shortcut' data-structures='{structure_ids}'>Ajouter toutes les structures de la fiche</a>"
)

def _get_recipients_copy_label(self, obj):
structure_ids = ",".join([str(c.id) for c in self._get_structures(obj)])
return mark_safe(
f"Copie :<a href='#' class='fr-link copie-shortcut' data-structures='{structure_ids}'>Ajouter toutes les structures de la fiche</a>"
f"Copie <a href='#' class='fr-link copie-shortcut' data-structures='{structure_ids}'>Ajouter toutes les structures de la fiche</a>"
)

def __init__(self, *args, sender, **kwargs):
Expand Down
6 changes: 4 additions & 2 deletions core/static/core/message.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
align-items: center;
justify-content: space-between
}

label[for=id_recipients]::after, label[for=id_recipients_structures_only]::after{
content: none !important;
}
.btn-full{
width: 100%;
display: block;
Expand All @@ -30,7 +32,7 @@
display: flex;
justify-content: end;
}
label[for=id_recipients], label[for=id_recipients_copy]
label[for=id_recipients], label[for=id_recipients_copy], label[for=id_recipients_structures_only], label[for=id_recipients_copy_structures_only]
{
display: flex;
justify-content: space-between;
Expand Down
Loading