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-23.7.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.7.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.6.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.5.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.5.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.4.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.3.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.2.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.2.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.1.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-23.0.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.69.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.68.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.68.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.67.2 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.67.1 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.67.0 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.66.4 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.66.3 app/views/govuk_publishing_components/components/_related_navigation.html.erb
govuk_publishing_components-21.66.2 app/views/govuk_publishing_components/components/_related_navigation.html.erb