From dd30c9f9707c4cb7c8d0851f9c7ea0c8c202cdb0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 6 Jan 2021 17:38:44 +0000 Subject: [PATCH] Style template length message to sit inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This looks tidy, and because of the sticky footer it means the message is always visible, even if your template is quite long. So no matter where you’re scrolled to in the template you don’t have to scroll to the bottom to see the count update. --- app/assets/stylesheets/components/message.scss | 2 +- app/assets/stylesheets/components/page-footer.scss | 4 ++++ app/assets/stylesheets/views/template.scss | 12 ++++++++++++ app/templates/components/page-footer.html | 5 +++-- app/templates/views/edit-broadcast-template.html | 2 +- app/templates/views/edit-sms-template.html | 4 ++-- tests/app/main/views/test_templates.py | 8 ++++++++ 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/components/message.scss b/app/assets/stylesheets/components/message.scss index e8dab86e3..2e9229e51 100644 --- a/app/assets/stylesheets/components/message.scss +++ b/app/assets/stylesheets/components/message.scss @@ -205,7 +205,7 @@ a { margin: 0; } - .content-fixed & { + .content-fixed__bottom & { right: govuk-spacing(3); } diff --git a/app/assets/stylesheets/components/page-footer.scss b/app/assets/stylesheets/components/page-footer.scss index c1874c397..fae7d85c9 100644 --- a/app/assets/stylesheets/components/page-footer.scss +++ b/app/assets/stylesheets/components/page-footer.scss @@ -3,6 +3,10 @@ position: relative; margin-bottom: 30px; + &--inline-block { + display: inline-block; + } + &-delete-link { line-height: 40px; diff --git a/app/assets/stylesheets/views/template.scss b/app/assets/stylesheets/views/template.scss index 41670359d..13dd69a50 100644 --- a/app/assets/stylesheets/views/template.scss +++ b/app/assets/stylesheets/views/template.scss @@ -55,3 +55,15 @@ top: 51px; // aligns with ‘change postage’ link left: 66px; // Aligns to left of logo area } + +.template-content-count { + @include core-19($tabular-numbers: true); + color: $secondary-text-colour; + vertical-align: bottom; + padding: 0 0 govuk-spacing(1) govuk-spacing(2); + display: inline-block; + + & .govuk-error-message { + margin-top: 0; + } +} diff --git a/app/templates/components/page-footer.html b/app/templates/components/page-footer.html index 789318ae7..66f4564d1 100644 --- a/app/templates/components/page-footer.html +++ b/app/templates/components/page-footer.html @@ -10,9 +10,10 @@ secondary_link_text=None, delete_link=False, delete_link_text="delete", - centered_button=False + centered_button=False, + inline_block=False ) %} -