From f8d7b7b1e36083c95b3fd1154f413c08330b5687 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 7 Sep 2021 18:25:39 -0500 Subject: [PATCH 1/4] i18n: fix localization of notify_new_draft email --- app/views/dossier_mailer/notify_new_draft.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/dossier_mailer/notify_new_draft.html.haml b/app/views/dossier_mailer/notify_new_draft.html.haml index ee0219970..cc449fcce 100644 --- a/app/views/dossier_mailer/notify_new_draft.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.html.haml @@ -3,8 +3,8 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) -%p= t('.body', libelle_demarche: @dossier.procedure.libelle) -%p= t('.link') +%p= t('.body_html', libelle_demarche: @dossier.procedure.libelle) +%p= t('.link_html') = round_button(t('.access_file'), dossier_url(@dossier), :primary) - if @dossier.procedure.auto_archive_on From c8d8976a7c76380354126f6c94a2c1058c29baa6 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 8 Sep 2021 09:20:03 +0200 Subject: [PATCH 2/4] i18n: fix localization of notify_new_answer email --- app/views/dossier_mailer/notify_new_answer.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/dossier_mailer/notify_new_answer.html.haml b/app/views/dossier_mailer/notify_new_answer.html.haml index 28f26ca6f..6b05e9455 100644 --- a/app/views/dossier_mailer/notify_new_answer.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.html.haml @@ -4,11 +4,11 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) - if !@dossier.brouillon? - %p= t('.body', libelle_demarche: @dossier.procedure.libelle) + %p= t('.body_html', libelle_demarche: @dossier.procedure.libelle) %p= t('.link') = round_button(t('.access_message'), messagerie_dossier_url(@dossier), :primary) - else - %p= t('.body_draft', libelle_demarche: @dossier.procedure.libelle) + %p= t('.body_draft_html', libelle_demarche: @dossier.procedure.libelle) %p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" } = @body %p= t('.contact') From ef12ded3ed3a7a919375e302bc07f43ee5e77158 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 8 Sep 2021 09:20:17 +0200 Subject: [PATCH 3/4] i18n: fix localization of notify_revert_to_instruction email --- app/views/dossier_mailer/notify_revert_to_instruction.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml index e8323b95c..fad3671c0 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml @@ -4,7 +4,7 @@ %p= t(:hello, scope: [:views, :shared, :greetings]) %p - = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) + = t('.body_html', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) = link_to dossier_url(@dossier), dossier_url(@dossier), target: '_blank', rel: 'noopener' - if @dossier.procedure.service.present? %p From a7ec43a21e8895d02200aff94c429c46561c0f3f Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 8 Sep 2021 09:21:06 +0200 Subject: [PATCH 4/4] fix(i18n): fix email previews --- app/models/dossier.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index fce3f381f..3a9d86f2a 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -382,7 +382,7 @@ class Dossier < ApplicationRecord validates :groupe_instructeur, presence: true, if: -> { !brouillon? } def user_deleted? - user_id.nil? + persisted? && user_id.nil? end def user_email_for(use)