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? %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<span class="label label-warning"><%=t 'search.index.archived' %></span>
|
2021-09-14 17:08:35 +08:00
|
|
|
<% if can_restore_my_module?(my_module) %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= route_to_other_team module_archive_experiment_url(my_module.experiment),
|
|
|
|
my_module.experiment.project.team,
|
|
|
|
text %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2018-01-29 18:36:36 +08:00
|
|
|
<% if can_read_experiment?(my_module.experiment) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% case link_to_page %>
|
2017-06-23 22:06:11 +08:00
|
|
|
<% when :repositories %>
|
2020-05-15 04:10:13 +08:00
|
|
|
<%= route_to_other_team protocols_my_module_path(my_module),
|
2017-06-23 22:06:11 +08:00
|
|
|
my_module.experiment.project.team,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% when :protocols %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= route_to_other_team protocols_my_module_path(my_module),
|
|
|
|
my_module.experiment.project.team,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% when :canvas %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= route_to_other_team canvas_experiment_path(my_module.experiment),
|
|
|
|
my_module.experiment.project.team,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% when :results %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= route_to_other_team results_my_module_path(my_module),
|
|
|
|
my_module.experiment.project.team,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|