2022-09-02 23:49:55 +08:00
|
|
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="experimentActionsDropdown">
|
2023-04-26 21:51:22 +08:00
|
|
|
<% if experiment.archived? && can_restore_experiment?(experiment) %>
|
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(experiment_path(experiment, format: :json),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
2023-06-15 21:12:51 +08:00
|
|
|
class: 'btn btn-light justify-start',
|
2023-04-26 21:51:22 +08:00
|
|
|
form_class: 'experiment-action-form',
|
|
|
|
params: { experiment: { archived: false } }) do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-restore"></i>
|
2023-04-26 21:51:22 +08:00
|
|
|
<span><%= t('experiments.index.restore_option') %></span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2022-09-02 23:49:55 +08:00
|
|
|
<!-- Edit experiment -->
|
|
|
|
<% if experiment.active? && can_manage_experiment?(experiment) %>
|
|
|
|
<li>
|
|
|
|
<%= link_to edit_experiment_url(experiment),
|
|
|
|
remote: true,
|
|
|
|
class: 'edit-experiment experiment-action-link' do %>
|
2023-06-15 21:12:51 +08:00
|
|
|
<i class="sn-icon sn-icon-edit"></i>
|
2022-09-02 23:49:55 +08:00
|
|
|
<span><%= t('experiments.index.edit_option') %></span>
|
2021-01-28 04:53:39 +08:00
|
|
|
<% end %>
|
2022-09-02 23:49:55 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2023-04-26 21:51:22 +08:00
|
|
|
<!-- Set or view user experiment assignments -->
|
|
|
|
<% if can_manage_experiment_users?(experiment) %>
|
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= 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>
|
2023-04-26 21:51:22 +08:00
|
|
|
<span><%= t('experiments.index.experiment_access') %></span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= 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>
|
2023-04-26 21:51:22 +08:00
|
|
|
<span><%= t('experiments.index.experiment_access') %></span>
|
2021-01-28 04:53:39 +08:00
|
|
|
<% end %>
|
2022-09-02 23:49:55 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<!-- Move experiment -->
|
|
|
|
<% if can_move_experiment?(experiment) %>
|
|
|
|
<li>
|
2024-02-06 18:17:39 +08:00
|
|
|
<%= link_to move_modal_experiments_path(ids: [experiment.id]),
|
2022-09-02 23:49:55 +08:00
|
|
|
remote: true,
|
|
|
|
class: 'move-experiment experiment-action-link' do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-move"></i>
|
2022-09-02 23:49:55 +08:00
|
|
|
<span><%= t('experiments.index.move_option') %></span>
|
2021-01-28 04:53:39 +08:00
|
|
|
<% end %>
|
2022-09-02 23:49:55 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
2023-04-26 21:51:22 +08:00
|
|
|
<!-- Duplicate experiment -->
|
|
|
|
<% if can_clone_experiment?(experiment) %>
|
|
|
|
<li>
|
|
|
|
<%= link_to clone_modal_experiment_url(experiment),
|
|
|
|
remote: true, type: 'button',
|
|
|
|
class: 'clone-experiment experiment-action-link' do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-duplicate"></i>
|
2023-04-26 21:51:22 +08:00
|
|
|
<span><%= t('experiments.index.clone_option') %></span>
|
2021-01-28 04:53:39 +08:00
|
|
|
<% end %>
|
2022-09-02 23:49:55 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<!-- Archive/restore experiment -->
|
|
|
|
<% if experiment.active? && can_archive_experiment?(experiment) %>
|
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(archive_experiment_path(experiment),
|
|
|
|
method: :post,
|
|
|
|
remote: true,
|
2023-06-15 21:12:51 +08:00
|
|
|
class: 'btn btn-light justify-start',
|
2022-09-02 23:49:55 +08:00
|
|
|
form_class: 'experiment-action-form',
|
|
|
|
data: { confirm: t('experiments.index.archive_confirm') } ) do %>
|
2023-06-08 14:33:37 +08:00
|
|
|
<i class="sn-icon sn-icon-archive"></i>
|
2022-09-02 23:49:55 +08:00
|
|
|
<span><%= t('experiments.index.archive_option') %></span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|