2021-02-11 19:36:39 +08:00
|
|
|
<div class="modal move-experiment-modal"
|
2024-01-31 20:52:56 +08:00
|
|
|
id="move-experiment-modal-<%= params[:ids] %>"
|
2016-08-12 17:26:18 +08:00
|
|
|
tabindex="-1"
|
|
|
|
role="dialog"
|
|
|
|
aria-labelledby="move-experiment-modal-label">
|
2023-07-03 17:11:51 +08:00
|
|
|
<%= form_with model: @experiment,
|
2024-01-31 20:52:56 +08:00
|
|
|
url: move_experiments_path(ids: params[:ids]),
|
2023-08-18 16:55:21 +08:00
|
|
|
method: :post,
|
|
|
|
data: { 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">
|
2023-08-17 19:55:17 +08:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="sn-icon sn-icon-close"></i></button>
|
2023-12-29 16:53:46 +08:00
|
|
|
<h4 class="modal-title" id="move-experiment-modal-label"><%= t("experiments.move.modal_title") %></h5>
|
2016-08-12 17:26:18 +08:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2021-11-15 19:50:50 +08:00
|
|
|
<p><small><%= t("experiments.move.notice") %></small></p>
|
2024-01-31 20:52:56 +08:00
|
|
|
<% if @projects.any? && @experiments.all? { |experiment| can_move_experiment?(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") %>
|
2024-01-31 20:52:56 +08:00
|
|
|
<% elsif !@experiments.all? { |experiment| can_move_experiment?(experiment) } %>
|
2021-10-27 19:48:52 +08:00
|
|
|
<%= 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>
|
2024-01-31 20:52:56 +08:00
|
|
|
<% params[:ids].each do |id| %>
|
|
|
|
<%= f.hidden_field :ids, multiple: true, value: id %>
|
2023-12-29 16:53:46 +08:00
|
|
|
<% end %>
|
2016-08-12 17:26:18 +08:00
|
|
|
<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>
|
2023-12-29 16:53:46 +08:00
|
|
|
<% if @projects.any? && @experiments.all? { |experiment| 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>
|