Merge pull request #3236 from aignatov-bio/ai-sci-5597-fix-breadcrumbs-for-folders

Fix folders breadcrumbs [SCI-5597]
This commit is contained in:
Miha Mencin 2021-03-29 11:11:34 +02:00 committed by GitHub
commit 8625e99e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -46,7 +46,7 @@ class ProjectsController < ApplicationController
else
if current_folder
breadcrumbs_html = render_to_string(partial: 'projects/index/breadcrumbs.html.erb',
locals: { target_folder: current_folder })
locals: { target_folder: current_folder, folder_page: true })
projects_cards_url = project_folder_cards_url(current_folder)
title = current_folder.name
else

View file

@ -1,8 +1,10 @@
<% target_folder ||= nil %>
<% experiment ||= nil %>
<% project ||= nil %>
<% folder_page ||= false %>
<% links = [] %>
<% folders = tree_ordered_parent_folders(target_folder) %>
<% folders = folders&.take(folders.size - 1) if folder_page %>
<div class="projects-breadcrumbs breadcrumbs-container">
<%
@ -13,7 +15,7 @@
data: { projects_cards_url: cards_projects_url, sidebar_url: sidebar_team_path(current_team) }
})
folders&.take(folders.size - 1)&.each do |project_folder|
folders&.each do |project_folder|
links.push({
label: project_folder.name,
url: project_folder_path(project_folder),

View file

@ -1,6 +1,6 @@
<div class="content-header sticky-header">
<div id="breadcrumbsWrapper">
<%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: current_folder } if current_folder %>
<%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: current_folder, folder_page: true } if current_folder %>
</div>
<div class="title-row">
<h1 data-view-mode="active" class="projects-title name-readonly-placeholder"><%= current_folder&.name || t('projects.index.head_title') %></h1>