2021-03-04 16:00:58 +08:00
|
|
|
<% render_breadcrumbs ||= nil %>
|
|
|
|
<% experiment ||= nil %>
|
|
|
|
<% project ||= nil %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% content_for :secondary_navigation do %>
|
|
|
|
<nav class="navbar navbar-default navbar-secondary">
|
|
|
|
<div class="container-fluid">
|
2021-03-04 16:00:58 +08:00
|
|
|
<% if render_breadcrumbs %>
|
|
|
|
<div id="breadcrumbsWrapper" class="breadcrumbs-in-secondary-navigation">
|
|
|
|
<%= render partial: 'projects/index/breadcrumbs', locals: {target_folder: project.project_folder, project: project, experiment: experiment} %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="navbar-header">
|
2016-07-29 22:06:35 +08:00
|
|
|
<!-- Small devices dropdown button -->
|
2016-02-12 23:52:43 +08:00
|
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#secondary-menu" aria-expanded="false">
|
|
|
|
<span class="sr-only">Toggle navigation</span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- buttons -->
|
2021-03-04 16:00:58 +08:00
|
|
|
<div class="collapse navbar-collapse <%= render_breadcrumbs ? 'with-breadcrumbs' : '' %>" id="secondary-menu">
|
2016-07-29 22:08:30 +08:00
|
|
|
|
|
|
|
<!-- True secondary navigation (buttons on the right side) -->
|
2016-02-12 23:52:43 +08:00
|
|
|
<ul class="nav navbar-nav navbar-right" style="vertical-align: bottom">
|
2018-05-08 22:33:42 +08:00
|
|
|
<% if all_projects_page? %>
|
2018-09-24 22:25:04 +08:00
|
|
|
<% if can_read_team?(current_team) %>
|
2018-10-10 22:11:52 +08:00
|
|
|
<li id="projects-active-nav-tab"
|
|
|
|
class="<%= 'active' if @current_filter == 'active' %> projects-view-filter"
|
|
|
|
data-filter="active">
|
2018-09-24 22:25:04 +08:00
|
|
|
<a href="#" title="<%=t "nav2.all_projects.index" %>">
|
|
|
|
<span><%=t "nav2.all_projects.index" %></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2018-10-10 22:11:52 +08:00
|
|
|
<li id="projects-archive-nav-tab"
|
|
|
|
class="<%= 'active' if @current_filter == 'archived' %> projects-view-filter"
|
|
|
|
data-filter="archived">
|
2018-09-24 22:25:04 +08:00
|
|
|
<a href="#" title="<%=t "nav2.all_projects.archive" %>">
|
|
|
|
<span><%=t "nav2.all_projects.archive" %></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2018-10-10 22:11:52 +08:00
|
|
|
<li id="projects-all-nav-tab"
|
|
|
|
class="<%= 'active' if @current_filter == 'all' %> projects-view-filter"
|
|
|
|
data-filter="all">
|
2018-09-24 22:25:04 +08:00
|
|
|
<a href="#" title="<%=t "nav2.all_projects.all" %>">
|
|
|
|
<span><%=t "nav2.all_projects.all" %></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2018-09-24 22:25:04 +08:00
|
|
|
<li>
|
|
|
|
<ul class="list-unstyled">
|
|
|
|
<li>
|
2019-12-04 21:19:19 +08:00
|
|
|
<div class="projects-view-mode-switch sci-toggles-group" data-toggle="buttons">
|
|
|
|
<input type="radio" name="projects-view-mode-selector" value="cards" class="sci-toggle-item" checked>
|
|
|
|
<a href="#projects-cards-view" data-toggle="tab" data-mode="cards" class="sci-toggle-item-label"><i class="fas fa-th-large"></i></a>
|
2020-11-30 19:16:54 +08:00
|
|
|
<input type="radio" name="projects-view-mode-selector" value="list" class="sci-toggle-item">
|
2019-12-04 21:19:19 +08:00
|
|
|
<a class="sci-toggle-item-label" href="#projects-table-view" data-toggle="tab" data-mode="table"><i class="fas fa-th-list"></i></a>
|
2018-09-24 22:25:04 +08:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2018-05-08 22:33:42 +08:00
|
|
|
<% end %>
|
2019-01-07 20:29:17 +08:00
|
|
|
<% elsif module_page? %>
|
2018-02-06 01:37:09 +08:00
|
|
|
<% if can_read_experiment?(@my_module.experiment) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="steps-nav-tab" class="<%= "active" if is_module_protocols? %>">
|
|
|
|
<a href="<%= protocols_my_module_url(@my_module) %>" title="<%=t "nav2.modules.steps" %>">
|
2022-05-25 16:45:08 +08:00
|
|
|
<%=t "nav2.modules.steps" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="results-nav-tab" class="<%= "active" if is_module_results? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= results_my_module_url(@my_module) %>" title="<%=t "nav2.modules.results" %>">
|
2022-05-25 16:45:08 +08:00
|
|
|
<%=t "nav2.modules.results" %>
|
2022-07-12 15:58:21 +08:00
|
|
|
<% @active_results_size = @my_module.results.where(archived:false).size %>
|
|
|
|
<% if @active_results_size.positive? %>
|
2022-08-09 16:13:43 +08:00
|
|
|
<sup class="navigation-results-counter"><%= @my_module.archived_branch? ? @my_module.results.size : @active_results_size %></sup>
|
2022-04-22 18:24:14 +08:00
|
|
|
<% end %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="activities-nav-tab" class="<%= "active" if is_module_activities? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= activities_my_module_url(@my_module) %>" title="<%=t "nav2.modules.activities" %>">
|
2022-05-25 16:45:08 +08:00
|
|
|
<%=t "nav2.modules.activities" %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2017-02-21 01:03:55 +08:00
|
|
|
|
2017-03-28 20:36:52 +08:00
|
|
|
<li data-hook="secondary-navigation-tabs"></li>
|
2020-12-21 18:56:33 +08:00
|
|
|
<% if can_read_experiment?(@my_module.experiment) && !@my_module.archived_branch? %>
|
2018-07-19 23:56:42 +08:00
|
|
|
<li id="archive-nav-tab" class="<%= "active" if is_module_archive? %>">
|
2018-05-14 18:08:45 +08:00
|
|
|
<a href="<%= archive_my_module_url(@my_module) %>" title="<%= t'nav2.modules.archive' %>">
|
2022-05-25 16:45:08 +08:00
|
|
|
<%=t "nav2.modules.archive" %>
|
2022-07-12 15:58:21 +08:00
|
|
|
<% @archived_results_size = @my_module.results.where(archived:true).size %>
|
|
|
|
<% if @archived_results_size.positive? %>
|
|
|
|
<sup class="navigation-results-counter"><%= @archived_results_size %></sup>
|
|
|
|
<% end %>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2016-07-29 22:08:30 +08:00
|
|
|
|
2018-04-17 23:00:04 +08:00
|
|
|
<!-- Secondary navigation title -->
|
2020-08-27 17:33:26 +08:00
|
|
|
<h1 class="nav-name <%= @inline_editable_title_config.present? ? 'editable' : '' %>" data-hook="secondary-navigation-title-name">
|
2019-05-20 19:13:31 +08:00
|
|
|
<% if @inline_editable_title_config.present? %>
|
|
|
|
<%= render partial: "shared/inline_editing",
|
2020-05-15 04:10:13 +08:00
|
|
|
locals: {
|
2019-11-12 18:26:18 +08:00
|
|
|
initial_value: title_element.name,
|
|
|
|
config: @inline_editable_title_config
|
|
|
|
} %>
|
2019-03-06 16:17:34 +08:00
|
|
|
<% else %>
|
2020-12-21 18:56:33 +08:00
|
|
|
<% if title_element.archived_branch? %>
|
2020-12-11 00:47:10 +08:00
|
|
|
<i class="fas fa-archive"></i>
|
|
|
|
<% end %>
|
2019-08-21 16:39:37 +08:00
|
|
|
<%= title_element.name %>
|
2019-03-06 16:17:34 +08:00
|
|
|
<% end %>
|
2020-07-08 19:02:47 +08:00
|
|
|
</h1>
|
2018-04-17 23:00:04 +08:00
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
2019-01-03 21:11:00 +08:00
|
|
|
|
|
|
|
<%= javascript_include_tag('secondary_navigation') %>
|
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|