scinote-web/app/views/projects/show/_header.html.erb
2021-02-10 23:33:16 +01:00

73 lines
3.7 KiB
Text

<div class="content-header sticky-header">
<div id="breadcrumbsWrapper">
<%= render partial: 'projects/index/breadcrumbs', locals: { target_folder: @project.project_folder } %>
</div>
<div class="title-row">
<h1 class="project-name">
<i class="fas fa-archive" data-view-mode="archived"></i>
<% if @inline_editable_title_config.present? %>
<%= render partial: "shared/inline_editing",
locals: {
initial_value: @project.name,
config: @inline_editable_title_config
} %>
<% else %>
<%= @project.name %>
<% end %>
</h1>
<div class="sci-btn-group header-actions">
<!-- View switch dropdown -->
<%= render layout: 'shared/view_switch', locals: { disabled: false } do %>
<li class="view-switch-cards cards-switch active">
<i class="fas fa-th-large button-icon"></i> <%= t('experiments.header.cards') %>
</li>
<li class="view-switch-list cards-switch ">
<i class="fas fa-list button-icon"></i> <%= t('experiments.header.table') %>
</li>
<div role="separator" class="divider"></div>
<li class="view-switch-active archive-switch" data-view-mode="archived" data-url="<%= project_path(@project) %>">
<i class="fas fa-rocket button-icon"></i> <%= t('experiments.header.active_experiments') %>
</li>
<li class="view-switch-archived archive-switch" data-view-mode="active" data-url="<%= project_path(@project, view_mode: 'archived') %>">
<i class="fas fa-archive button-icon"></i> <%= t('experiments.header.archived_experiments') %>
</li>
<% end %>
<%= render layout: 'shared/filter_dropdown', locals: {
container_class: 'experiments-filters',
dropdown_title: t("filters_modal.title"),
search_field_history_key: 'experiment_filters_per_team'
} do %>
<%= render partial: 'shared/filter_dropdown/text_search', locals: {container_class: ''} %>
<%= render partial: 'shared/filter_dropdown/datetime_search', locals: {container_class: 'started-on-filter', label: t("filters_modal.created_on.label"), view_mode: nil } %>
<%= render partial: 'shared/filter_dropdown/datetime_search', locals: {container_class: 'modified-on-filter', label: t("filters_modal.updated_on.label"), view_mode: nil } %>
<%= render partial: 'shared/filter_dropdown/datetime_search', locals: {container_class: 'archived-on-filter', label: t("filters_modal.archived_on.label"), view_mode: 'archived' } %>
<% end %>
<!-- Sort menu dropdown -->
<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-experiments-menu dropdown-menu-right" aria-labelledby="sortMenu">
<% %w(new old atoz ztoa archived_new archived_old).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>
</div>
</div>
<div id="toolbarWrapper" class="toolbar-row">
<%= render partial: 'projects/show/toolbar' %>
</div>
</div>