From 215c989a6c6cb5a6e52c4e9897ce7cb478697138 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 16 Mar 2023 11:07:26 +0100 Subject: [PATCH] add question_answer in pdf and change local for optional field --- app/views/dossiers/show.pdf.prawn | 4 ++++ config/locales/models/avis/en.yml | 2 +- config/locales/models/avis/fr.yml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/dossiers/show.pdf.prawn b/app/views/dossiers/show.pdf.prawn index c9a517305..da16816e8 100644 --- a/app/views/dossiers/show.pdf.prawn +++ b/app/views/dossiers/show.pdf.prawn @@ -201,6 +201,10 @@ end def add_avis(pdf, avis) format_in_2_lines(pdf, "Avis de #{avis.email_to_display}#{avis.confidentiel? ? ' (confidentiel)' : ''}", avis.answer || 'En attente de réponse') + + if avis.question_answer.present? + format_in_2_columns(pdf, "Réponse oui/non ", t("question_answer.#{avis.question_answer}", scope: 'helpers.label')) + end end def add_etat_dossier(pdf, dossier) diff --git a/config/locales/models/avis/en.yml b/config/locales/models/avis/en.yml index df4e037d0..bcc51ae19 100644 --- a/config/locales/models/avis/en.yml +++ b/config/locales/models/avis/en.yml @@ -16,7 +16,7 @@ en: revoke: Revoke opinion request remind: Remind the expert question_label: Ask a question to the expert - question_label_hint: (optional field) the expert could answer by yes/no + question_label_hint: (optional) the expert could answer by yes/no introduction: Introduction message question_answer: true: 'yes' diff --git a/config/locales/models/avis/fr.yml b/config/locales/models/avis/fr.yml index d0b4052eb..1a3c8b6d4 100644 --- a/config/locales/models/avis/fr.yml +++ b/config/locales/models/avis/fr.yml @@ -16,7 +16,7 @@ fr: revoke: Révoquer la demande d’avis remind: Relancer l’expert question_label: Posez une question à l'expert - question_label_hint: (champ optionnel) l'expert pourra répondre par oui/non + question_label_hint: (facultatif) l'expert pourra répondre par oui/non introduction: Message d'introduction question_answer: true: oui