Sha256: eecdfcc96db8d26cc8b771005996953183acd1cbd98aab1adebff7eafc4d1652

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

<% cache([base_cache_key, taxon, 'subcategories', permitted_product_params]) do %>
  <% subcategories = [taxon] %>
  <% unless taxon.children.any? %>
    <% subcategories.unshift(taxon.parent) %>
  <% end %>
  <% subcategories.compact.each do |current_taxon| %>
    <% child_taxons = [current_taxon, *current_taxon.children.where(hide_from_nav: false)] %>
    <% if current_taxon.level > 0 && child_taxons.size > 1 %>
      <div class="d-flex justify-content-center position-sticky sticky-top-90px taxon-subcategories-wrapper">
        <div class="py-1 text-uppercase d-none d-xl-flex overflow-x taxon-subcategories">
          <% child_taxons.each_with_index.map do |subcategory, index| %>
            <%=
              link_to_unless subcategory == taxon,
                            index.zero? ? Harpiya.t(:all) : subcategory.name,
                            harpiya.nested_taxons_path(subcategory, params: permitted_product_params),
                            class: "pt-4 pb-2 mb-2 #{index.zero? ? '' : 'pl-4 pt-4 pb-2'}" do
            %>
              <div class="pt-4 mb-2 <%= index.zero? ? '' : 'pl-4' %>">
                <span class="pb-2 taxon-subcategories-selected">
                  <%= index.zero? ? Harpiya.t(:all) : subcategory.name %>
                </span>
              </div>
            <% end %>
          <% end %>
        </div>
      </div>
    <% end %>
  <% end %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
harpiya_frontend-4.3.0.alpha app/views/harpiya/taxons/_subcategories.html.erb