demarches-normaliennes/app/views/shared/champs/carte/_geo_areas.html.haml
2021-05-24 11:57:00 +02:00

30 lines
1.1 KiB
Text

- if champ.selections_utilisateur.present?
.areas-title Sélections utilisateur
.areas
%ul
- champ.selections_utilisateur.each do |geo_area|
%li{ class: editing ? '' : 'flex column mb-2' }
- if editing
= link_to '#', data: { geo_area: geo_area.id } do
= geo_area_label(geo_area)
= text_field_tag :description, geo_area.description, data: { geo_area: geo_area.id }, placeholder: 'Description de la sélection', class: 'no-margin'
- else
= link_to '#', data: { geo_area: geo_area.id } do
= geo_area_label(geo_area)
- if geo_area.description.present?
%span
= geo_area.description
- if champ.cadastres?
.areas-title Parcelles cadastrales
.areas
- if !champ.geometry?
Aucune zone tracée
- elsif champ.cadastres.blank?
= t('errors.messages.cadastres_empty', count: champ.selections_utilisateur.size)
- else
%ul
- champ.cadastres.each do |geo_area|
%li.flex.column.mb-2
= link_to '#', data: { geo_area: geo_area.id } do
= geo_area_label(geo_area)