2021-03-04 16:00:58 +08:00
|
|
|
<% target_folder ||= nil %>
|
|
|
|
<% experiment ||= nil %>
|
|
|
|
<% project ||= nil %>
|
2021-03-26 18:58:18 +08:00
|
|
|
<% folder_page ||= false %>
|
2021-03-12 19:21:10 +08:00
|
|
|
<% links = [] %>
|
2021-03-18 21:24:13 +08:00
|
|
|
<% folders = tree_ordered_parent_folders(target_folder) %>
|
2021-03-26 18:58:18 +08:00
|
|
|
<% folders = folders&.take(folders.size - 1) if folder_page %>
|
2021-03-04 16:00:58 +08:00
|
|
|
|
2021-03-12 19:21:10 +08:00
|
|
|
<div class="projects-breadcrumbs breadcrumbs-container">
|
|
|
|
<%
|
|
|
|
links.push({
|
|
|
|
label: t('projects.index.breadcrumbs_root'),
|
|
|
|
url: projects_path(view_mode: projects_view_mode(project: project)),
|
|
|
|
class: 'project-folder-link',
|
|
|
|
data: { projects_cards_url: cards_projects_url, sidebar_url: sidebar_team_path(current_team) }
|
|
|
|
})
|
2021-03-04 16:00:58 +08:00
|
|
|
|
2021-03-26 18:58:18 +08:00
|
|
|
folders&.each do |project_folder|
|
2021-03-12 19:21:10 +08:00
|
|
|
links.push({
|
|
|
|
label: project_folder.name,
|
|
|
|
url: project_folder_path(project_folder),
|
|
|
|
class: 'project-folder-link',
|
|
|
|
data: { projects_cards_url: project_folder_cards_url(project_folder), sidebar_url: sidebar_team_path(current_team, project_folder_id: project_folder.id)}
|
|
|
|
})
|
|
|
|
end
|
2021-03-04 16:00:58 +08:00
|
|
|
|
2021-03-12 19:21:10 +08:00
|
|
|
links.push({
|
|
|
|
label: project.name,
|
|
|
|
url: project_path(project)
|
|
|
|
}) if project
|
|
|
|
|
|
|
|
links.push({
|
|
|
|
label: experiment.name,
|
|
|
|
url: canvas_experiment_path(experiment)
|
|
|
|
}) if experiment
|
|
|
|
%>
|
|
|
|
<%= render partial: 'shared/breadcrumbs', locals: {links: links} %>
|
2020-11-24 22:42:06 +08:00
|
|
|
</div>
|