diff --git a/app/assets/stylesheets/navigation/breadcrumbs.scss b/app/assets/stylesheets/navigation/breadcrumbs.scss
index 2918adaf6..d0b479989 100644
--- a/app/assets/stylesheets/navigation/breadcrumbs.scss
+++ b/app/assets/stylesheets/navigation/breadcrumbs.scss
@@ -19,6 +19,10 @@
&:last-child {
color: var(--sn-grey);
}
+
+ &.plain-text {
+ color: var(--sn-grey);
+ }
}
.delimiter {
diff --git a/app/controllers/label_templates_controller.rb b/app/controllers/label_templates_controller.rb
index 27dcf7e79..bc5183b43 100644
--- a/app/controllers/label_templates_controller.rb
+++ b/app/controllers/label_templates_controller.rb
@@ -207,7 +207,6 @@ class LabelTemplatesController < ApplicationController
@breadcrumbs_items.push({
label: t('breadcrumbs.templates'),
- url: label_templates_path
})
@breadcrumbs_items.push({
diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb
index d805a1a40..cb5a436cb 100644
--- a/app/controllers/protocols_controller.rb
+++ b/app/controllers/protocols_controller.rb
@@ -1164,7 +1164,6 @@ class ProtocolsController < ApplicationController
@breadcrumbs_items.push({
label: t('breadcrumbs.templates'),
- url: archived_branch ? protocols_path(type: :archived) : protocols_path,
archived: archived_branch
})
diff --git a/app/views/shared/navigation/_breadcrumbs.html.erb b/app/views/shared/navigation/_breadcrumbs.html.erb
index 4624e867f..791d1d144 100644
--- a/app/views/shared/navigation/_breadcrumbs.html.erb
+++ b/app/views/shared/navigation/_breadcrumbs.html.erb
@@ -44,41 +44,27 @@
<%= last_item[:label] %>
<% 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 %>
- <% last_item = @breadcrumbs_items.pop %>
- <% end %>
-
+ <% last_item = @breadcrumbs_items.pop %>
<% @breadcrumbs_items.each do |item| %>
- <%= link_to(item[:label], item[:url],
- class: "breadcrumbs-link",
- title: item[:label]) %>
+ <% 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">
+ alt="navigate next"
+ class="navigate_next">
<% end %>
- <% if last_breadcrumb_items %>
-
- <%= last_breadcrumb_items.first[:label] %>
-
-
-
"
- alt="navigate next"
- class="navigate_next">
-
-
- <%= last_breadcrumb_items.last[:label] %>
-
- <% end %>
- <% if last_item %>
-
- <%= last_item[:label] %>
-
- <% end %>
+
+ <%= last_item[:label] %>
+
<% end %>
<% end %>