2022-10-18 20:54:29 +08:00
|
|
|
<div class="content-header sticky-header">
|
|
|
|
<div class="title-row">
|
2023-04-26 16:24:50 +08:00
|
|
|
<i class="fas fa-bars sci--layout--navigator-open p-2 cursor-pointer"></i>
|
2022-12-23 17:35:17 +08:00
|
|
|
<h1 class="experimnet-name" data-toggle="tooltip" data-placement="bottom" title="<%= @experiment.name %>">
|
2022-10-18 20:54:29 +08:00
|
|
|
<% if @experiment.archived? %>
|
|
|
|
<i class="fas fa-archive" data-view-mode="archived"></i>
|
|
|
|
<% end %>
|
|
|
|
<% if @inline_editable_title_config.present? %>
|
|
|
|
<%= render partial: "shared/inline_editing",
|
|
|
|
locals: {
|
|
|
|
initial_value: @experiment.name,
|
|
|
|
config: @inline_editable_title_config
|
|
|
|
} %>
|
|
|
|
<% else %>
|
|
|
|
<div class="name-readonly-placeholder">
|
|
|
|
<%= @experiment.name %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</h1>
|
2022-10-27 15:53:01 +08:00
|
|
|
<div class="header-actions experiment-header">
|
2023-01-13 20:54:53 +08:00
|
|
|
<% if can_manage_experiment?(@experiment) || can_clone_experiment?(@experiment) %>
|
|
|
|
<!-- experiment actions -->
|
|
|
|
<span class="dropdown actions-button">
|
|
|
|
<button class="btn btn-light dropdown-toggle" type="button" id="exActionsMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
|
|
<span class="hidden-xs"><%= t('experiments.canvas.actions') %></span>
|
|
|
|
<span class="visible-xs-inline"><i class="fas fa-sort"></i></span>
|
|
|
|
<span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
<%= render partial: 'experiments/dropdown_actions.html.erb',
|
|
|
|
locals: { project: @project, experiment: @experiment, action_name: action_name } %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2023-04-20 19:40:38 +08:00
|
|
|
<%= render layout: 'shared/view_switch', locals: { disabled: false, name: t("toolbar.#{action_name == 'module_archive' ? 'cards' : action_name }_view") } do %>
|
2022-12-06 07:23:22 +08:00
|
|
|
<% if params[:view_mode] == 'archived' || params[:action] == "module_archive" %>
|
2023-01-10 18:08:49 +08:00
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(view_type_experiment_path(@experiment, view_mode: 'archived'),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
2023-04-20 19:40:38 +08:00
|
|
|
class: "btn button-to #{ action_name == 'table' ? 'btn-primary' : 'btn-light' }",
|
2023-01-10 18:08:49 +08:00
|
|
|
form_class: 'change-my-modules-view-type-form',
|
2023-04-20 19:40:38 +08:00
|
|
|
params: { experiment: { view_type: 'table', id: @experiment.id } }) do %>
|
|
|
|
<span class="<%= 'text-light' if action_name == 'table' %>">
|
|
|
|
<%= t('toolbar.table_view') %>
|
|
|
|
</span>
|
2022-12-06 07:23:22 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
2023-01-10 18:08:49 +08:00
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(view_type_experiment_path(@experiment, view_mode: 'archived'),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
2023-04-20 19:40:38 +08:00
|
|
|
class: "btn button-to #{ action_name == 'module_archive' ? 'btn-primary' : 'btn-light'}",
|
2023-01-10 18:08:49 +08:00
|
|
|
form_class: 'change-my-modules-view-type-form',
|
2023-04-20 19:40:38 +08:00
|
|
|
params: { experiment: { view_type: 'canvas', id: @experiment.id } }) do %>
|
|
|
|
<span class="<%= 'text-light' if action_name == 'module_archive' %>">
|
|
|
|
<%= t('toolbar.cards_view') %>
|
|
|
|
</span>
|
2022-12-06 07:23:22 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
2023-01-10 18:08:49 +08:00
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(view_type_experiment_path(@experiment),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
2023-04-20 19:40:38 +08:00
|
|
|
class: "btn button-to #{ action_name == 'table' ? 'btn-primary text-light' : 'btn-light' }",
|
2023-01-10 18:08:49 +08:00
|
|
|
form_class: 'change-my-modules-view-type-form',
|
|
|
|
params: { experiment: { view_type: 'table', id: @experiment.id } }) do %>
|
2023-04-20 19:40:38 +08:00
|
|
|
<span class="<%= 'text-light' if action_name == 'table' %>">
|
|
|
|
<%= t('toolbar.table_view') %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<li class="form-dropdown-item">
|
|
|
|
<%= button_to(view_type_experiment_path(@experiment),
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
|
|
|
class: "btn button-to #{ action_name == 'canvas' ? 'btn-primary text-light' : 'btn-light'}",
|
|
|
|
form_class: 'change-my-modules-view-type-form',
|
|
|
|
params: { experiment: { view_type: 'canvas', id: @experiment.id } }) do %>
|
|
|
|
<span class="<%= 'text-light' if action_name == 'canvas' %>">
|
|
|
|
<%= t('toolbar.canvas_view') %>
|
|
|
|
</span>
|
2022-12-06 07:23:22 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
2022-11-08 23:39:52 +08:00
|
|
|
<% end %>
|
2023-04-20 19:40:38 +08:00
|
|
|
<% end %>
|
2022-12-06 07:23:22 +08:00
|
|
|
|
2023-04-20 19:40:38 +08:00
|
|
|
<%= render layout: 'shared/state_view_switch', locals: { disabled: false } do %>
|
|
|
|
<% unless @experiment.archived_branch? %>
|
|
|
|
<li>
|
|
|
|
<%= link_to my_modules_experiment_path(@experiment), class: "#{'form-dropdown-state-item' unless (action_name == 'module_archive' || params[:view_mode] == 'archived')}" do %>
|
|
|
|
<%= t('toolbar.active_state') %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
2022-12-06 07:23:22 +08:00
|
|
|
<li>
|
2023-04-20 19:40:38 +08:00
|
|
|
<%= link_to my_modules_experiment_path(@experiment, view_mode: :archived), class: "#{'form-dropdown-state-item' if (action_name == 'module_archive' || params[:view_mode] == 'archived')}" do %>
|
|
|
|
<%= t('toolbar.archived_state') %>
|
2022-12-06 07:23:22 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
2022-11-08 23:39:52 +08:00
|
|
|
<% end %>
|
2023-04-20 19:40:38 +08:00
|
|
|
<% end %>
|
|
|
|
|
2022-11-09 20:54:19 +08:00
|
|
|
<% if action_name == 'table' %>
|
|
|
|
<%= render partial: 'table_filters.html.erb' %>
|
2022-12-05 17:30:20 +08:00
|
|
|
|
|
|
|
<div class="dropdown sort-menu">
|
|
|
|
<button class="btn btn-light icon-btn dropdown-toggle" type="button" id="sortMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
|
|
<i class="fas fa-sort-amount-up"></i>
|
|
|
|
</button>
|
|
|
|
<ul id="sortMenuDropdown" class="dropdown-menu sort-task-menu <%= params[:view_mode] %> dropdown-menu-right" aria-labelledby="sortMenu">
|
|
|
|
<% %w(atoz ztoa due_first due_last archived_old archived_new).each_with_index do |sort, i| %>
|
|
|
|
<% if i.even? && i.positive? %>
|
|
|
|
<li class="divider" <%= i > 3 ? 'data-view-mode=archived' : '' %>></li>
|
|
|
|
<% end %>
|
|
|
|
<li <%= %w(archived_new archived_old).include?(sort) ? 'data-view-mode=archived' : '' %>>
|
|
|
|
<a class="<%= 'selected' if @current_sort == sort %>"
|
|
|
|
data-sort="<%= sort %>" >
|
|
|
|
<%= t("general.sort.#{sort}_html") %>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2022-11-09 20:54:19 +08:00
|
|
|
<% end %>
|
2022-10-18 20:54:29 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|