Sha256: 0e8d083b866ffe9689a659e3a5283874ebcea9605ee57fb72fcc631c6c363caa

Contents?: true

Size: 937 Bytes

Versions: 84

Compression:

Stored size: 937 Bytes

Contents

<%
app_name ||= nil
phase ||= nil
message ||= nil 

unless phase.in?(%w[alpha beta])
  raise ArgumentError, "The phase banner component expects a `phase` (`beta` or `alpha`), #{phase.inspect} given"
end

unless message.present?
  if phase == "beta"
    message = raw("This part of GOV.UK is being rebuilt &ndash; <a href=\"/help/beta\">find out what beta means</a>")
  elsif phase == "alpha"
    message = raw("This part of GOV.UK is being built &ndash; <a href=\"/service-manual/phases/ideal-alphas\">find out what alpha means</a>")
  end
end 
%>

<%= tag.div class: "gem-c-phase-banner govuk-phase-banner" do %>
  <%= tag.p class: "govuk-phase-banner__content" do %>
    <%= tag.strong app_name, class: "govuk-phase-banner__content__app-name" if app_name %>
    <%= tag.strong phase, class: "govuk-tag govuk-phase-banner__content__tag" %>
    <%= tag.span message, class: "govuk-phase-banner__text" if message %>
  <% end %>
<% end %>

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
govuk_publishing_components-17.6.1 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.6.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.5.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.4.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.3.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.2.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.1.1 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.1.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-17.0.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.29.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.28.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.27.1 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.27.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.26.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.25.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.24.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.23.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.22.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.21.0 app/views/govuk_publishing_components/components/_phase_banner.html.erb
govuk_publishing_components-16.20.1 app/views/govuk_publishing_components/components/_phase_banner.html.erb