From b33f542cf4d1e2246e3711349a3285e1e97b8f68 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 19 Aug 2024 16:15:29 +0200 Subject: [PATCH 1/3] fix(attestation): nowrap footers & pages counter --- app/assets/stylesheets/attestation.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/stylesheets/attestation.scss b/app/assets/stylesheets/attestation.scss index 75a10efba..86924df4c 100644 --- a/app/assets/stylesheets/attestation.scss +++ b/app/assets/stylesheets/attestation.scss @@ -27,6 +27,7 @@ font-size: 8pt; content: counter(page) " / " counter(pages); margin-top: 17mm; + white-space: nowrap; } @bottom-left { @@ -169,5 +170,6 @@ position: running(footer); font-size: 7pt; font-weight: 100; + white-space: nowrap; } } From 1dbd198092e546073e9a8a864de3f38c2cb82da9 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 19 Aug 2024 18:28:19 +0200 Subject: [PATCH 2/3] fix(attestation): footer must be in before flexible content in order to be repeated on each page --- app/assets/stylesheets/attestation.scss | 8 +++++++- .../attestation_template_v2s/show.html.haml | 7 ++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/attestation.scss b/app/assets/stylesheets/attestation.scss index 86924df4c..89459a55a 100644 --- a/app/assets/stylesheets/attestation.scss +++ b/app/assets/stylesheets/attestation.scss @@ -47,6 +47,7 @@ margin: 0 auto; background: #FFFFFF; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); // Optional: for better visualization + position: relative; } } @@ -166,10 +167,15 @@ } } - .footer { + footer { position: running(footer); font-size: 7pt; font-weight: 100; white-space: nowrap; + + @media screen { + position: absolute; + bottom: 0; + } } } diff --git a/app/views/administrateurs/attestation_template_v2s/show.html.haml b/app/views/administrateurs/attestation_template_v2s/show.html.haml index 06c87773f..e27889003 100644 --- a/app/views/administrateurs/attestation_template_v2s/show.html.haml +++ b/app/views/administrateurs/attestation_template_v2s/show.html.haml @@ -30,12 +30,13 @@ - if @attestation_template.label_direction.present? = simple_format @attestation_template.label_direction, class: "direction" + - if @attestation_template.footer.present? + %footer + = simple_format @attestation_template.footer + .main = sanitize(@body, attributes: %w[class style], tags: Rails.configuration.action_view.sanitized_allowed_tags + %w[header]) - if @attestation_template.signature.present? .signature = image_tag(@attestation_template.signature_url) - - - if @attestation_template.footer.present? - = simple_format @attestation_template.footer, class: "footer" From e35809db28a1bc539c137f17be188bc44eba7226 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 19 Aug 2024 18:36:35 +0200 Subject: [PATCH 3/3] fix(attestation): html format expand a4 background even if because there is a single page --- app/assets/stylesheets/attestation.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/attestation.scss b/app/assets/stylesheets/attestation.scss index 89459a55a..e01a9168b 100644 --- a/app/assets/stylesheets/attestation.scss +++ b/app/assets/stylesheets/attestation.scss @@ -42,7 +42,7 @@ flex-direction: column; justify-content: space-between; // This will push the footer down max-width: 21cm; - height: 29.7cm; + min-height: 29.7cm; padding: 17mm; margin: 0 auto; background: #FFFFFF;