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>
|
2016-07-29 21:47:41 +08:00
|
|
|
|
|
|
|
<!-- Breadcrumbs, displayed on small screens -->
|
2016-02-12 23:52:43 +08:00
|
|
|
<ul class="breadcrumb hidden-sm hidden-md hidden-lg">
|
2016-07-29 21:47:41 +08:00
|
|
|
<li>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% if can_view_projects(@project.team) %>
|
|
|
|
<a href="<%= projects_path :team => @project.team.id %>">
|
2016-07-29 21:47:41 +08:00
|
|
|
<% end %>
|
|
|
|
<span class="glyphicon glyphicon-folder-open"></span>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% if can_view_projects(@project.team) %>
|
2016-07-29 21:47:41 +08:00
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
2016-12-12 17:30:03 +08:00
|
|
|
<% if project_page? ||
|
|
|
|
sample_types_page_project? ||
|
|
|
|
sample_groups_page_project? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li class="active">
|
2016-07-29 21:47:41 +08:00
|
|
|
<span class="glyphicon glyphicon-blackboard"></span>
|
|
|
|
</li>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<li>
|
|
|
|
<% if can_view_project(@project) %>
|
2016-07-27 22:28:18 +08:00
|
|
|
<a href="<%= project_url(@project) %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<span class="glyphicon glyphicon-blackboard"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% if can_view_project(@project) %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% end %>
|
2016-12-12 17:30:03 +08:00
|
|
|
<% if experiment_page? ||
|
|
|
|
module_page? %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% if !module_page? %>
|
|
|
|
<li class="active">
|
2016-08-17 20:17:29 +08:00
|
|
|
<%= fa_icon 'fa-flask' %>
|
2016-07-29 21:47:41 +08:00
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li>
|
|
|
|
<% if can_view_experiment(@experiment) %>
|
|
|
|
<%= link_to canvas_experiment_path(@experiment) do %>
|
2016-08-17 20:17:29 +08:00
|
|
|
<%= fa_icon 'fa-flask' %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% end %>
|
|
|
|
<% else %>
|
2016-08-17 20:17:29 +08:00
|
|
|
<%= fa_icon 'fa-flask' %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% if module_page? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li class="active">
|
2016-07-29 21:47:41 +08:00
|
|
|
<span class="glyphicon glyphicon-credit-card"></span>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</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">
|
2016-12-12 17:30:03 +08:00
|
|
|
<% if project_page? ||
|
|
|
|
sample_types_page_project? ||
|
|
|
|
sample_groups_page_project? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% if can_view_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>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_project_samples(@project) then %>
|
2016-12-12 17:30:03 +08:00
|
|
|
<li id="project-samples-nav-tab" class="<%= "active" if is_project_samples? ||
|
|
|
|
sample_types_page_project? ||
|
|
|
|
sample_groups_page_project? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= samples_project_url(@project) %>" title="<%=t "nav2.projects.samples" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.samples" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-tint"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_reports(@project) then %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="reports-nav-tab" class="<%= "active" if is_project_reports? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= project_reports_url(@project) %>" title="<%=t "nav2.projects.reports" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.reports" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-list-alt"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_project_archive(@project) then %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="project-archive-nav-tab" class="<%= "active" if is_project_archive? %>">
|
2016-07-28 17:05:28 +08:00
|
|
|
<a href="<%= experiment_archive_project_url(@project) %>"><span class="glyphicon glyphicon-briefcase"></span></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? %>
|
2016-08-25 17:19:53 +08:00
|
|
|
<% if can_view_experiment(@experiment) then %>
|
|
|
|
<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>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-blackboard"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-08-24 14:54:02 +08:00
|
|
|
<% if can_view_experiment_samples(@experiment) then %>
|
2016-12-14 17:35:48 +08:00
|
|
|
<li id="experiment-samples-nav-tab" class="<%= "active" if is_experiment_samples? ||
|
|
|
|
sample_groups_page_experiment? ||
|
|
|
|
sample_types_page_expermient? %>">
|
2016-08-24 14:54:02 +08:00
|
|
|
<a href="<%= samples_experiment_url(@experiment) %>" title="<%=t "nav2.projects.samples" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.samples" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-tint"></span>
|
2016-07-29 22:20:35 +08:00
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-08-25 17:19:53 +08:00
|
|
|
<% if can_view_reports(@experiment.project) then %>
|
2016-08-24 14:54:02 +08:00
|
|
|
<li id="reports-nav-tab" class="<%= "active" if is_project_reports? %>">
|
|
|
|
<a href="<%= project_reports_url(@experiment.project) %>" title="<%=t "nav2.projects.reports" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.reports" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-list-alt"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2016-08-25 17:19:53 +08:00
|
|
|
<% end %>
|
|
|
|
<% if can_view_experiment_archive(@experiment) then %>
|
2016-08-24 14:54:02 +08:00
|
|
|
<li id="project-archive-nav-tab" class="<%= "active" if is_experiment_archive? %>">
|
|
|
|
<a href="<%= module_archive_experiment_url(@experiment) %>"><span class="glyphicon glyphicon-briefcase"></span></a>
|
|
|
|
</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? %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% if can_view_module_protocols(@my_module) then %>
|
|
|
|
<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>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-circle-arrow-right"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_results_in_module(@my_module) then %>
|
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>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-th"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_module_activities(@my_module) then %>
|
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>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-equalizer"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_module_samples(@my_module) then %>
|
2016-12-12 17:30:03 +08:00
|
|
|
<li id="module-samples-nav-tab" class="<%= "active" if is_module_samples? ||
|
|
|
|
sample_types_page_my_module? ||
|
|
|
|
sample_groups_page_my_module? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= samples_my_module_url(@my_module) %>" title="<%=t "nav2.modules.samples" %>">
|
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.modules.samples" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-tint"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% if can_view_reports(@my_module.experiment.project) then %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="reports-nav-tab" >
|
2016-07-29 21:47:41 +08:00
|
|
|
<a href="<%= project_reports_url(@my_module.experiment.project) %>" title="<%=t "nav2.projects.reports" %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<span class="hidden-sm hidden-md"><%=t "nav2.projects.reports" %></span>
|
|
|
|
<span class="hidden-xs hidden-lg glyphicon glyphicon-list-alt"></span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% if can_view_module_archive(@my_module) then %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<li id="archive-nav-tab" class="<%= "active" if is_module_archive? %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<a href="<%= archive_my_module_url(@my_module) %>">
|
|
|
|
<span class="glyphicon glyphicon-briefcase" title="<%= t'nav2.modules.archive' %>"></span></a>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2016-07-29 22:08:30 +08:00
|
|
|
|
2016-07-29 21:47:41 +08:00
|
|
|
<!-- Breadcrumbs, displayed on large screens -->
|
2016-02-12 23:52:43 +08:00
|
|
|
<ul class="breadcrumb hidden-xs">
|
|
|
|
<li>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% if can_view_projects(@project.team) %>
|
|
|
|
<a href="<%= projects_path :team => @project.team.id %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%= truncate(@project.team.name,
|
2016-10-05 23:45:20 +08:00
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% if can_view_projects(@project.team) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
2016-07-29 22:06:35 +08:00
|
|
|
<% if project_page? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<li class="active">
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= truncate(@project.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2016-07-29 21:47:41 +08:00
|
|
|
</li>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% else %>
|
|
|
|
<li>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% if can_view_project(@project) %>
|
2016-07-27 22:28:18 +08:00
|
|
|
<a href="<%= project_url(@project) %>">
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= truncate(@project.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% if can_view_project(@project) %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% end %>
|
2016-12-12 23:03:14 +08:00
|
|
|
<% if experiment_page? ||
|
|
|
|
module_page? ||
|
|
|
|
sample_types_page_my_module? ||
|
2016-12-14 17:35:48 +08:00
|
|
|
sample_groups_page_my_module? ||
|
|
|
|
sample_groups_page_experiment? ||
|
|
|
|
sample_types_page_expermient? %>
|
|
|
|
<% if !module_page? &&
|
|
|
|
!sample_types_page_my_module? &&
|
|
|
|
!sample_groups_page_my_module? %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<li class="active">
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= truncate(@experiment.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2016-07-29 21:47:41 +08:00
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li>
|
|
|
|
<% if can_view_experiment(@experiment) %>
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= link_to truncate(@experiment.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH),
|
|
|
|
canvas_experiment_path(@experiment) %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<% else %>
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= truncate(@experiment.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% end %>
|
2016-07-29 21:47:41 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2016-12-12 23:03:14 +08:00
|
|
|
<% if module_page? ||
|
|
|
|
sample_types_page_my_module? ||
|
|
|
|
sample_groups_page_my_module? %>
|
2016-07-29 21:47:41 +08:00
|
|
|
<li class="active">
|
2016-10-05 23:45:20 +08:00
|
|
|
<%= truncate(@my_module.name,
|
|
|
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2016-07-29 22:08:30 +08:00
|
|
|
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<% end %>
|