Sha256: 8152922ec2f7e564dda269a7b2ebc2c7b49e39db3805a71cb5cd2679963a05ff

Contents?: true

Size: 1.14 KB

Versions: 46

Compression:

Stored size: 1.14 KB

Contents

<% navigation_aria_label ||= "Top level" %>

<% if navigation_items.any? %>
  <button
    aria-controls="navigation"
    aria-label="Show or hide Top Level Navigation"
    class="govuk-header__menu-button govuk-js-header-toggle gem-c-header__menu-button govuk-!-display-none-print"
    type="button"
    data-button-name="menu"
  >
    <%= t("components.layout_header.menu") %>
  </button>
  <%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
    <ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
      <% navigation_items.each_with_index do |item, index| %>
        <%
          li_classes = %w(govuk-header__navigation-item)
          li_classes << "govuk-header__navigation-item--active" if item[:active]
          li_classes << "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu]
        %>
        <%= tag.li class: li_classes do %>
          <%= link_to(
            item[:text],
            item[:href],
            class: 'govuk-header__link',
            data: item[:data],
          ) %>
        <% end %>
      <% end %>
    </ul>
  <% end %>
<% end %>

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
govuk_publishing_components-28.5.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-28.4.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-28.3.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-28.2.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-28.1.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-28.0.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.20.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.19.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.18.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.17.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.16.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.15.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.14.2 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.14.1 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.14.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.13.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.12.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.11.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.10.5 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-27.10.4 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb