mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 21:20:08 +08:00
Merge pull request #5459 from G-Chubinidze/gc_SCI_8404
(A) label for archived projects, inventories and protocol tempates in breadcrumbs [SCI-8404]
This commit is contained in:
commit
5c3ebc2509
4 changed files with 23 additions and 2 deletions
|
@ -31,6 +31,13 @@ module Breadcrumbs
|
|||
|
||||
include_my_module(my_module) if my_module
|
||||
|
||||
archived_exists = @breadcrumbs_items.any? { |item| item[:archived] == true }
|
||||
|
||||
if params[:view_mode] == 'archived' || archived_exists
|
||||
@breadcrumbs_items.each do |item|
|
||||
item[:label] = "(A) #{item[:label]}"
|
||||
end
|
||||
end
|
||||
@breadcrumbs_items
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1173,5 +1173,13 @@ class ProtocolsController < ApplicationController
|
|||
archived: @protocol.archived?
|
||||
})
|
||||
end
|
||||
|
||||
archived_exists = @breadcrumbs_items.any? { |item| item[:archived] == true }
|
||||
|
||||
if params[:type] == 'archived' || archived_exists
|
||||
@breadcrumbs_items.each do |item|
|
||||
item[:label] = "(A) #{item[:label]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -542,5 +542,13 @@ class RepositoriesController < ApplicationController
|
|||
archived: @repository.archived?
|
||||
})
|
||||
end
|
||||
|
||||
archived_exists = @breadcrumbs_items.any? { |item| item[:archived] == true }
|
||||
|
||||
if params[:archived] == 'true' || archived_exists
|
||||
@breadcrumbs_items.each do |item|
|
||||
item[:label] = "(A) #{item[:label]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<% if @breadcrumbs_items&.length %>
|
||||
<% archived_exists = @breadcrumbs_items.any? { |item| item[:archived] } %>
|
||||
<% @breadcrumbs_items.each { |item| item[:label] = "(A) #{item[:label]}" if archived_exists } %>
|
||||
<% shortened = @breadcrumbs_items.length > 4 %>
|
||||
|
||||
<% if shortened %>
|
||||
|
|
Loading…
Reference in a new issue