scinote-web/app/views/search/results/partials/_project_text.html.erb

28 lines
828 B
Plaintext
Raw Normal View History

2016-07-21 19:11:15 +08:00
<% link_to_page = :root if local_assigns[:link_to_page].nil? %>
2016-02-12 23:52:43 +08:00
<% query ||= nil %>
2016-07-21 19:11:15 +08:00
<% text = query.present? ? highlight(project.name, query.strip.split(/\s+/)) : project.name %>
2016-02-12 23:52:43 +08:00
<% if project.archived? %>
<span class="label label-warning"><%=t "search.index.archived" %></span>
<% if can_view_projects(project.organization) and can_restore_project(project) %>
<a href="<%= projects_archive_path(organization: project.organization) %>">
<%= text %>
</a>
<% else %>
<%= text %>
<% end %>
<% else %>
<% if can_view_project(project) %>
2016-07-21 19:11:15 +08:00
<% if link_to_page == :canvas %>
<a href="<%= canvas_project_path(project) %>">
<%= text %>
</a>
<% else %>
<a href="<%= root_path %>">
<%= text %>
</a>
<% end %>
2016-02-12 23:52:43 +08:00
<% else %>
<%= text %>
<% end %>
<% end %>