From 1c93131ff1be9089aa3c7054d50b13b3ce15467f Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Fri, 26 Mar 2021 11:58:18 +0100 Subject: [PATCH] Fix folders breadcrumbs [SCI-5597] --- app/controllers/projects_controller.rb | 2 +- app/views/projects/index/_breadcrumbs.html.erb | 4 +++- app/views/projects/index/_header.html.erb | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index bb6046f90..084942033 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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 diff --git a/app/views/projects/index/_breadcrumbs.html.erb b/app/views/projects/index/_breadcrumbs.html.erb index 5bdf4b083..101686c22 100644 --- a/app/views/projects/index/_breadcrumbs.html.erb +++ b/app/views/projects/index/_breadcrumbs.html.erb @@ -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 %>