demarches-normaliennes/app/components/viewable_champ/section_component/section_component.html.haml

15 lines
1.1 KiB
Text
Raw Normal View History

= tag.div(class: class_names(reset_tag_for_depth => true, "fr-my-2w" => !first_level?), 'data-controller': 'expand') do
- if header_section
%div{ class: class_names(flex: true, "top-bordered" => first_level?) }
= render EditableChamp::HeaderSectionComponent.new(champ: header_section, html_class: {' fr-m-0 fr-text--md fr-px-4v flex-grow' => true, "fr-text-action-high--blue-france" => header_section.level == 1, 'fr-py-2w' => first_level?, 'fr-py-1v' => !first_level?})
- if ![champs, sections].map(&:empty?).all? && first_level?
%button{ type: "button", aria: { controls: section_id, "expanded": "true", label: t('.toggle_section', section: header_section.libelle) }, href: section_id, 'data-action': 'click->expand#toggle', class: "fr-btn fr-btn--tertiary-no-outline" }
%i.fr-icon-arrow-up-s-line{ 'aria-hidden': 'true', 'data-expand-target': 'icon' }
%div{ id: section_id, 'data-expand-target': 'content' }
- if !champs.empty?
= render Dossiers::ChampsRowsShowComponent.new(champs: champs, seen_at: @demande_seen_at, profile: @profile)
- sections.each do |section|
= render section