mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-07 16:09:57 +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
|
class SearchController < ApplicationController
|
||||||
include IconsHelper
|
include IconsHelper
|
||||||
|
include ProjectFoldersHelper
|
||||||
before_action :load_vars, only: :index
|
before_action :load_vars, only: :index
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -17,6 +17,14 @@
|
||||||
locals: { project: experiment.project, link_to_page: :show } %>
|
locals: { project: experiment.project, link_to_page: :show } %>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<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>
|
<span>
|
||||||
<%=t "search.index.team" %>
|
<%=t "search.index.team" %>
|
||||||
<%= render partial: "search/results/partials/team_text.html.erb",
|
<%= render partial: "search/results/partials/team_text.html.erb",
|
||||||
|
|
|
@ -34,6 +34,14 @@
|
||||||
locals: { project: mod.experiment.project, link_to_page: :show } %>
|
locals: { project: mod.experiment.project, link_to_page: :show } %>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<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>
|
<span>
|
||||||
<%=t "search.index.team" %>
|
<%=t "search.index.team" %>
|
||||||
<%= render partial: "search/results/partials/team_text.html.erb",
|
<%= render partial: "search/results/partials/team_text.html.erb",
|
||||||
|
|
|
@ -11,6 +11,14 @@
|
||||||
<%= l(project_folder.created_at, format: :full) %>
|
<%= l(project_folder.created_at, format: :full) %>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<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>
|
<span>
|
||||||
<%= t('search.index.team') %>
|
<%= t('search.index.team') %>
|
||||||
<%= render partial: 'search/results/partials/team_text.html.erb', locals: { team: project_folder.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 %>
|
<%=l project.created_at, format: :full %>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<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>
|
<span>
|
||||||
<%=t 'search.index.team' %>
|
<%=t 'search.index.team' %>
|
||||||
<%= render partial: 'search/results/partials/team_text.html.erb',
|
<%= 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 %>
|
<% text = query.present? ? highlight(project_folder.name, query.strip.split(/\s+/)) : project_folder.name %>
|
||||||
|
|
||||||
<% if can_read_team?(project_folder.team) %>
|
<% if can_read_team?(project_folder.team) %>
|
||||||
<% if link_to_page == :show %>
|
<%= route_to_other_team(project_folder_path(project_folder), project_folder.team, text) %>
|
||||||
<%= route_to_other_team(projects_path, project_folder.team, text) %>
|
|
||||||
<% else %>
|
|
||||||
<%= route_to_other_team(projects_path, project_folder.team, text) %>
|
|
||||||
<% end %>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= text %>
|
<%= text %>
|
||||||
<% end %>
|
<% 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: "
|
description: "Description: "
|
||||||
no_description: "No description"
|
no_description: "No description"
|
||||||
team: "Team: "
|
team: "Team: "
|
||||||
|
folder: "Folders: "
|
||||||
repository: "Inventory: "
|
repository: "Inventory: "
|
||||||
repository_row: "Inventory item: "
|
repository_row: "Inventory item: "
|
||||||
project: "Project: "
|
project: "Project: "
|
||||||
|
|
Loading…
Reference in a new issue