Merge pull request #8765 from colinux/pdf-timeout-carte-generation

Fix dossier/pdf: remplace les feature collections du champ carte par les libellés de sélection utilisateur
This commit is contained in:
Colin Darie 2023-03-16 15:40:00 +00:00 committed by GitHub
commit 397b5ac489
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,17 @@ def add_single_champ(pdf, champ)
when 'Champs::ExplicationChamp'
format_in_2_lines(pdf, tdc.libelle, strip_tags(tdc.description))
when 'Champs::CarteChamp'
format_in_2_lines(pdf, tdc.libelle, champ.to_feature_collection.to_json)
pdf.pad_bottom(4) do
pdf.font 'marianne', style: :bold, size: 12 do
pdf.text tdc.libelle
end
pdf.indent(default_margin) do
champ.geo_areas.each do |area|
pdf.text "- #{area.label}".tr(' ', ' ') # replace non breaking space, which are invalid in pdf
end
end
end
when 'Champs::SiretChamp'
pdf.font 'marianne', style: :bold do
pdf.text tdc.libelle