scinote-web/app/views/shared/sidebar/_experiments.html.erb

30 lines
1.5 KiB
Plaintext
Raw Normal View History

<% if project.active_experiments.present? %>
2020-02-27 23:04:44 +08:00
<ul class="tree-child hidden" data-active="<%= project.id == current_project&.id %>" data-branch-id="pro<%= project.id %>">
<% project.active_experiments.each do |experiment| %>
<% cache [action_name, current_user, experiment] do %>
2020-02-27 23:04:44 +08:00
<li data-parent="candidate" class="branch <%= 'active' if experiment_page? && current_experiment == experiment %>">
2020-01-29 20:22:35 +08:00
<span class="tree-link line-wrap first-indent" title="<%= experiment.name %>">
2020-02-27 23:04:44 +08:00
<% if experiment.active_my_modules.any? %>
<i class="fas fa-caret-right tree-toggle"></i>
<% end %>
<%= link_to experiment.name,
experiment_action_to_link_to(experiment),
2020-01-29 20:22:35 +08:00
class: 'overview_exp_label line-wrap',
2020-02-27 23:04:44 +08:00
style: (current_experiment == experiment ? 'font-weight: bold' : ''),
data: { type: 'experiment', id: experiment.id }
%>
2020-02-27 23:04:44 +08:00
<% if experiment_page? && current_experiment == experiment && action_name =='canvas' %>
<a href="" class="canvas-center-on"><span class="fas fa-map-marker-alt"></span></a>
<% end %>
2016-08-03 22:09:45 +08:00
</span>
2020-02-27 23:04:44 +08:00
<%= render partial: 'shared/sidebar/my_modules', locals: {
experiment: experiment,
current_experiment: current_experiment,
current_task: current_task
} %>
2016-08-03 22:09:45 +08:00
</li>
<% end %>
2016-07-29 21:58:47 +08:00
<% end %>
2018-03-22 18:41:33 +08:00
</ul>
<% end %>