2016-02-12 23:52:43 +08:00
|
|
|
<% content_for :secondary_navigation do %>
|
|
|
|
<nav class="navbar navbar-default navbar-secondary">
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
|
|
|
<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 -->
|
|
|
|
<div class="collapse navbar-collapse" 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? %>
|
|
|
|
<% if can_read_team?(current_team) then %>
|
|
|
|
<li id="canvas-nav-tab" class="<%= "active" if is_all_projects_index? %>">
|
|
|
|
<a href="<%= projects_path %>" title="<%=t "nav2.all_projects.index" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.all_projects.index" %></span>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-folder"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2018-07-19 23:56:42 +08:00
|
|
|
<li id="project-archive-nav-tab" class="<%= "active" if is_all_projects_archive? %>">
|
2018-05-08 22:33:42 +08:00
|
|
|
<a href="<%= projects_archive_path %>" title="<%=t "nav2.all_projects.archive" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.all_projects.archive" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
|
2018-05-08 22:33:42 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% elsif project_page? ||
|
2016-12-12 17:30:03 +08:00
|
|
|
sample_types_page_project? ||
|
|
|
|
sample_groups_page_project? %>
|
2018-01-20 01:25:58 +08:00
|
|
|
<% if can_read_project?(@project) then %>
|
2016-07-29 22:20:35 +08:00
|
|
|
<li id="canvas-nav-tab" class="<%= "active" if is_project_show? %>">
|
|
|
|
<a href="<%= project_url(@project) %>" title="<%=t "nav2.projects.show" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.show" %></span>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-folder"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2018-07-19 23:56:42 +08:00
|
|
|
<li id="project-archive-nav-tab" class="<%= "active" if is_project_archive? %>">
|
2017-06-27 20:48:45 +08:00
|
|
|
<a href="<%= experiment_archive_project_url(@project) %>" title="<%=t "nav2.projects.archive" %>">
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.archive" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
|
2017-06-27 20:48:45 +08:00
|
|
|
</a>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
|
2016-12-14 17:35:48 +08:00
|
|
|
<% elsif experiment_page? ||
|
|
|
|
sample_groups_page_experiment? ||
|
|
|
|
sample_types_page_expermient? %>
|
2018-02-06 01:37:09 +08:00
|
|
|
<% if can_read_experiment?(@experiment) %>
|
2018-01-29 18:36:36 +08:00
|
|
|
<li id="canvas-nav-tab" class="<%= "active" if is_experiment_canvas? %>">
|
|
|
|
<a href="<%= canvas_experiment_url(@experiment) %>" title="<%=t "nav2.experiments.canvas" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.experiments.canvas" %></span>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-folder"></span>
|
2018-01-29 18:36:36 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
2016-07-29 22:20:35 +08:00
|
|
|
<% end %>
|
2018-04-20 17:57:52 +08:00
|
|
|
<% if can_read_project?(@experiment.project) %>
|
2018-07-19 23:56:42 +08:00
|
|
|
<li id="project-archive-nav-tab" class="<%= "active" if is_experiment_archive? %>">
|
2018-05-08 22:33:42 +08:00
|
|
|
<a href="<%= module_archive_experiment_url(@experiment) %>" title="<%=t "nav2.experiments.archive" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.experiments.archive" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
|
2017-06-27 20:48:45 +08:00
|
|
|
</a>
|
2016-08-24 14:54:02 +08:00
|
|
|
</li>
|
2016-08-25 17:19:53 +08:00
|
|
|
<% end %>
|
2016-07-29 22:20:35 +08:00
|
|
|
|
2016-12-12 17:30:03 +08:00
|
|
|
<% elsif module_page? ||
|
|
|
|
sample_types_page_my_module? ||
|
|
|
|
sample_groups_page_my_module? %>
|
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" %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.steps" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-arrow-circle-right"></span>
|
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" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.results" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-columns"></span>
|
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" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.activities" %></span>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-list"></span>
|
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>
|
2017-12-12 18:45:19 +08:00
|
|
|
<% if can_read_team?(@my_module.experiment.project.team) &&
|
2017-05-23 14:53:53 +08:00
|
|
|
@my_module.experiment.project.team.repositories.exists? %>
|
2017-05-18 20:21:00 +08:00
|
|
|
<li id="repositories-nav-tab" class="<%= "active" if module_repository_page? %>">
|
|
|
|
<a href="#" id="repositoriesDropdownMenuLink" title="<%=t "nav2.modules.repositories" %>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.repositories" %></span>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-list-alt"></span>
|
2017-05-18 20:21:00 +08:00
|
|
|
<span class="caret"></span>
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu repositories-dropdown-menu" aria-labelledby="repositoriesDropdownMenuLink">
|
2017-06-19 16:53:18 +08:00
|
|
|
<% @my_module.experiment.project.team.repositories.order(created_at: :asc).each do |repository| %>
|
2017-05-18 20:21:00 +08:00
|
|
|
<li>
|
2018-06-08 14:31:22 +08:00
|
|
|
<a class="dropdown-item <%= "active-item" if module_repository_page? && @repository == repository %>"
|
2017-07-17 21:05:28 +08:00
|
|
|
href="<%= repository_my_module_url(id: @my_module, repository_id: repository) %>"
|
2018-07-19 23:56:42 +08:00
|
|
|
title="<%= repository.name %>">
|
2017-06-09 17:20:57 +08:00
|
|
|
<%= truncate(repository.name) %>
|
2017-05-18 20:21:00 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% unless @my_module.experiment.project.team.repositories.last == repository %>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2018-02-09 23:14:40 +08:00
|
|
|
<% if can_read_experiment?(@my_module.experiment) then %>
|
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' %>">
|
2018-05-08 22:33:42 +08:00
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.archive" %></span>
|
2018-07-09 19:13:44 +08:00
|
|
|
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
|
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 -->
|
2018-05-08 22:33:42 +08:00
|
|
|
<h4 class="nav-name">
|
2018-04-17 23:00:04 +08:00
|
|
|
<%= truncate(title_element.name,
|
2018-05-15 00:33:57 +08:00
|
|
|
length: Constants::MAX_EDGE_LENGTH) %>
|
2018-05-08 22:33:42 +08:00
|
|
|
</h4>
|
2018-04-17 23:00:04 +08:00
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<% end %>
|