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

97 lines
3.5 KiB
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<nav class="navbar navbar-default navbar-fixed-top" id="main-nav">
<div class="container">
<!-- header -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-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>
<a class="navbar-brand" href="<%= root_path %>">
<% if Rails.env.production? %>
2016-07-21 19:11:15 +08:00
<img src="/images/logo.png" id="logo">
2016-02-12 23:52:43 +08:00
<% else %>
2016-07-21 19:11:15 +08:00
<img src="/images/logo.png" class="with-version" id="logo">
2016-02-12 23:52:43 +08:00
<span class="version">
<%= APP_VERSION %>
</span>
<% end %>
</a>
</div>
<% if user_signed_in? %>
<div class="collapse navbar-collapse" id="main-menu">
<!-- links -->
<ul class="nav navbar-nav">
<li>
<a href="<%= projects_path %>">
2016-07-21 19:11:15 +08:00
<span class="glyphicon glyphicon-home"></span>
2016-02-12 23:52:43 +08:00
<span class="visible-xs-inline"><%= t('nav.label.projects') %></span>
</a>
</li>
2016-07-21 19:11:15 +08:00
<li>
<a href="<%= protocols_path %>">
<span class="glyphicon glyphicon-list-alt"></span>
<span class="visible-xs-inline"><%= t('nav.label.protocols') %></span>
</a>
</li>
2016-02-12 23:52:43 +08:00
<% if false %>
<li>
<a href="#">
<span class="glyphicon glyphicon-calendar"></span>
<span class="visible-xs-inline"><%= t('nav.label.calendar') %></span>
</a>
</li>
<% end %>
<li>
<a class="btn-activity" href="<%= activities_path(format: :json) %>" role="button" data-remote="true">
<span class="glyphicon glyphicon-equalizer"></span>
<span class="visible-xs-inline"><%= t('nav.label.activities') %></span>
</a>
</li>
</ul>
<div>
<!-- profile info -->
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span><%= t('nav.user_greeting', full_name: current_user.full_name) %></span>
2016-07-21 19:11:15 +08:00
<%= image_tag avatar_path(current_user, :icon_small), class: "avatar" %>
2016-02-12 23:52:43 +08:00
</a>
<ul class="dropdown-menu">
<li><%= link_to t('nav.user.profile'), edit_user_registration_path %></li>
<li><%= link_to t('nav.user.settings'), preferences_path %></li>
<li role="separator" class="divider"></li>
<li><%= link_to t('nav.user.logout'), destroy_user_session_path, :method => :delete %></li>
</ul>
</li>
</ul>
<!-- search form -->
<%= form_tag search_path, method: :get, id: 'search-bar', class: 'navbar-form navbar-right', role: 'search' do %>
<div class="form-group">
<div class="input-group">
<input class="form-control" type="text" name="q" maxlength="50" placeholder="<%= t('nav.search') %>">
<span class="input-group-btn">
<button id="search-button" class="btn btn-default" type="submit">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
</nav>
<div id="loading-animation"></div>
<%= javascript_include_tag("navigation") %>