Sha256: 372a54ec49c0860fa4264bdf1ed1c678e7c98c9115a67a2986c64f310d21f77f

Contents?: true

Size: 1.26 KB

Versions: 33

Compression:

Stored size: 1.26 KB

Contents

<%
  title ||= false
  description_text ||= false
  description_govspeak ||= false
  description ||= yield || false
  aria_live ||= false
  lang = local_assigns[:lang].presence
  local_assigns[:margin_bottom] ||= 8
  local_assigns[:margin_bottom] = 8 if local_assigns[:margin_bottom] > 9

  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)

  css_classes = %w[gem-c-notice]
  css_classes << (shared_helper.get_margin_bottom)

  aria_attributes = aria_live ? {label: 'Notice', live: 'polite'} : {label: 'Notice'}

  description_present = description.present? || description_text.present? || description_govspeak.present?
%>
<% if title || description_present %>
  <%= tag.section class: css_classes, aria: aria_attributes, lang: lang, role: "region" do %>
    <% if title %>
      <% if description_present %>
        <%= tag.h2 title, class: "gem-c-notice__title" %>
      <% else %>
        <%= tag.span title, class: "gem-c-notice__title" %>
      <% end %>
    <% end %>

    <%= tag.p description_text, class: "gem-c-notice__description" if description_text %>

    <%= description if description %>

    <%= render 'govuk_publishing_components/components/govspeak', content: description_govspeak if description_govspeak %>
  <% end %>
<% end %>

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
govuk_publishing_components-25.0.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.21.1 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.21.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.20.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.19.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.5 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.4 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.3 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.2 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.1 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.18.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.17.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.16.1 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.16.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.15.3 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.15.2 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.15.1 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.15.0 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.14.1 app/views/govuk_publishing_components/components/_notice.html.erb
govuk_publishing_components-24.14.0 app/views/govuk_publishing_components/components/_notice.html.erb