2023-03-30 22:29:21 +08:00
|
|
|
<% if @breadcrumbs_items&.length %>
|
2023-03-31 03:22:33 +08:00
|
|
|
<% @breadcrumbs_items.each { |item| item[:label] = "(A) #{item[:label]}" if item[:archived] }%>
|
2023-03-30 22:29:21 +08:00
|
|
|
<% 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],
|
2023-04-06 23:20:49 +08:00
|
|
|
class: "breadcrumbs-link",
|
|
|
|
title: first_breadcrumb_item[:label]) %>
|
2023-04-03 00:42:21 +08:00
|
|
|
<span class="delimiter">
|
2023-04-06 18:12:24 +08:00
|
|
|
<%= image_tag "icon_small/navigate_next.svg",
|
|
|
|
alt: "navigate next",
|
|
|
|
class: "navigate_next" %>
|
2023-04-03 00:42:21 +08:00
|
|
|
</span>
|
2023-03-30 22:29:21 +08:00
|
|
|
<span class="breadcrumbs-collapsed-container">
|
|
|
|
<span class="show-breadcrumbs" data-toggle="dropdown" title="<%= t('projects.index.breadcrumbs_collapsed') %>">
|
|
|
|
•••
|
|
|
|
<span class="caret pull-right"></span>
|
|
|
|
</span>
|
|
|
|
<ul class="dropdown-menu breadcrumbs-dropdown" role="menu">
|
|
|
|
<% @breadcrumbs_items.each do |item| %>
|
|
|
|
<li>
|
2023-04-06 23:20:49 +08:00
|
|
|
<%= link_to(item[:label], item[:url]) %>
|
2023-03-30 22:29:21 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</span>
|
2023-04-03 00:42:21 +08:00
|
|
|
<span class="delimiter">
|
2023-04-06 18:12:24 +08:00
|
|
|
<%= image_tag "icon_small/navigate_next.svg",
|
|
|
|
alt: "navigate next",
|
|
|
|
class: "navigate_next" %>
|
2023-04-03 00:42:21 +08:00
|
|
|
</span>
|
2023-03-30 22:29:21 +08:00
|
|
|
<% item = last_breadcrumb_items.first %>
|
|
|
|
<%= link_to(item[:label], item[:url],
|
2023-04-06 23:20:49 +08:00
|
|
|
class: "breadcrumbs-link",
|
|
|
|
title: item[:label]) %>
|
2023-04-03 00:42:21 +08:00
|
|
|
<span class="delimiter">
|
2023-04-06 18:12:24 +08:00
|
|
|
<%= image_tag "icon_small/navigate_next.svg",
|
|
|
|
alt: "navigate next",
|
|
|
|
class: "navigate_next" %>
|
2023-04-03 00:42:21 +08:00
|
|
|
</span>
|
2023-03-30 22:29:21 +08:00
|
|
|
<% last_item = last_breadcrumb_items.last %>
|
2023-04-06 23:20:49 +08:00
|
|
|
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
2023-03-30 22:29:21 +08:00
|
|
|
<%= last_item[:label] %>
|
|
|
|
</span>
|
|
|
|
<% else %>
|
|
|
|
<% last_item = @breadcrumbs_items.pop %>
|
|
|
|
<% @breadcrumbs_items.each do |item| %>
|
|
|
|
<%= link_to(item[:label], item[:url],
|
2023-04-06 23:20:49 +08:00
|
|
|
class: "breadcrumbs-link",
|
2023-04-06 18:12:24 +08:00
|
|
|
title: item[:label]) %>
|
2023-04-03 00:42:21 +08:00
|
|
|
<span class="delimiter">
|
|
|
|
<img src="<%= asset_path "icon_small/navigate_next.svg"%>"
|
|
|
|
alt="navigate next"
|
|
|
|
class="navigate_next">
|
|
|
|
</span>
|
2023-03-30 22:29:21 +08:00
|
|
|
|
|
|
|
<% end %>
|
2023-04-06 18:12:24 +08:00
|
|
|
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
2023-03-30 22:29:21 +08:00
|
|
|
<%= last_item[:label] %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|