Sha256: 1af6949733b8d71646ab3368ce27ce87a2ee1459d8d8089f505a1d1b9b34fce4

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 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"
    type="button"
  >
    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

9 entries across 9 versions & 1 rubygems

Version Path
govuk_publishing_components-24.10.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.9.4 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.9.3 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.9.2 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.9.1 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.9.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.8.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.7.1 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
govuk_publishing_components-24.7.0 app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb