Skip to content

Commit

Permalink
Fix spacing for notices in consultations
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Vanita Barrett committed Aug 16, 2018
1 parent 9ed03a2 commit 36f1057
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/presenters/consultation_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion app/views/content_items/consultation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
<% content_item_final_outcome = capture do %>
Visit this page again soon to download the outcome to this public&nbsp;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' %>
Expand Down

0 comments on commit 36f1057

Please sign in to comment.