% if @breadcrumbs_items&.length %>
<% 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",
title: first_breadcrumb_item[:label]) %>
<%= image_tag "icon_small/navigate_next.svg",
alt: "navigate next",
class: "navigate_next" %>
•••
<%= image_tag "icon_small/navigate_next.svg",
alt: "navigate next",
class: "navigate_next" %>
<% item = last_breadcrumb_items.first %>
<%= link_to(item[:label], item[:url],
class: "breadcrumbs-link",
title: item[:label]) %>
<%= image_tag "icon_small/navigate_next.svg",
alt: "navigate next",
class: "navigate_next" %>
<% last_item = last_breadcrumb_items.last %>
<%= last_item[:label] %>
<% else %>
<% last_item = @breadcrumbs_items.pop %>
<% @breadcrumbs_items.each do |item| %>
<% if item[:url] %>
<%= link_to(item[:label], item[:url],
class: "breadcrumbs-link",
title: item[:label]) %>
<% else %>
<%= content_tag(:span, item[:label],
class: "breadcrumbs-link plain-text",
title: item[:label]) %>
<% end %>
"
alt="navigate next"
class="navigate_next">
<% end %>
<%= last_item[:label] %>
<% end %>
<% end %>