Sha256: a4e17ed8bfbc5689f67f440d3fffabdeb574975029748e24c4b379934ea4dae5

Contents?: true

Size: 1.78 KB

Versions: 11

Compression:

Stored size: 1.78 KB

Contents

<% breadcrumb_items.each_with_index do |item, i| %>
  <% next if item.blank? %>

  <% item_label = translated_attribute(item[:label]) %>
  <span>/</span>
  <% if item[:dropdown_cell].present? %>
    <div class="relative">
      <div class="menu-bar__breadcrumb-desktop__dropdown-wrapper" <%== 'aria-current="page"' if item[:active] %> onmouseenter="document.getElementById('secondary-dropdown-menu-<%= i %>').classList.remove('no-animation')">
        <%= link_to item[:url], class: "menu-bar__breadcrumb-desktop__dropdown-trigger", onmouseenter: "document.getElementById('secondary-dropdown-summary-#{i}').click()" do %>
          <%= item_label %>
        <% end %>
        <button id="secondary-dropdown-summary-<%= i %>"
          class="menu-bar__breadcrumb-desktop__dropdown-trigger"
          data-component="dropdown"
          data-hover="true"
          data-target="secondary-dropdown-menu-<%= i %>">
          <%= icon "arrow-drop-down-line" %>
          <span class="sr-only"><%= t("layouts.decidim.header.user_menu") %></span>
        </button>
      </div>

      <div id="secondary-dropdown-menu-<%= i %>" class="menu-bar__breadcrumb-desktop__dropdown-content-secondary no-animation" aria-hidden="true">
        <%= cell item[:dropdown_cell], item[:resource] %>
      </div>
    </div>
  <% else %>
    <%= link_to_if(item[:url].present? && !is_active_link?(item[:url], :exclusive), item_label, item[:url], class: "menu-bar__breadcrumb-desktop__dropdown-wrapper menu-bar__breadcrumb-desktop__dropdown-trigger", "aria-current": (item[:active] ? "page" : nil)) do %>
      <%# alternative template %>
      <%= content_tag :span, item_label, class: "menu-bar__breadcrumb-desktop__dropdown-trigger no-interactive", tabindex: "0", "aria-current": "page" if item[:active] %>
    <% end %>
  <% end %>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-core-0.29.2 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.28.5 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.1 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.28.4 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.0 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.28.3 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.0.rc4 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.0.rc3 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.0.rc2 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.29.0.rc1 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb
decidim-core-0.28.2 app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb