2021-02-11 19:36:39 +08:00
|
|
|
<div class="modal move-experiment-modal"
|
2016-08-12 17:26:18 +08:00
|
|
|
id="move-experiment-modal-<%= @experiment.id %>"
|
|
|
|
tabindex="-1"
|
|
|
|
role="dialog"
|
|
|
|
aria-labelledby="move-experiment-modal-label">
|
2021-02-11 19:36:39 +08:00
|
|
|
<%= bootstrap_form_for @experiment,
|
|
|
|
url: move_experiment_path(@experiment),
|
2016-09-02 22:31:17 +08:00
|
|
|
method: :post,
|
2021-02-11 19:36:39 +08:00
|
|
|
remote: true,
|
|
|
|
html: { class: 'experiment-action-form' } do |f| %>
|
2016-08-12 17:26:18 +08:00
|
|
|
<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="move-experiment-modal-label"><%= t("experiments.move.modal_title", experiment: @experiment.name ) %></h5>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2021-11-15 19:50:50 +08:00
|
|
|
<p><small><%= t("experiments.move.notice") %></small></p>
|
2021-10-27 19:48:52 +08:00
|
|
|
<% if @projects.any? && can_manage_all_experiment_my_modules?(@experiment) %>
|
2016-08-16 16:20:36 +08:00
|
|
|
<%= f.select :project_id, options_for_select(@projects.collect { |p| [ p.name, p.id ] }),
|
2021-11-15 19:50:50 +08:00
|
|
|
{ label: t("experiments.move.target_project") }, { class: "form-control selectpicker", "data-role" => "clear" } %>
|
2016-08-16 16:20:36 +08:00
|
|
|
<% else %>
|
2021-10-27 19:48:52 +08:00
|
|
|
<div class="warning-message">
|
|
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
|
|
<% if @projects.blank? %>
|
2016-08-16 16:20:36 +08:00
|
|
|
<%= t("experiments.move.no_projects") %>
|
2021-10-27 19:48:52 +08:00
|
|
|
<% elsif !can_manage_all_experiment_my_modules?(@experiment) %>
|
|
|
|
<%= t("experiments.move.task_permission") %>
|
|
|
|
<% end %>
|
2016-08-16 16:20:36 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-08-12 17:26:18 +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>
|
2021-10-27 19:48:52 +08:00
|
|
|
<% if @projects.any? && can_manage_all_experiment_my_modules?(@experiment) %>
|
2020-01-07 23:13:34 +08:00
|
|
|
<%= f.submit t("experiments.move.modal_submit"), class: "btn btn-primary" %>
|
2016-08-24 17:09:03 +08:00
|
|
|
<% end %>
|
2016-08-12 17:26:18 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|