From 5a2f4708a0d8362a701b55d4c05001b51a73ce77 Mon Sep 17 00:00:00 2001 From: Sharmaine Lim Date: Mon, 3 Feb 2025 15:27:07 +0800 Subject: [PATCH] TWE-14 - BE - Contact CTA block description field (#338) * Add PARAGRAPH_RICH_TEXT_FEATURES * Add optional description field to CTA block * TWE-14 | FE | Contact CTA redesign (#341) * Use |first instead of a for loop --------- Co-authored-by: Sherry --- tbx/core/blocks.py | 3 + .../molecules/footer-cta/footer-cta.html | 2 +- .../streamfield/blocks/call_to_action.html | 10 ++- .../streamfield/blocks/call_to_action.yaml | 1 + .../blocks/contact_call_to_action.html | 40 ++++++---- .../blocks/contact_call_to_action.yaml | 1 + .../styleguide/components/components.html | 4 +- tbx/static_src/sass/components/_avatar.scss | 2 +- .../sass/components/_call-to-action.scss | 11 ++- .../sass/components/_contact-cta.scss | 78 ++++++++++++------- tbx/static_src/sass/components/_grid.scss | 11 +-- 11 files changed, 99 insertions(+), 64 deletions(-) diff --git a/tbx/core/blocks.py b/tbx/core/blocks.py index 582815e54..42f467b3e 100644 --- a/tbx/core/blocks.py +++ b/tbx/core/blocks.py @@ -235,6 +235,9 @@ def get_button_file_size(self): class CallToActionBlock(blocks.StructBlock): text = blocks.CharBlock(required=True, max_length=255) + description = blocks.RichTextBlock( + features=settings.PARAGRAPH_RICH_TEXT_FEATURES, required=False + ) button_text = blocks.CharBlock(max_length=55) button_link = blocks.StreamBlock( [ diff --git a/tbx/project_styleguide/templates/patterns/molecules/footer-cta/footer-cta.html b/tbx/project_styleguide/templates/patterns/molecules/footer-cta/footer-cta.html index 5c6e8a107..46a6f6a83 100644 --- a/tbx/project_styleguide/templates/patterns/molecules/footer-cta/footer-cta.html +++ b/tbx/project_styleguide/templates/patterns/molecules/footer-cta/footer-cta.html @@ -3,7 +3,7 @@

{{ contact_heading }}