Add placeholders for empty experiments

This commit is contained in:
Jure Grabnar 2016-08-23 10:37:48 +02:00
parent 027193f937
commit 0d56cea3e4
3 changed files with 29 additions and 11 deletions

View file

@ -6,12 +6,20 @@
<h4 class="modal-title" id="modal-move-module-label"><%=t "experiments.canvas.edit.modal_move_module.title" %></h4>
</div>
<div class="modal-body">
<%= bootstrap_form_tag do |f| %>
<%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
<% end %>
<% if @experiment.project.experiments.is_archived(false).count > 1 %>
<%= bootstrap_form_tag do |f| %>
<%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
<% end %>
<% else %>
<div>
<em>
<%= t("experiments.canvas.edit.modal_move_module.no_experiments") %>
</em>
</div>
<% end %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>

View file

@ -6,11 +6,19 @@
<h4 class="modal-title" id="modal-move-module-group-label"><%=t "experiments.canvas.edit.modal_move_module_group.title" %></h4>
</div>
<div class="modal-body">
<%= bootstrap_form_tag do |f| %>
<%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
<% if @experiment.project.experiments.is_archived(false).count > 1 %>
<%= bootstrap_form_tag do |f| %>
<%= f.select :experiment_id, @experiment.project.experiments.is_archived(false)
.select { |e| e != @experiment }
.collect { |e| [ e.name, e.id ] }, {},
{class: "form-control selectpicker", "data-role" => "clear"} %>
<% end %>
<% else %>
<div>
<em>
<%= t("experiments.canvas.edit.modal_move_module.no_experiments") %>
</em>
</div>
<% end %>
</div>
<div class="modal-footer">

View file

@ -680,9 +680,11 @@ en:
modal_move_module:
title: "Move task to experiment"
confirm: "Move task"
no_experiments: "There are no other experiments."
modal_move_module_group:
title: "Move workflow to experiment"
confirm: "Move workflow"
no_experiments: "There are no other experiments."
modal_delete_module:
title: "Archive task"
confirm: "Archive task"