scinote-web/app/views/shared/_secondary_navigation.html.erb

152 lines
7.2 KiB
Plaintext
Raw Normal View History

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">
<!-- 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">
<% if all_projects_page? %>
<% if can_read_team?(current_team) %>
<li id="projects-active-nav-tab"
class="<%= 'active' if @current_filter == 'active' %> projects-view-filter"
data-filter="active">
<a href="#" title="<%=t "nav2.all_projects.index" %>">
<span><%=t "nav2.all_projects.index" %></span>
</a>
</li>
<li id="projects-archive-nav-tab"
class="<%= 'active' if @current_filter == 'archived' %> projects-view-filter"
data-filter="archived">
<a href="#" title="<%=t "nav2.all_projects.archive" %>">
<span><%=t "nav2.all_projects.archive" %></span>
</a>
</li>
<li id="projects-all-nav-tab"
class="<%= 'active' if @current_filter == 'all' %> projects-view-filter"
data-filter="all">
<a href="#" title="<%=t "nav2.all_projects.all" %>">
<span><%=t "nav2.all_projects.all" %></span>
</a>
</li>
<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>
<input type="radio" name="projects-view-mode-selector" class="sci-toggle-item">
<a class="sci-toggle-item-label" href="#projects-table-view" data-toggle="tab" data-mode="table"><i class="fas fa-th-list"></i></a>
</div>
</li>
</ul>
</li>
<% end %>
<% elsif project_page? ||
sample_types_page_project? ||
sample_groups_page_project? %>
<% 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>
<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" %>">
<span class="hidden-sm hidden-md"><%=t "nav2.projects.archive" %></span>
<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) %>
<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 fas fa-folder"></span>
</a>
</li>
2016-07-29 22:20:35 +08:00
<% end %>
<% 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? %>">
<a href="<%= module_archive_experiment_url(@experiment) %>" title="<%=t "nav2.experiments.archive" %>">
<span class="hidden-sm hidden-md"><%=t "nav2.experiments.archive" %></span>
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
2017-06-27 20:48:45 +08:00
</a>
</li>
<% end %>
2016-07-29 22:20:35 +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>
<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>
<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>
<span class="hidden-xs hidden-lg fas fa-list"></span>
2016-02-12 23:52:43 +08:00
</a>
</li>
<% end %>
<li data-hook="secondary-navigation-tabs"></li>
<% 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' %>">
<span class="hidden-sm hidden-md"><%=t "nav2.modules.archive" %></span>
<span class="hidden-xs hidden-lg fas fa-briefcase"></span>
</a>
2016-02-12 23:52:43 +08:00
</li>
<% end %>
<% end %>
</ul>
2016-07-29 22:08:30 +08:00
<!-- Secondary navigation title -->
2020-01-20 22:48:51 +08:00
<h2 class="nav-name <%= @inline_editable_title_config.present? ? 'editable' : '' %>">
<% if @inline_editable_title_config.present? %>
<%= render partial: "shared/inline_editing",
locals: {
2019-11-12 18:26:18 +08:00
initial_value: title_element.name,
config: @inline_editable_title_config
} %>
<% else %>
<%= title_element.name %>
<% end %>
2020-01-20 22:48:51 +08:00
</h2>
2016-02-12 23:52:43 +08:00
</div>
</div>
</nav>
<%= javascript_include_tag('secondary_navigation') %>
2016-02-12 23:52:43 +08:00
<% end %>