replace html labels with h2 elements
Some elements should not be html labels, for example when they include sub-elements that contain labels (ex: a radio button that has a label on its own). Those are replaced with title elements
This commit is contained in:
parent
62591623f4
commit
1a58dd69c2
4 changed files with 26 additions and 8 deletions
|
@ -1,11 +1,10 @@
|
|||
= form.label champ.main_value_name do
|
||||
#{champ.libelle}
|
||||
- if champ.mandatory?
|
||||
%span.mandatory *
|
||||
|
||||
- if champ.updated_at.present? && seen_at.present?
|
||||
%span.updated-at{ class: highlight_if_unseen_class(seen_at, champ.updated_at) }
|
||||
= "modifié le #{try_format_datetime(champ.updated_at)}"
|
||||
= # we do this trick because some html elements should use 'label' and some should be plain paragraphs
|
||||
- if has_html_label?(champ)
|
||||
%h2.label-not-label
|
||||
= render partial: 'shared/dossiers/editable_champs/champ_label_content', locals: { champ: champ, seen_at: seen_at }
|
||||
- else
|
||||
= form.label champ.main_value_name do
|
||||
= render partial: 'shared/dossiers/editable_champs/champ_label_content', locals: { champ: champ, seen_at: seen_at }
|
||||
|
||||
- if champ.description.present?
|
||||
.notice{ id: describedby_id(champ) }= string_to_html(champ.description)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#{champ.libelle}
|
||||
- if champ.mandatory?
|
||||
%span.mandatory *
|
||||
|
||||
- if champ.updated_at.present? && seen_at.present?
|
||||
%span.updated-at{ class: highlight_if_unseen_class(seen_at, champ.updated_at) }
|
||||
= "modifié le #{try_format_datetime(champ.updated_at)}"
|
Loading…
Add table
Add a link
Reference in a new issue