scinote-web/app/views/search/results/partials/_project_text.html.erb
2016-10-17 15:10:26 +02:00

29 lines
994 B
Plaintext

<% 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>
<% if can_view_projects(project.organization) and can_restore_project(project) %>
<%= route_to_other_org projects_archive_path(organization: project.organization),
project.organization,
text %>
<% else %>
<%= text %>
<% end %>
<% else %>
<% if can_view_project(project) %>
<% if link_to_page == :show %>
<%= route_to_other_org project_path(project),
project.organization,
text %>
<% else %>
<%= route_to_other_org root_path,
nil,
text %>
<% end %>
<% else %>
<%= text %>
<% end %>
<% end %>