2016-07-21 19:11:15 +08:00
|
|
|
<% link_to_page = :protocols 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(my_module.name, query.strip.split(/\s+/)) : my_module.name %>
|
2016-02-12 23:52:43 +08:00
|
|
|
|
|
|
|
<% if my_module.archived? %>
|
|
|
|
<span class="label label-warning"><%=t "search.index.archived" %></span>
|
2016-07-28 17:05:28 +08:00
|
|
|
<% if can_view_experiment_archive(my_module.experiment) and can_restore_module(my_module) %>
|
|
|
|
<a href="<%= module_archive_experiment_url(my_module.experiment) %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<%= text %>
|
|
|
|
</a>
|
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<% if can_view_module(my_module) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% 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 %>
|
2016-07-27 22:28:18 +08:00
|
|
|
<a href="<%= canvas_experiment_path(my_module.experiment) %>">
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= text %>
|
|
|
|
</a>
|
|
|
|
<% when :results %>
|
2016-08-31 17:01:10 +08:00
|
|
|
<a href="<%= results_my_module_path(my_module) %>">
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= text %>
|
|
|
|
</a>
|
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|