mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Merge pull request #3236 from aignatov-bio/ai-sci-5597-fix-breadcrumbs-for-folders
Fix folders breadcrumbs [SCI-5597]
This commit is contained in:
commit
8625e99e99
3 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue