mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-03 22:21:53 +08:00
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:
commit
2972fac96e
8 changed files with 39 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
class SearchController < ApplicationController
|
||||
include IconsHelper
|
||||
include ProjectFoldersHelper
|
||||
before_action :load_vars, only: :index
|
||||
|
||||
def index
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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 } %>
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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 %>
|
|
@ -273,6 +273,7 @@ en:
|
|||
description: "Description: "
|
||||
no_description: "No description"
|
||||
team: "Team: "
|
||||
folder: "Folders: "
|
||||
repository: "Inventory: "
|
||||
repository_row: "Inventory item: "
|
||||
project: "Project: "
|
||||
|
|
Loading…
Reference in a new issue