Sha256: e0c67854992d975f0bdfa878558c90de28f342ffb5fc536a4c02269fc3aac5a0

Contents?: true

Size: 1.77 KB

Versions: 15

Compression:

Stored size: 1.77 KB

Contents

<%
  new_cookie_banner ||= false
  id ||= 'global-cookie-message'

  cookie_banner_class = new_cookie_banner ? "gem-c-cookie-banner--new" : "gem-c-cookie-banner"

  cookie_banner_helper = GovukPublishingComponents::Presenters::CookieBannerHelper.new(local_assigns)

  message = cookie_banner_helper.message
  confirmation_message = cookie_banner_helper.confirmation_message
%>

<div id="<%= id %>" class="<%= cookie_banner_class %>" data-module="cookie-banner">
  <div class="gem-c-cookie-banner__wrapper govuk-width-container">
    <p class="gem-c-cookie-banner__message"><%= message %></p>
    <% if new_cookie_banner %>
      <div class="gem-c-cookie-banner__buttons">
        <%= render "govuk_publishing_components/components/button", {
          text: "Accept cookies",
          secondary: true,
          inline_layout: true,
          data_attributes: {
            module: "track-click",
            "accept-cookies": "true",
            "track-category": "cookieBanner",
            "track-action": "Cookie banner accepted"
          }
        } %>
        <%= render "govuk_publishing_components/components/button", {
          text: "Cookie settings",
          href: "/help/cookies",
          secondary: true,
          inline_layout: true,
          data_attributes: {
            module: "track-click",
            "track-category": "cookieBanner",
            "track-action": "Cookie banner settings clicked"
          }
        } %>
      </div>
    <% end %>
  </div>

  <% if new_cookie_banner %>
    <div class="gem-c-cookie-banner__confirmation govuk-width-container">
      <p class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></p>
      <button class="gem-c-cookie-banner__hide-button" data-hide-cookie-banner="true">Hide</button>
    </div>
  <% end %>
</div>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
govuk_publishing_components-16.29.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.28.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.27.1 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.27.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.26.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.25.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.24.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.23.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.22.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.21.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.20.1 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.20.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.19.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.18.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb
govuk_publishing_components-16.17.0 app/views/govuk_publishing_components/components/_cookie_banner.html.erb