mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 04:06:53 +08:00
49 lines
1.8 KiB
Text
49 lines
1.8 KiB
Text
<% collapsed = links.length > 4 %>
|
|
|
|
<% if collapsed %>
|
|
<% first_link = links.shift
|
|
last_links = links.pop(2) %>
|
|
<%= link_to(first_link[:label], first_link[:url],
|
|
class: "breadcrumbs-link #{first_link[:class]}",
|
|
title: first_link[:label],
|
|
data: first_link[:data]) %>
|
|
<span class="delimiter">/</span>
|
|
<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">
|
|
<% links.each do |link| %>
|
|
<li>
|
|
<%= link_to(link[:label] + ' /', link[:url],
|
|
data: link[:data]) %>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</span>
|
|
<span class="delimiter">/</span>
|
|
<% last_links.each do |link| %>
|
|
<%= link_to(link[:label], link[:url],
|
|
class: "breadcrumbs-link #{link[:class]}",
|
|
title: link[:label],
|
|
data: link[:data]) %>
|
|
<span class="delimiter">/</span>
|
|
<% end %>
|
|
<% elsif params[:controller] == 'experiments' && %w(canvas table module_archive).include?(params[:action]) %>
|
|
<% links[0..-2].each do |link| %>
|
|
<%= link_to(link[:label], link[:url],
|
|
class: "breadcrumbs-link #{link[:class]}",
|
|
title: link[:label],
|
|
data: link[:data]) %>
|
|
<span class="delimiter">/</span>
|
|
<% end %>
|
|
<% else %>
|
|
<% links.each do |link| %>
|
|
<%= link_to(link[:label], link[:url],
|
|
class: "breadcrumbs-link #{link[:class]}",
|
|
title: link[:label],
|
|
data: link[:data]) %>
|
|
<span class="delimiter">/</span>
|
|
<% end %>
|
|
<% end %>
|