From 25a4a4de4ab6a81825e9a9f4725fa76b5eb42c94 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 31 Oct 2023 10:57:38 +0100 Subject: [PATCH] =?UTF-8?q?correctif(pdf):=20ETQ=20instructeur,=20lorsque?= =?UTF-8?q?=20je=20t=C3=A9l=C3=A9charge=20un=20dossier=20et=20ses=20PJs,?= =?UTF-8?q?=20les=20\t=20deviennent=20des=20=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: colin@darie.eu --- app/views/dossiers/show.pdf.prawn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/dossiers/show.pdf.prawn b/app/views/dossiers/show.pdf.prawn index 8f0cb3631..fad7d2d40 100644 --- a/app/views/dossiers/show.pdf.prawn +++ b/app/views/dossiers/show.pdf.prawn @@ -11,7 +11,7 @@ def maybe_start_new_page(pdf, size) end def clean_string(str) - str&.gsub(/[[:space:]]/, ' ') # replace non breaking space, which are invalid in pdf + str&.each_line { _1.gsub(/[[:space:]]/, ' ') } # replace non breaking space, which are invalid in pdf end def text_box(pdf, text, x, width) @@ -189,6 +189,9 @@ def add_single_champ(pdf, champ) format_in_2_lines(pdf, tdc.libelle, value) format_in_2_lines(pdf, "Code Postal :", champ.code_postal) if champ.code_postal? format_in_2_lines(pdf, "Département :", champ.departement_code_and_name) if champ.departement? + when 'Champs::TextareaChamp' + value = champ.blank? ? 'Non communiqué' : champ.to_s + format_in_2_lines(pdf, tdc.libelle, clean_string(value)) else value = champ.blank? ? 'Non communiqué' : champ.to_s format_in_2_lines(pdf, tdc.libelle, value)