diff --git a/app/assets/stylesheets/reports.scss b/app/assets/stylesheets/reports.scss index 2f46ee3cd..bb0ae8c6a 100644 --- a/app/assets/stylesheets/reports.scss +++ b/app/assets/stylesheets/reports.scss @@ -131,6 +131,10 @@ ul.project-contents-list { padding-left: 15px !important; } +ul.experiment-contents-list { + padding-left: 30px !important; +} + /** "New element" floating element */ .new-element { display: block; diff --git a/app/views/reports/new/modal/_project_contents.html.erb b/app/views/reports/new/modal/_project_contents.html.erb index d05b53af9..26a873d6d 100644 --- a/app/views/reports/new/modal/_project_contents.html.erb +++ b/app/views/reports/new/modal/_project_contents.html.erb @@ -9,7 +9,7 @@ - <% if project.my_modules.count > 0 %> + <% if project.project_my_modules.count > 0 %>
  • @@ -37,7 +37,7 @@
    <%= t("projects.reports.elements.modals.project_contents.project_tab") %>
    <%= render partial: "reports/new/modal/project_contents_inner.html.erb", locals: { form: f, project: project } %> - <% if project.my_modules.count > 0 %> + <% if project.project_my_modules.count > 0 %>
    <%= t("projects.reports.elements.modals.project_contents.modules_tab") %>
    <%= render partial: "reports/new/modal/module_contents_inner.html.erb", locals: { form: f } %> @@ -69,9 +69,13 @@ if (nextUl.length && nextUl.is("ul.project-contents-list")) { nextUl.find("input:checkbox").prop("checked", this.checked); } + if (nextUl.length && nextUl.is("ul.experiment-contents-list")) { + nextUl.find("input:checkbox").prop("checked", this.checked); + } }); projectAll.click(function() { - var parentLists = $(this).parents("ul.project-contents-list"); + var parentLists = $(this).parents("ul.project-contents-list, ul.experiment-contents-list"); + if (parentLists.length) { var prevEl = parentLists.prev(); if (prevEl.length && prevEl.is("div.checkbox")) { diff --git a/app/views/reports/new/modal/_project_contents_inner.html.erb b/app/views/reports/new/modal/_project_contents_inner.html.erb index 028713aeb..4d3ce9320 100644 --- a/app/views/reports/new/modal/_project_contents_inner.html.erb +++ b/app/views/reports/new/modal/_project_contents_inner.html.erb @@ -1,4 +1,3 @@ -<% modules_without_group = project.modules_without_group %>
    @@ -6,36 +5,46 @@
    -<% if project.my_modules.count > 0 %> +<% if project.project_my_modules.count > 0 %> <%= form.check_box :project, label: project.name, class: "project-all-cb" %>
      - <% project.my_module_groups.each do |my_module_group| %> + <% project.experiments.each do |experiment| %>
    • - <%= form.check_box "module_group_#{my_module_group.id}", label: my_module_group.name, class: "project-all-cb" %> - <% if my_module_group.my_modules.present? then %> -
        - <% my_module_group.ordered_modules.each do |my_module| %> + <%= form.check_box "experiment_#{experiment.id}", label: experiment.name, class: "project-all-cb" %> +
          + <% experiment.my_module_groups.each do |my_module_group| %> +
        • + <%= form.check_box "module_group_#{my_module_group.id}", label: my_module_group.name, class: "project-all-cb" %> + <% if my_module_group.my_modules.present? then %> +
            + <% my_module_group.ordered_modules.each do |my_module| %> +
          • + <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %> +
          • + <% end %> +
          + <% end %> +
        • + <% end %> +
        + + + + <% modules_without_group = experiment.modules_without_group %> + <% if modules_without_group.present? and modules_without_group.count > 0 %> +
      • + <%= form.check_box :no_module_group, label: t("projects.reports.elements.modals.project_contents_inner.no_module_group"), class: "project-all-cb" %> +
          + <% modules_without_group.each do |my_module| %>
        • <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
        • <% end %>
        - <% end %> -
      • + + <% end %> <% end %> - <% if modules_without_group.present? and modules_without_group.count > 0 %> -
      • - <%= form.check_box :no_module_group, label: t("projects.reports.elements.modals.project_contents_inner.no_module_group"), class: "project-all-cb" %> -
          - <% modules_without_group.each do |my_module| %> -
        • - <%= form.check_box "modules[#{my_module.id}]", label: my_module.name %> -
        • - <% end %> -
        -
      • - <% end %>
      <% else %>
      @@ -43,4 +52,4 @@ <%= t("projects.reports.elements.modals.project_contents_inner.no_modules") %>
      -<% end %> \ No newline at end of file +<% end %>