<% if @breadcrumbs_items&.length %> <% @breadcrumbs_items.each { |item| item[:label] = "(A) #{item[:label]}" if item[:archived] }%> <% shortened = @breadcrumbs_items.length > 4 %> <% if shortened %> <% first_breadcrumb_item = @breadcrumbs_items.shift last_breadcrumb_items = @breadcrumbs_items.pop(2) %> <%= link_to(first_breadcrumb_item[:label], first_breadcrumb_item[:url], class: "breadcrumbs-link #{first_breadcrumb_item[:class]}", title: first_breadcrumb_item[:label], data: first_breadcrumb_item[:data]) %> > ••• > <% item = last_breadcrumb_items.first %> <%= link_to(item[:label], item[:url], class: "breadcrumbs-link #{item[:class]}", title: item[:label], data: item[:data]) %> > <% last_item = last_breadcrumb_items.last %> <%= last_item[:label] %> <% else %> <% last_item = @breadcrumbs_items.pop %> <% @breadcrumbs_items.each do |item| %> <%= link_to(item[:label], item[:url], class: "breadcrumbs-link #{item[:class]}", title: item[:label], data: item[:data]) %> > <% end %> <%= last_item[:label] %> <% end %> <% end %>