Sha256: bc251e95d209e8f62f5f1cea731d31f5d1ad41d8f2356eb80fba4e72c6c61d8b

Contents?: true

Size: 1.32 KB

Versions: 158

Compression:

Stored size: 1.32 KB

Contents

<% related_nav_helper = GovukPublishingComponents::Presenters::RelatedNavigationHelper.new(local_assigns) %>

<% if related_nav_helper.related_navigation? %>
  <% random = SecureRandom.hex(4) %>
  <div class="gem-c-related-navigation">

    <% if local_assigns[:context] != :footer %>
      <h2 id="related-nav-related_items-<%= random %>"
          class="gem-c-related-navigation__main-heading"
          data-track-count="sidebarRelatedItemSection"
          <%= related_nav_helper.t_lang(
              "components.related_#{local_assigns[:context]}_navigation.related_content",
              default: 'components.related_navigation.related_content'
            )
          %>
      >
        <%= t("components.related_#{local_assigns[:context]}_navigation.related_content",
              default: t('components.related_navigation.related_content')) %>
      </h2>
    <% end %>

    <% section_index = 0 %>

    <% related_nav_helper.related_navigation.each do |section_title, links| %>
      <% next unless links.any? %>

      <% section_index += 1 %>

      <%= render 'govuk_publishing_components/components/related_navigation/section',
        related_nav_helper: related_nav_helper,
        section_title: section_title,
        links: links,
        section_index: section_index,
        random: random %>
    <% end %>
  </div>
<% end %>

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
govuk_publishing_components-21.0.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.5.2 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.5.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.5.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.4.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.3.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.2.2 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.2.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.2.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.1.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-20.0.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-19.0.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.3.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.3.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.2.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.1.2 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.1.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-18.1.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb