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

43 lines
2.2 KiB
Plaintext

<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| %>
<li class="experiment-element">
<div class="experiment-block">
<span class="sci-checkbox-container">
<input type="checkbox" value="<%= experiment.id %>" class="sci-checkbox report-experiment-checkbox"
<%= 'checked' if !report || @project_contents[:experiments].include?(experiment.id)
%>/>
<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 %>">
<%= 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| %>
<li class="experiment-my-module">
<span class="sci-checkbox-container">
<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)
%>/>
<span class="sci-checkbox-label"></span>
</span>
<span class="my-module-name" title="<%= my_module.name %>">
<%= my_module.name %>
</span>
<i class="fas fa-grip-vertical"></i>
</li>
<% end %>
</ul>
</li>
<% end %>
</ul>