mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-28 16:08:22 +08:00
Replace present? with more efficient exitst? for report content adding modal. [fixes SCI-487]
This commit is contained in:
parent
79ec3b5e4c
commit
2c6f888cbc
5 changed files with 16 additions and 16 deletions
|
@ -4,7 +4,7 @@
|
|||
</em>
|
||||
</div>
|
||||
|
||||
<% if experiment.my_modules.present? %>
|
||||
<% if experiment.my_modules.exists? %>
|
||||
<div class="checkbox-tree">
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<ul>
|
||||
|
||||
<% experiment.my_module_groups.each do |my_module_group| %>
|
||||
<% if my_module_group.my_modules.present? then %>
|
||||
<% 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 %>
|
||||
|
@ -23,7 +23,7 @@
|
|||
|
||||
<!-- Tasks without groups -->
|
||||
<% modules_without_group = experiment.modules_without_group %>
|
||||
<% if modules_without_group.present? and modules_without_group.present? %>
|
||||
<% if modules_without_group.exists? %>
|
||||
<% modules_without_group.each do |my_module| %>
|
||||
<li>
|
||||
<%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= form.check_box :module_all, label: t("projects.reports.elements.modals.module_contents_inner.check_all") %>
|
||||
<ul>
|
||||
|
||||
<% if my_module_undefined or my_module.protocol.steps.present? %>
|
||||
<% if my_module_undefined or my_module.protocol.steps.exists? %>
|
||||
<li>
|
||||
<%= form.check_box :module_steps, label: t("projects.reports.elements.modals.module_contents_inner.steps") %>
|
||||
</li>
|
||||
|
@ -24,24 +24,24 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.active? }).present? %>
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.active? }).exists? %>
|
||||
<li>
|
||||
<%= form.check_box :module_results, label: t("projects.reports.elements.modals.module_contents_inner.results") %>
|
||||
<ul>
|
||||
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_asset && r.active? }).present? %>
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_asset && r.active? }).exists? %>
|
||||
<li>
|
||||
<%= form.check_box :module_result_assets, label: t("projects.reports.elements.modals.module_contents_inner.result_assets") %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_table && r.active? }).present? %>
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_table && r.active? }).exists? %>
|
||||
<li>
|
||||
<%= form.check_box :module_result_tables, label: t("projects.reports.elements.modals.module_contents_inner.result_tables") %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_text && r.active? }).present? %>
|
||||
<% if my_module_undefined or (my_module.results.select { |r| r.is_text && r.active? }).exists? %>
|
||||
<li>
|
||||
<%= form.check_box :module_result_texts, label: t("projects.reports.elements.modals.module_contents_inner.result_texts") %>
|
||||
</li>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<span class="hidden-xs"><%= t("projects.reports.elements.modals.project_contents.tasks_tab") %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% if project.project_my_modules.is_archived(false).present? %>
|
||||
<% if project.project_my_modules.is_archived(false).exists? %>
|
||||
<li role="presentation">
|
||||
<a href="#content-tab" aria-controls="content-tab" role="tab" data-toggle="tab">
|
||||
<span class="glyphicon glyphicon-link visible-xs"></span>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</em>
|
||||
</div>
|
||||
|
||||
<% if project.project_my_modules.is_archived(false).present? %>
|
||||
<% if project.project_my_modules.is_archived(false).exists? %>
|
||||
<div class="checkbox-tree">
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -12,13 +12,13 @@
|
|||
<ul>
|
||||
|
||||
<% project.experiments.is_archived(false).each do |experiment| %>
|
||||
<% next unless experiment.my_modules.is_archived(false).present? %>
|
||||
<% next unless experiment.my_modules.is_archived(false).exists? %>
|
||||
<li>
|
||||
<%= form.check_box "experiment_#{experiment.id}", label: experiment.name %>
|
||||
<ul>
|
||||
|
||||
<% experiment.my_module_groups.each do |my_module_group| %>
|
||||
<% next unless my_module_group.my_modules.is_archived(false).present? %>
|
||||
<% next unless my_module_group.my_modules.is_archived(false).exists? %>
|
||||
<% my_module_group.ordered_modules.is_archived(false).each do |my_module| %>
|
||||
<li>
|
||||
<%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
<!-- Tasks without groups -->
|
||||
<% modules_without_group = experiment.modules_without_group %>
|
||||
<% if modules_without_group.present? %>
|
||||
<% if modules_without_group.exists? %>
|
||||
<% modules_without_group.each do |my_module| %>
|
||||
<li>
|
||||
<%= form.check_box "modules[#{my_module.id}]", label: my_module.name %>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<%= form.check_box :step_all, label: t("projects.reports.elements.modals.step_contents_inner.check_all") %>
|
||||
<ul>
|
||||
|
||||
<% if step_undefined or step.checklists.present? %>
|
||||
<% if step_undefined or step.checklists.exists? %>
|
||||
<li>
|
||||
<%= form.check_box :step_checklists, label: t("projects.reports.elements.modals.step_contents_inner.checklists") %>
|
||||
</li>
|
||||
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if step_undefined or step.assets.present? %>
|
||||
<% if step_undefined or step.assets.exists? %>
|
||||
<li>
|
||||
<%= form.check_box :step_assets, label: t("projects.reports.elements.modals.step_contents_inner.assets") %>
|
||||
</li>
|
||||
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if step_undefined or step.tables.present? %>
|
||||
<% if step_undefined or step.tables.exists? %>
|
||||
<li>
|
||||
<%= form.check_box :step_tables, label: t("projects.reports.elements.modals.step_contents_inner.tables") %>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Reference in a new issue