<div>
  <em>
   <%= t("projects.reports.elements.modals.experiment_contents_inner.instructions") %>
  </em>
</div>

<% if experiment.my_modules.exists? %>
  <div class="checkbox-tree">
    <ul>
      <li>
        <%= form.check_box :experiment_all, label: experiment.name %>
        <ul>

          <% experiment.my_module_groups.each do |my_module_group| %>
            <% if my_module_group.my_modules.exists? then %>
                <% my_module_group.ordered_modules.each do |my_module| %>
                  <li>
                    <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
                  </li>
                <% end %>
            <% end %>
          <% end %>

          <!-- Tasks without groups -->
          <% modules_without_group = experiment.modules_without_group %>
          <% if modules_without_group.exists? %>
            <% modules_without_group.each do |my_module| %>
              <li>
                <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
              </li>
            <% end %>
          <% end %>

        </ul>
      </li>
    </ul>
  </div>
<% else %>
  <div>
    <em>
      <%= t("projects.reports.elements.modals.experiment_contents_inner.no_modules") %>
    </em>
  </div>
<% end %>
