demarches-normaliennes/app/views/shared/champs/carte/_geo_areas.html.haml

55 lines
1.9 KiB
Text
Raw Normal View History

- if champ.selections_utilisateur.present?
.areas-title Sélections utilisateur
.areas
%ul
- champ.selections_utilisateur.each do |geo_area|
2020-06-09 18:16:49 +02:00
%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'
- else
= link_to '#', data: { geo_area: geo_area.id } do
= geo_area_label(geo_area)
- if geo_area.description.present?
%span
= geo_area.description
2018-10-17 12:02:34 +02:00
- if champ.quartiers_prioritaires?
.areas-title Quartiers prioritaires
.areas
2020-05-14 11:21:33 +02:00
- if !champ.geometry?
2018-10-17 12:02:34 +02:00
Aucune zone tracée
- elsif champ.quartiers_prioritaires.blank?
= t('errors.messages.quartiers_prioritaires_empty', count: champ.selections_utilisateur.size)
2018-10-17 12:02:34 +02:00
- else
%ul
- champ.quartiers_prioritaires.each do |geo_area|
%li= geo_area_label(geo_area)
2018-10-17 12:02:34 +02:00
- if champ.cadastres?
.areas-title Parcelles cadastrales
.areas
2020-05-14 11:21:33 +02:00
- if !champ.geometry?
2018-10-17 12:02:34 +02:00
Aucune zone tracée
- elsif champ.cadastres.blank?
= t('errors.messages.cadastres_empty', count: champ.selections_utilisateur.size)
2018-10-17 12:02:34 +02:00
- else
%ul
- champ.cadastres.each do |geo_area|
2020-06-09 18:16:49 +02:00
%li.flex.column.mb-2
= link_to '#', data: { geo_area: geo_area.id } do
= geo_area_label(geo_area)
2018-10-23 15:38:20 +02:00
- if champ.parcelles_agricoles?
.areas-title Parcelles agricoles (RPG)
.areas
2020-05-14 11:21:33 +02:00
- if !champ.geometry?
2018-10-23 15:38:20 +02:00
Aucune zone tracée
- elsif champ.parcelles_agricoles.blank?
= t('errors.messages.parcelles_agricoles_empty', count: champ.selections_utilisateur.size)
2018-10-23 15:38:20 +02:00
- else
%ul
- champ.parcelles_agricoles.each do |geo_area|
%li= geo_area_label(geo_area)