mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 23:35:00 +08:00
changed logic to accomodate templates unique design
This commit is contained in:
parent
c71d8df470
commit
828e566698
1 changed files with 32 additions and 27 deletions
|
@ -43,14 +43,31 @@
|
||||||
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
||||||
<%= last_item[:label] %>
|
<%= last_item[:label] %>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
|
||||||
<% template_paths = [/^\/protocols\/\d+$/, /^\/label_templates\/\d+$/] %>
|
|
||||||
<% if template_paths.any? { |pattern| request.path.match?(pattern) }%>
|
|
||||||
<% last_breadcrumb_items = @breadcrumbs_items.pop(2) %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<% last_item = @breadcrumbs_items.pop %>
|
<% last_item = @breadcrumbs_items.pop %>
|
||||||
<% end %>
|
<% template_paths = [/^\/protocols\/\d+$/, /^\/label_templates\/\d+$/] %>
|
||||||
|
|
||||||
|
<% if template_paths.any? { |pattern| request.path.match?(pattern) } || ["/protocols", "/label_templates"].include?(request.path) %>
|
||||||
|
<span class="breadcrumbs-link" style="color: var(--sn-grey);" title="<%= @breadcrumbs_items.first[:label] %>">
|
||||||
|
<%= @breadcrumbs_items.first[:label] %>
|
||||||
|
</span>
|
||||||
|
<span class="delimiter">
|
||||||
|
<img src="<%= asset_path "icon_small/navigate_next.svg"%>"
|
||||||
|
alt="navigate next"
|
||||||
|
class="navigate_next">
|
||||||
|
</span>
|
||||||
|
<% @breadcrumbs_items.each do |item| %>
|
||||||
|
<%= next if @breadcrumbs_items.first == item%>
|
||||||
|
<%= link_to(item[:label], item[:url],
|
||||||
|
class: "breadcrumbs-link",
|
||||||
|
title: item[:label]) %>
|
||||||
|
<span class="delimiter">
|
||||||
|
<img src="<%= asset_path "icon_small/navigate_next.svg"%>"
|
||||||
|
alt="navigate next"
|
||||||
|
class="navigate_next">
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
<% @breadcrumbs_items.each do |item| %>
|
<% @breadcrumbs_items.each do |item| %>
|
||||||
<%= link_to(item[:label], item[:url],
|
<%= link_to(item[:label], item[:url],
|
||||||
class: "breadcrumbs-link",
|
class: "breadcrumbs-link",
|
||||||
|
@ -61,20 +78,8 @@
|
||||||
class="navigate_next">
|
class="navigate_next">
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if last_breadcrumb_items %>
|
|
||||||
<span class="breadcrumbs-link" style="color: var(--sn-grey);" title="<%= last_breadcrumb_items.first[:label] %>">
|
|
||||||
<%= last_breadcrumb_items.first[:label] %>
|
|
||||||
</span>
|
|
||||||
<span class="delimiter">
|
|
||||||
<img src="<%= asset_path "icon_small/navigate_next.svg"%>"
|
|
||||||
alt="navigate next"
|
|
||||||
class="navigate_next">
|
|
||||||
</span>
|
|
||||||
<span class="breadcrumbs-link" style="color: var(--sn-grey);" title="<%= last_breadcrumb_items.last[:label] %>">
|
|
||||||
<%= last_breadcrumb_items.last[:label] %>
|
|
||||||
</span>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if last_item %>
|
<% if last_item %>
|
||||||
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
<span class="breadcrumbs-link" title="<%= last_item[:label] %>">
|
||||||
<%= last_item[:label] %>
|
<%= last_item[:label] %>
|
||||||
|
|
Loading…
Reference in a new issue