Add check for empty projects on move experiments

This commit is contained in:
Jure Grabnar 2016-08-16 10:20:36 +02:00
parent c16eed5e63
commit 275106c27c
2 changed files with 11 additions and 2 deletions

View file

@ -13,8 +13,16 @@
<h4 class="modal-title" id="move-experiment-modal-label"><%= t("experiments.move.modal_title", experiment: @experiment.name ) %></h5>
</div>
<div class="modal-body">
<%= f.select :project_id, options_for_select(@projects.collect { |p| [ p.name, p.id ] }),
{}, {class: "form-control selectpicker", "data-role" => "clear"} %>
<% if !@projects.blank? %>
<%= f.select :project_id, options_for_select(@projects.collect { |p| [ p.name, p.id ] }),
{}, {class: "form-control selectpicker", "data-role" => "clear"} %>
<% else %>
<div>
<em>
<%= t("experiments.move.no_projects") %>
</em>
</div>
<% end %>
</div>
<div class="modal-footer">
<%= f.submit t("experiments.move.modal_submit"), class: "btn btn-primary" %>

View file

@ -627,6 +627,7 @@ en:
modal_submit: 'Move'
success_flash: "Successfully moved experiment %{experiment}"
error_flash: 'Could not move the experiment.'
no_projects: 'No projects to move this experiment to.'
canvas:
archive_confirm: "Are you sure to archive this experiment?"
actions: 'Actions'