2016-08-17 19:48:02 +08:00
|
|
|
<div class="modal fade" id="modal-move-module" tabindex="-1" role="dialog" aria-labelledby="modal-move-module-label">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
|
|
<h4 class="modal-title" id="modal-move-module-label"><%=t "experiments.canvas.edit.modal_move_module.title" %></h4>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2021-10-29 21:16:30 +08:00
|
|
|
<% experiments = @experiment.project.experiments.managable_by_user(current_user).order(name: :asc).active %>
|
2016-08-30 14:26:59 +08:00
|
|
|
<% if experiments.count > 1 %>
|
2016-08-23 16:37:48 +08:00
|
|
|
<%= bootstrap_form_tag do |f| %>
|
2016-08-30 14:26:59 +08:00
|
|
|
<%= f.select :experiment_id, experiments
|
2018-02-10 01:02:04 +08:00
|
|
|
.select { |e| e != @experiment && can_manage_experiment?(e) }
|
2016-08-23 16:37:48 +08:00
|
|
|
.collect { |e| [ e.name, e.id ] }, {},
|
|
|
|
{class: "form-control selectpicker", "data-role" => "clear"} %>
|
|
|
|
<% end %>
|
2018-02-10 01:18:41 +08:00
|
|
|
<% else %>
|
|
|
|
<div>
|
|
|
|
<em>
|
|
|
|
<%= t("experiments.canvas.edit.modal_move_module.no_experiments") %>
|
|
|
|
</em>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-08-17 19:48:02 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2020-01-07 23:13:34 +08:00
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><%=t "general.cancel" %></button>
|
2018-04-25 19:57:12 +08:00
|
|
|
<% if experiments.count > 1 %>
|
2020-01-07 23:13:34 +08:00
|
|
|
<button type="button" class="btn btn-primary" data-action="confirm">
|
2018-04-25 19:57:12 +08:00
|
|
|
<%=t "experiments.canvas.edit.modal_move_module.confirm" %>
|
|
|
|
</button>
|
|
|
|
<% end %>
|
2016-08-17 19:48:02 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|