refactor(section): update section components

This commit is contained in:
Paul Chavard 2023-11-28 16:27:09 +00:00
parent 283ee72d51
commit 02591da16b
7 changed files with 59 additions and 37 deletions

View file

@ -1,10 +1,9 @@
- each_champ do |champ|
- if champ.repetition?
- champ.rows.each.with_index do |row, i|
.fr-background-alt--grey.fr-p-2w.fr-my-3w.fr-ml-2w.champ-repetition
%p.font-weight-bold= "#{champ.libelle} #{i + 1} :"
= render Dossiers::ChampsRowsShowComponent.new(champs: row, seen_at:, profile:)
- types_de_champ = champ.dossier.revision.children_of(champ.type_de_champ)
- champs_by_stable_id_with_row = champ.dossier.champs_by_stable_id_with_row
- champ.row_ids.each do |row_id|
= render ViewableChamp::SectionComponent.new(types_de_champ:, champs_by_stable_id_with_row:, row_id:, demande_seen_at: seen_at, profile:)
- else
= render Dossiers::RowShowComponent.new(label: champ.libelle, seen_at:, profile:, content_class: champ.type_champ, updated_at: updated_after_deposer?(champ) ? champ.updated_at : nil) do |c|