Sha256: 8bca7804ab65e57363025b0d66fb65b15edd6578c32a18a3cf3d287a9161ca8a

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

<%
  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 <%= brand_helper.brand_class %>"
    aria-label="<%= t("common.translations") %>"
    <%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
  >
    <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: brand_helper.color_class,
              data: translation[:data_attributes]
            %>
          <% end %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
govuk_publishing_components-9.2.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-9.1.1 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-9.1.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-9.0.1 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-9.0.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-8.2.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-8.1.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-8.0.1 app/views/govuk_publishing_components/components/_translation-nav.html.erb
govuk_publishing_components-8.0.0 app/views/govuk_publishing_components/components/_translation-nav.html.erb