Merge pull request #3140 from aignatov-bio/ai-sci-5407-add-folders-link-to-search

Add folder links to global search [SCI-5407]
This commit is contained in:
aignatov-bio 2021-02-05 15:24:23 +01:00 committed by GitHub
commit 2972fac96e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 5 deletions

View file

@ -1,5 +1,6 @@
class SearchController < ApplicationController
include IconsHelper
include ProjectFoldersHelper
before_action :load_vars, only: :index
def index

View file

@ -17,6 +17,14 @@
locals: { project: experiment.project, link_to_page: :show } %>
</span>
<br>
<% if experiment.project.project_folder %>
<span>
<%=t "search.index.folder" %>
<%= render partial: "search/results/partials/project_folders_text.html.erb",
locals: { folder: experiment.project.project_folder } %>
</span>
<br>
<% end %>
<span>
<%=t "search.index.team" %>
<%= render partial: "search/results/partials/team_text.html.erb",

View file

@ -34,6 +34,14 @@
locals: { project: mod.experiment.project, link_to_page: :show } %>
</span>
<br>
<% if mod.experiment.project.project_folder %>
<span>
<%=t "search.index.folder" %>
<%= render partial: "search/results/partials/project_folders_text.html.erb",
locals: { folder: mod.experiment.project.project_folder } %>
</span>
<br>
<% end %>
<span>
<%=t "search.index.team" %>
<%= render partial: "search/results/partials/team_text.html.erb",

View file

@ -11,6 +11,14 @@
<%= l(project_folder.created_at, format: :full) %>
</span>
<br>
<% if project_folder.parent_folder %>
<span>
<%=t "search.index.folder" %>
<%= render partial: "search/results/partials/project_folders_text.html.erb",
locals: { folder: project_folder.parent_folder } %>
</span>
<br>
<% end %>
<span>
<%= t('search.index.team') %>
<%= render partial: 'search/results/partials/team_text.html.erb', locals: { team: project_folder.team } %>

View file

@ -11,6 +11,14 @@
<%=l project.created_at, format: :full %>
</span>
<br>
<% if project.project_folder %>
<span>
<%=t "search.index.folder" %>
<%= render partial: "search/results/partials/project_folders_text.html.erb",
locals: { folder: project.project_folder } %>
</span>
<br>
<% end %>
<span>
<%=t 'search.index.team' %>
<%= render partial: 'search/results/partials/team_text.html.erb',

View file

@ -2,11 +2,7 @@
<% text = query.present? ? highlight(project_folder.name, query.strip.split(/\s+/)) : project_folder.name %>
<% if can_read_team?(project_folder.team) %>
<% if link_to_page == :show %>
<%= route_to_other_team(projects_path, project_folder.team, text) %>
<% else %>
<%= route_to_other_team(projects_path, project_folder.team, text) %>
<% end %>
<%= route_to_other_team(project_folder_path(project_folder), project_folder.team, text) %>
<% else %>
<%= text %>
<% end %>

View file

@ -0,0 +1,4 @@
<% tree_ordered_parent_folders(folder)&.each do |project_folder| %>
<%= route_to_other_team(project_folder_path(project_folder), project_folder.team, project_folder.name) %>
<span>/</span>
<% end %>

View file

@ -273,6 +273,7 @@ en:
description: "Description: "
no_description: "No description"
team: "Team: "
folder: "Folders: "
repository: "Inventory: "
repository_row: "Inventory item: "
project: "Project: "