Changements sur le caractère obligatoire / facultatif et l'asterisque interface usager et page de connexion

This commit is contained in:
Kara Diaby 2023-05-15 14:54:07 +02:00
parent 0d1754d715
commit 804f89f444
18 changed files with 42 additions and 24 deletions

View file

@ -0,0 +1,2 @@
class EditableChamp::AsteriskMandatoryComponent < ApplicationComponent
end

View file

@ -0,0 +1,2 @@
en:
required: required

View file

@ -0,0 +1,2 @@
fr:
required: obligatoire

View file

@ -0,0 +1,3 @@
%svg.icon.mandatory{ xmlns: "http://www.w3.org/2000/svg", role: "img", 'aria-label': t('.required'), width: 10, height: 10, viewBox: "0 0 1200 1200", "xml:space" => "preserve" }
%desc= t('.required')
%path{ d: "M489.838 29.354v443.603L68.032 335.894 0 545.285l421.829 137.086-260.743 358.876 178.219 129.398L600.048 811.84l260.673 358.806 178.146-129.398-260.766-358.783L1200 545.379l-68.032-209.403-421.899 137.07V29.443H489.84l-.002-.089z" }

View file

@ -3,3 +3,4 @@ en:
changes_to_save: "modifications to submit"
modified_at: "modified on %{datetime}"
check_content_rebased: The type of this field or its description has been modified by the administration. Check its content.
optional_champ: (optional)

View file

@ -2,4 +2,5 @@
fr:
changes_to_save: "modification à déposer"
modified_at: "modifié le %{datetime}"
check_content_rebased: Le type de ce champ ou sa description ont été modifiés par ladministration. Vérifier son contenu.
check_content_rebased: Le type de ce champ ou sa description ont été modifiés par l'administration. Vérifier son contenu.
optional_champ: (facultatif)

View file

@ -1,6 +1,8 @@
#{@champ.libelle}
- if @champ.mandatory?
%span.mandatory *
= @champ.libelle
- if @champ.mandatory? && @champ.type_champ != "checkbox"
= render EditableChamp::AsteriskMandatoryComponent.new
- elsif !@champ.mandatory?
= "#{t('.optional_champ')}"
- if @champ.forked_with_changes?
%span.updated-at.highlighted
@ -9,6 +11,7 @@
%span.updated-at{ class: highlight_if_unseen_class }
= t('.modified_at', datetime: try_format_datetime(@champ.updated_at))
- if @champ.rebased_at.present? && @champ.rebased_at > (@seen_at || @champ.updated_at) && current_user.owns_or_invite?(@champ.dossier)
%span.updated-at.highlighted
= t('.check_content_rebased')

View file

@ -1,4 +1,4 @@
= @form.check_box :value,
{ required: @champ.required?, id: @champ.input_id, checked: @champ.true?, aria: { describedby: @champ.describedby_id } },
{ required: @champ.required?, id: @champ.input_id, checked: @champ.true?, aria: { describedby: @champ.describedby_id }, class: class_names('required' => @champ.required?)},
'true',
'false'