Sha256: f5301a90688051a9d144c80c8321349d15e4ef7d2a26a15bd26ac58b4d5cd2df

Contents?: true

Size: 1.23 KB

Versions: 52

Compression:

Stored size: 1.23 KB

Contents

<%
  add_gem_component_stylesheet("translation-nav")

  brand ||= false
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
  translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
%>
<% if translation_helper.has_translations? %>
  <nav role="navigation"
    class="gem-c-translation-nav govuk-!-display-none-print <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
    aria-label="<%= t("common.translations") %>"
  >
    <ul class="gem-c-translation-nav__list">
      <% translation_helper.translations.each.with_index do |translation, i| %>
        <li class="gem-c-translation-nav__list-item">
          <% if translation[:active] %>
            <span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
          <% else %>
            <%= link_to translation[:text], translation[:base_path],
              hreflang: translation[:locale],
              lang: translation[:locale],
              rel: "alternate",
              class: "govuk-link gem-c-translation-nav__link #{brand_helper.color_class}",
              data: translation[:data_attributes]
            %>
          <% end %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

Version data entries

52 entries across 52 versions & 1 rubygems

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