Fix checkbox in experiment reports

This commit is contained in:
Jure Grabnar 2016-08-09 13:13:50 +02:00
parent 208e85e7e0
commit 9f7df0af76
2 changed files with 11 additions and 13 deletions

View file

@ -67,7 +67,7 @@
projectCheckAlls.click(function() {
var nextUl = $(this).closest("div.checkbox").next();
if (nextUl.length && nextUl.is("ul.project-contents-list, \
ul-experiment-contents-list")) {
ul.experiment-contents-list")) {
nextUl.find("input:checkbox").prop("checked", this.checked);
}
});

View file

@ -9,6 +9,7 @@
<%= form.check_box :project, label: project.name, class: "project-all-cb" %>
<ul class="no-style project-contents-list">
<% project.experiments.is_archived(false).each do |experiment| %>
<% next unless experiment.my_modules.is_archived(false).count > 0 %>
<li>
<%= form.check_box "experiment_#{experiment.id}", label: experiment.name, class: "project-all-cb" %>
<ul class="no-style experiment-contents-list">
@ -21,22 +22,19 @@
<% end %>
<% end %>
<% end %>
</ul>
</li>
<!-- Tasks without groups -->
<% modules_without_group = experiment.modules_without_group %>
<% if modules_without_group.present? and modules_without_group.count > 0 %>
<ul class="no-style experiment-contents-list">
<% modules_without_group.each do |my_module| %>
<li>
<%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
</li>
<!-- Tasks without groups -->
<% modules_without_group = experiment.modules_without_group %>
<% if modules_without_group.present? and modules_without_group.count > 0 %>
<% modules_without_group.each do |my_module| %>
<li>
<%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
</li>
<% end %>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</ul>
<% else %>
<div>