diff --git a/app/assets/stylesheets/components/_header-notice.scss b/app/assets/stylesheets/components/_brexit-notice.scss similarity index 66% rename from app/assets/stylesheets/components/_header-notice.scss rename to app/assets/stylesheets/components/_brexit-notice.scss index cb71bb3ab..1b70a6ad3 100644 --- a/app/assets/stylesheets/components/_header-notice.scss +++ b/app/assets/stylesheets/components/_brexit-notice.scss @@ -1,47 +1,47 @@ -.app-c-header-notice { +.app-c-brexit-notice { margin-bottom: govuk-spacing(8); } -.app-c-header-notice__header { +.app-c-brexit-notice__header { background-color: govuk-colour("black"); padding: govuk-spacing(4); } -.app-c-header-notice__title { +.app-c-brexit-notice__title { @extend %govuk-heading-m; color: govuk-colour("white"); margin: 0; } -.app-c-header-notice__content { +.app-c-brexit-notice__content { border-left: $govuk-border-width solid govuk-colour("black"); border-right: $govuk-border-width solid govuk-colour("black"); border-bottom: $govuk-border-width solid govuk-colour("black"); padding: govuk-spacing(4); } -.app-c-header-notice__text { +.app-c-brexit-notice__text { margin-bottom: govuk-spacing(2); } -.app-c-header-notice__links { +.app-c-brexit-notice__links { margin-bottom: govuk-spacing(2); } -.app-c-header-notice__list { +.app-c-brexit-notice__list { margin-top: -5px; margin-bottom: 0; } -.app-c-header-notice__link-intro { +.app-c-brexit-notice__link-intro { margin-bottom: govuk-spacing(2); } -.app-c-header-notice__link { +.app-c-brexit-notice__link { @extend %govuk-link; font-weight: bold; } -.app-c-header-notice__content .app-c-header-notice__text:last-child { +.app-c-brexit-notice__content .app-c-brexit-notice__text:last-child { margin-bottom: 0; } diff --git a/app/presenters/content_item/no_deal_notice.rb b/app/presenters/content_item/brexit_notice.rb similarity index 70% rename from app/presenters/content_item/no_deal_notice.rb rename to app/presenters/content_item/brexit_notice.rb index 33cdf5e13..851acf2a8 100644 --- a/app/presenters/content_item/no_deal_notice.rb +++ b/app/presenters/content_item/brexit_notice.rb @@ -1,40 +1,40 @@ module ContentItem - module NoDealNotice - def has_no_deal_notice? + module BrexitNotice + def has_brexit_notice? content_item.dig("details").key?("brexit_no_deal_notice") end - def no_deal_notice_component - if has_no_deal_notice? + def brexit_notice_component + if has_brexit_notice? { - title: no_deal_notice_title, - description: no_deal_notice_description, - link_intro: no_deal_notice_link_intro, - links: no_deal_links, - featured_link: no_deal_landing_page_cta, + title: brexit_notice_title, + description: brexit_notice_description, + link_intro: brexit_notice_link_intro, + links: brexit_links, + featured_link: brexit_landing_page_cta, } end end private - def no_deal_notice_links + def brexit_notice_links content_item.dig("details", "brexit_no_deal_notice") end - def no_deal_notice_title + def brexit_notice_title "Brexit transition: new rules for 2021" end - def no_deal_notice_description + def brexit_notice_description "The UK has agreed a deal with the EU. This page tells you the new rules from 1 January 2021." end - def no_deal_notice_link_intro + def brexit_notice_link_intro "For current information, read: " end - def no_deal_landing_page_cta + def brexit_landing_page_cta data_attributes = { "module": "track-click", "track-category": "no_deal_notice", @@ -50,8 +50,8 @@ def no_deal_landing_page_cta ("Use the Brexit checker to " + featured_link + " and sign up for email updates.").html_safe end - def no_deal_links - no_deal_notice_links.map do |link| + def brexit_links + brexit_notice_links.map do |link| { title: link["title"], href: link["href"], diff --git a/app/presenters/content_item_presenter.rb b/app/presenters/content_item_presenter.rb index f51ef5384..78de9bf62 100644 --- a/app/presenters/content_item_presenter.rb +++ b/app/presenters/content_item_presenter.rb @@ -1,6 +1,6 @@ class ContentItemPresenter include ContentItem::Withdrawable - include ContentItem::NoDealNotice + include ContentItem::BrexitNotice attr_reader :content_item, :requested_path, diff --git a/app/views/components/_header-notice.html.erb b/app/views/components/_brexit-notice.html.erb similarity index 54% rename from app/views/components/_header-notice.html.erb rename to app/views/components/_brexit-notice.html.erb index 8b35a0893..c9d6ae536 100644 --- a/app/views/components/_header-notice.html.erb +++ b/app/views/components/_brexit-notice.html.erb @@ -6,34 +6,34 @@ featured_link ||= false %> <% if title && description %> -
-
-

<%= title %>

+
+
+

<%= title %>

-
+
<% if description.is_a? Array %> <% description.map do |line| %> -

<%= line %>

+

<%= line %>

<% end %> <% else %> -

<%= description %>

+

<%= description %>

<% end %> <% if featured_link %> -

<%= featured_link %>

+

<%= featured_link %>

<% end %> <% if links.any? %> -