scinote-web/app/views/experiments/_table_toolbar.html.erb

48 lines
2.1 KiB
Text
Raw Normal View History

<div class="toolbar-row" data-width-breakpoint="600">
<span class="left">
<% if can_manage_experiment?(@experiment) %>
<%= link_to modules_new_experiment_path(@experiment, view_mode:'table'),
class: 'btn btn-primary new-my-module-button only-active',
id: 'createTask',
data: { view_mode: 'active' },
remote: true do %>
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-new-task"></span>
<span class="hidden-xs"><%= t('experiments.table.toolbar.new') %></span>
<% end %>
<% end %>
</span>
<%= render partial: 'task_view_dropdowns' %>
<div class="content-header sticky-header">
<div class="header-actions experiment-header">
<% if action_name == 'table' %>
<%= render partial: 'table_filters' %>
2023-06-15 21:12:51 +08:00
<button id="taskDataDisplay" class="btn btn-light icon-btn" data-toggle="modal" data-target="#tableDisplayModal">
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon sn-icon-reports"></i>
</button>
<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">
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon-sort-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>
<% end %>
</div>
</div>
</div>
<%= javascript_include_tag("experiments/show") %>