From 36f1057f5851d292e771ad836a6d7e801e845f5f Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Thu, 16 Aug 2018 09:54:33 +0000 Subject: [PATCH] Fix spacing for notices in consultations When we replaced this with the notice component in the gem, we removed the bottom margin in all cases. This meant that sometimes, the heading of a section could appear directly underneath a notice with no spacing. This fix introduces spacing in those cases, but adds a bottom margin when the notice is immediately followed by a banner item (as per the original design) --- app/presenters/consultation_presenter.rb | 4 ++++ app/views/content_items/consultation.html.erb | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/presenters/consultation_presenter.rb b/app/presenters/consultation_presenter.rb index e65ee13e0..765ab81db 100644 --- a/app/presenters/consultation_presenter.rb +++ b/app/presenters/consultation_presenter.rb @@ -110,6 +110,10 @@ def attachment_url ways_to_respond["attachment_url"] end + def add_margin? + final_outcome? || public_feedback_detail || public_feedback_documents? + end + private def display_date_and_time(date, rollback_midnight = false) diff --git a/app/views/content_items/consultation.html.erb b/app/views/content_items/consultation.html.erb index 4dd3d6976..8dc09b85b 100644 --- a/app/views/content_items/consultation.html.erb +++ b/app/views/content_items/consultation.html.erb @@ -31,7 +31,11 @@ <% content_item_final_outcome = capture do %> Visit this page again soon to download the outcome to this public feedback. <% end %> - <%= render 'govuk_publishing_components/components/notice', title: 'We are analysing your feedback', description_text: content_item_final_outcome, margin_bottom: 0 %> + <%= render 'govuk_publishing_components/components/notice', + title: 'We are analysing your feedback', + description_text: content_item_final_outcome, + margin_bottom:(0 unless @content_item.add_margin?) + %> <% elsif @content_item.final_outcome? %> <%= render 'govuk_publishing_components/components/notice', title: 'This consultation has concluded' %>