scinote-web/app/views/search/results/partials/_project_text.html.erb
2023-12-07 12:53:21 +01:00

22 lines
737 B
Text

<% link_to_page = :canvas if local_assigns[:link_to_page].nil? %>
<% query ||= nil %>
<% text = query.present? ? highlight(project.name, query.strip.split(/\s+/)) : project.name %>
<% if project.archived? %>
<span class="label label-warning"><%=t 'search.index.archived' %></span>
<%= text %>
<% else %>
<% if can_read_project?(project) %>
<% if link_to_page == :show %>
<%= route_to_other_team experiments_path(project_id: project),
project.team,
text %>
<% else %>
<%= route_to_other_team root_path,
project.team,
text %>
<% end %>
<% else %>
<%= text %>
<% end %>
<% end %>