scinote-web/app/views/search/results/partials/_my_module_text.html.erb
Luka Murn edafcaeed6 Move route module_archive_project -> module_archive_experiment
Also add some new routes, move some templates.
2016-07-29 10:25:02 +02:00

39 lines
1.2 KiB
Text

<% link_to_page = :protocols if local_assigns[:link_to_page].nil? %>
<% query ||= nil %>
<% text = query.present? ? highlight(my_module.name, query.strip.split(/\s+/)) : my_module.name %>
<% if my_module.archived? %>
<span class="label label-warning"><%=t "search.index.archived" %></span>
<% if can_view_experiment_archive(my_module.experiment) and can_restore_module(my_module) %>
<a href="<%= module_archive_experiment_url(my_module.experiment) %>">
<%= text %>
</a>
<% else %>
<%= text %>
<% end %>
<% else %>
<% if can_view_module(my_module) %>
<% case link_to_page %>
<% when :samples %>
<a href="<%= samples_my_module_path(my_module) %>">
<%= text %>
</a>
<% when :protocols %>
<a href="<%= protocols_my_module_path(my_module) %>">
<%= text %>
</a>
<% when :canvas %>
<a href="<%= canvas_experiment_path(my_module.experiment) %>">
<%= text %>
</a>
<% when :results %>
<a href="<%= results_my_module_path(my_module.experiment.project) %>">
<%= text %>
</a>
<% else %>
<%= text %>
<% end %>
<% else %>
<%= text %>
<% end %>
<% end %>