2016-08-12 16:18:35 +08:00
|
|
|
<ul class="dropdown-menu dropdown-experiment-actions"
|
|
|
|
aria-labelledby="exActionsMenu-<%= experiment.id %>"
|
|
|
|
data-id="<%= experiment.id %>">
|
|
|
|
|
2018-01-29 18:36:36 +08:00
|
|
|
<% if can_manage_experiment?(experiment) %>
|
2016-08-12 16:18:35 +08:00
|
|
|
<li><%= link_to t('experiments.edit.label_title'),
|
2020-11-20 21:53:50 +08:00
|
|
|
edit_experiment_url(experiment),
|
2016-08-12 16:18:35 +08:00
|
|
|
remote: true,
|
|
|
|
type: 'button',
|
|
|
|
data: { id: experiment.id },
|
|
|
|
class: 'edit-experiment' %></li>
|
|
|
|
<% end %>
|
2018-06-06 23:28:04 +08:00
|
|
|
<li data-hook="experiment-actions-second-child"></li>
|
2018-02-07 18:49:15 +08:00
|
|
|
<% if can_clone_experiment?(experiment) %>
|
2016-08-12 16:18:35 +08:00
|
|
|
<li><%= link_to t('experiments.clone.label_title'),
|
2018-09-14 19:07:09 +08:00
|
|
|
clone_modal_experiment_url(experiment),
|
|
|
|
remote: true, type: 'button',
|
2020-04-28 18:30:43 +08:00
|
|
|
class: 'clone-experiment' %>
|
|
|
|
</li>
|
2018-02-07 18:49:15 +08:00
|
|
|
<% end %>
|
|
|
|
<% if can_move_experiment?(experiment) %>
|
2016-08-12 17:26:18 +08:00
|
|
|
<li><%= link_to t('experiments.move.label_title'),
|
2018-09-14 19:07:09 +08:00
|
|
|
move_modal_experiment_url(experiment),
|
|
|
|
remote: true, type: 'button',
|
2020-04-28 18:30:43 +08:00
|
|
|
class: 'move-experiment'%>
|
|
|
|
</li>
|
2016-08-12 17:26:18 +08:00
|
|
|
<% end %>
|
2018-12-24 04:17:51 +08:00
|
|
|
<% if can_archive_experiment?(experiment) %>
|
2020-12-17 20:07:30 +08:00
|
|
|
<li><%= link_to t('experiments.archive.label_title'),
|
|
|
|
archive_experiment_url(experiment),
|
|
|
|
type: 'button',
|
2021-02-16 19:55:41 +08:00
|
|
|
method: :post,
|
2020-12-17 20:07:30 +08:00
|
|
|
data: { confirm: t('experiments.canvas.archive_confirm') } %></li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_restore_experiment?(experiment) %>
|
|
|
|
<% experiment_form = nil %>
|
|
|
|
<%= form_for experiment, method: :patch, format: :html do |f| %>
|
|
|
|
<% experiment_form = f %>
|
|
|
|
<%= f.hidden_field :archived, value: false %>
|
|
|
|
<% end %>
|
|
|
|
<li><a href="#" class="form-submit-link" data-turbolinks="false" data-submit-form="<%= experiment_form.options[:html][:id] %>"><%= t "projects.experiment_archive.restore_option" %></a></li>
|
2016-08-12 16:18:35 +08:00
|
|
|
<% end %>
|
|
|
|
</ul>
|