Sha256: edd897be359df343f95806635baa8c714a519a3bbc6c939b6127a2be9bce5201

Contents?: true

Size: 1.1 KB

Versions: 42

Compression:

Stored size: 1.1 KB

Contents

<%
  add_gem_component_stylesheet("secondary-navigation")

  id ||= nil
  items ||= []

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.add_aria_attribute({label: aria_label})
  component_helper.add_class('gem-c-secondary-navigation')
  component_helper.set_id(id)
  component_helper.add_role("navigation")
%>

<% if items.any? %>
  <%= tag.nav(**component_helper.all_attributes) do %>
    <%= tag.ul class: "gem-c-secondary-navigation__list" do %>
      <% items.each do |item| %>
        <%
          item_classes = %w( gem-c-secondary-navigation__list-item )
          item_classes << "gem-c-secondary-navigation__list-item--current" if item[:current]
          item_aria_attributes = { current: "page" } if item[:current]
        %>
        <%= tag.li class: item_classes do %>
          <%= link_to item[:label], item[:href], class: "govuk-link govuk-link--no-visited-state gem-c-secondary-navigation__list-item-link", data: item[:data_attributes], aria: item_aria_attributes %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-47.0.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.4.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.3.1 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.3.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.2.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.1.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-46.0.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.10.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.9.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.8.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.7.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.6.1 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.6.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.5.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.4.1 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.4.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.3.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.2.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb
govuk_publishing_components-45.1.0 app/views/govuk_publishing_components/components/_secondary_navigation.html.erb