Skip to content

Commit

Permalink
Merge pull request #2430 from alphagov/banner-test
Browse files Browse the repository at this point in the history
Allow showing individual global bar links
  • Loading branch information
sihugh authored Mar 9, 2021
2 parents 69341e6 + 88e6ed4 commit 1d9f028
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions app/views/notifications/_global_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
link_text = false
link_href = false

show_coronavirus_link = true
coronavirus_title = "Coronavirus (COVID-19)"
coronavirus_href = "/coronavirus"
coronavirus_subtext = "National lockdown: stay at home"

show_transition_link = true
transition_title = "Brexit"
transition_href = "/transition"
transition_subtext = "Check what you need to do"

coronavirus_link_margin_bottom = show_transition_link ? { margin_bottom: 3 } : {}

# Toggles banner being permanently visible
# If true, banner is always_visible & does not disappear automatically after 3 pageviews
# Regardless of value, banner is always manually dismissable by users
Expand Down Expand Up @@ -66,18 +70,23 @@
</p>
<% end %>

<% if coronavirus_title && coronavirus_href %>
<% if show_coronavirus_link || show_transition_link %>
<div class="global-bar-covid-wrapper">
<% end %>

<% if show_coronavirus_link %>
<%= render "govuk_publishing_components/components/action_link", {
text: coronavirus_title,
href: coronavirus_href,
subtext: coronavirus_subtext,
classes: "js-call-to-action",
light_text: true,
simple_light: true,
margin_bottom: 3
} %>
}.merge(coronavirus_link_margin_bottom)
%>
<% end %>

<% if show_transition_link %>
<%= render "govuk_publishing_components/components/action_link", {
text: transition_title,
href: transition_href,
Expand All @@ -86,6 +95,9 @@
light_text: true,
simple_light: true
} %>
<% end %>

<% if show_coronavirus_link || show_transition_link %>
</div>
<% end %>
</div>
Expand Down

0 comments on commit 1d9f028

Please sign in to comment.