scinote-web/app/views/reports/wizard/_project_contents.html.erb

43 lines
2.2 KiB
Text
Raw Normal View History

2021-04-08 23:40:16 +08:00
<ul>
<% project.experiments.viewable_by_user(current_user, current_team).includes(:my_modules).active.sort_by { |e| @project_contents[:experiments].index(e.id) || @project_contents[:experiments].length if report }.each do |experiment| %>
2021-04-08 23:40:16 +08:00
<li class="experiment-element">
<div class="experiment-block">
<span class="sci-checkbox-container">
2021-04-13 20:10:52 +08:00
<input type="checkbox" value="<%= experiment.id %>" class="sci-checkbox report-experiment-checkbox"
<%= 'checked' if !report || @project_contents[:experiments].include?(experiment.id)
2021-04-13 20:10:52 +08:00
%>/>
2021-04-08 23:40:16 +08:00
<span class="sci-checkbox-label"></span>
</span>
<i class="fas fa-caret-down " data-toggle="collapse" href="#experimentContentContainer<%= experiment.id %>" aria-expanded="false"></i>
<span class="experiment-name" title="<%= experiment.name %>">
2021-04-08 23:40:16 +08:00
<%= experiment.name %>
</span>
<div class="move-buttons sci-btn-group">
<button class="btn btn-light icon-btn move-up">
<i class="fas fa-arrow-up"></i>
</button>
<button class="btn btn-light icon-btn move-down">
<i class="fas fa-arrow-down"></i>
</button>
</div>
</div>
<ul class="experiment-contents collapse in" id="experimentContentContainer<%= experiment.id %>">
<% experiment.my_modules.viewable_by_user(current_user, current_team).active.sort_by { |m| @project_contents[:my_modules].index(m.id) || @project_contents[:my_modules].length if report }.each do |my_module| %>
2021-04-08 23:40:16 +08:00
<li class="experiment-my-module">
<span class="sci-checkbox-container">
2021-04-13 20:10:52 +08:00
<input type="checkbox" value="<%= my_module.id %>" class="sci-checkbox report-my-module-checkbox"
<%= 'checked' if !report || @project_contents[:my_modules].include?(my_module.id)
2021-04-13 20:10:52 +08:00
%>/>
2021-04-08 23:40:16 +08:00
<span class="sci-checkbox-label"></span>
</span>
<span class="my-module-name" title="<%= my_module.name %>">
<%= my_module.name %>
</span>
2021-04-08 23:40:16 +08:00
<i class="fas fa-grip-vertical"></i>
</li>
<% end %>
</ul>
</li>
<% end %>
</ul>