2022-11-25 22:29:15 +08:00
|
|
|
<% archived = params[:view_mode] == 'archived' || action_name == 'module_archive' %>
|
2022-10-18 20:54:29 +08:00
|
|
|
<ul class="dropdown-menu dropdown-menu-right dropdown-experiment-actions"
|
2016-08-12 16:18:35 +08:00
|
|
|
aria-labelledby="exActionsMenu-<%= experiment.id %>"
|
|
|
|
data-id="<%= experiment.id %>">
|
|
|
|
|
2022-12-07 21:51:48 +08:00
|
|
|
<div class="divider-label">
|
|
|
|
<%= t('experiments.experiment_actions') %>
|
|
|
|
</div>
|
|
|
|
|
2022-11-25 22:29:15 +08:00
|
|
|
<% if can_manage_experiment?(experiment) && !archived %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to edit_experiment_url(experiment),
|
|
|
|
remote: true,
|
|
|
|
type: 'button',
|
|
|
|
data: { id: experiment.id },
|
|
|
|
class: 'edit-experiment' do %>
|
2023-06-15 21:12:51 +08:00
|
|
|
<i class="sn-icon sn-icon-edit"></i>
|
2022-05-25 16:22:50 +08:00
|
|
|
<span><%= t('experiments.edit.label_title') %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
2022-05-25 16:22:50 +08:00
|
|
|
</li>
|
2016-08-12 16:18:35 +08:00
|
|
|
<% end %>
|
2022-12-07 21:51:48 +08:00
|
|
|
|
2022-11-25 22:29:15 +08:00
|
|
|
<% if can_clone_experiment?(experiment) && !archived %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<li>
|
2023-01-12 19:08:37 +08:00
|
|
|
<%= link_to clone_modal_experiment_url(experiment),
|
2022-05-25 16:22:50 +08:00
|
|
|
remote: true, type: 'button',
|
|
|
|
class: 'clone-experiment' do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-duplicate"></i>
|
2022-05-25 16:22:50 +08:00
|
|
|
<span><%= t('experiments.clone.label_title') %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
2020-04-28 18:30:43 +08:00
|
|
|
</li>
|
2018-02-07 18:49:15 +08:00
|
|
|
<% end %>
|
2022-11-25 22:29:15 +08:00
|
|
|
<% if can_move_experiment?(experiment) && !archived %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<li>
|
2024-02-06 18:17:39 +08:00
|
|
|
<%= link_to move_modal_experiments_path(ids: experiment.id),
|
2022-05-25 16:22:50 +08:00
|
|
|
remote: true, type: 'button',
|
|
|
|
class: 'move-experiment' do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-move"></i>
|
2022-05-25 16:22:50 +08:00
|
|
|
<span><%= t('experiments.move.label_title') %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
2020-04-28 18:30:43 +08:00
|
|
|
</li>
|
2016-08-12 17:26:18 +08:00
|
|
|
<% end %>
|
2021-11-09 16:26:22 +08:00
|
|
|
<!-- Set or view user experiment assignments -->
|
|
|
|
<% if can_manage_experiment_users?(experiment) %>
|
|
|
|
<li>
|
2023-02-23 21:57:38 +08:00
|
|
|
<%= link_to edit_access_permissions_experiment_path(experiment), data: { action: 'remote-modal'} do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-project-member-access"></i>
|
2021-11-09 16:26:22 +08:00
|
|
|
<span><%= t('experiments.index.experiment_access') %></span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li>
|
2023-02-23 21:57:38 +08:00
|
|
|
<%= link_to access_permissions_experiment_path(experiment), data: { action: 'remote-modal'} do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-project-member-access"></i>
|
2021-11-09 16:26:22 +08:00
|
|
|
<span><%= t('experiments.index.experiment_access') %></span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2022-11-25 22:29:15 +08:00
|
|
|
<% if can_archive_experiment?(experiment) && !archived %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to archive_experiment_url(experiment),
|
2020-12-17 20:07:30 +08:00
|
|
|
type: 'button',
|
2021-02-16 19:55:41 +08:00
|
|
|
method: :post,
|
2022-05-25 16:22:50 +08:00
|
|
|
data: { confirm: t('experiments.canvas.archive_confirm') } do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-archive"></i>
|
2022-05-25 16:22:50 +08:00
|
|
|
<span><%= t('experiments.archive.label_title') %></span>
|
2022-10-18 20:54:29 +08:00
|
|
|
<% end %>
|
2022-05-25 16:22:50 +08:00
|
|
|
</li>
|
2020-12-17 20:07:30 +08:00
|
|
|
<% 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 %>
|
2022-05-25 16:22:50 +08:00
|
|
|
<li><a href="#" class="form-submit-link" data-turbolinks="false" data-submit-form="<%= experiment_form.options[:html][:id] %>">
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-restore"></i><%= t "projects.experiment_archive.restore_option" %></a></li>
|
2016-08-12 16:18:35 +08:00
|
|
|
<% end %>
|
2022-12-07 21:51:48 +08:00
|
|
|
|
|
|
|
<div class="divider-label footer">
|
|
|
|
<%= t('experiments.experiment_id') %>: <strong><%= experiment.code %></strong>
|
|
|
|
</div>
|
2016-08-12 16:18:35 +08:00
|
|
|
</ul>
|