tap/app/views/layouts/_header.html.erb

76 lines
3.3 KiB
Text
Raw Normal View History

2014-12-09 14:39:27 +01:00
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
2014-11-25 13:09:55 +01:00
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
2014-12-09 14:39:27 +01:00
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
2015-02-19 17:02:47 +01:00
<%= link_to "Taþ", root_path, class: "navbar-brand nav-logo" %>
2014-11-25 13:09:55 +01:00
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
2015-02-12 14:39:58 +01:00
<% unless current_user && current_user.koelkast? %>
<div class="collapse navbar-collapse">
<div class="hidden-xs navbar-form navbar-right">
<div class="form-group">
<% if user_signed_in? %>
<%= link_to "Logout", destroy_user_session_path, class: "btn btn-default form-control" %>
2015-03-20 04:20:39 +01:00
<% elsif session[:id] %>
<%= button_to "Logout", user_avatar_path(session[:id]), class: "btn btn-default form-control", method: :delete %>
2015-02-12 14:39:58 +01:00
<% else %>
<%= link_to "Login", omniauth_authorize_path("user", "zeuswpi"), class: "btn btn-success form-control" %>
2015-02-12 14:39:58 +01:00
<% end %>
</div>
2014-12-09 19:44:58 +01:00
</div>
2015-02-12 14:39:58 +01:00
<ul class="nav navbar-nav navbar-right">
<li><%= mail_to "tab@zeus.ugent.be", "Send feedback" %></li>
<% if user_signed_in? %>
<% if can? :manage, :all %>
<li>
<%= link_to "Place order", orders_path %>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><%= link_to "List", products_path %></li>
<li><%= link_to "Add product" , new_product_path %></li>
<li><%= link_to "Add stock", new_stock_path %></li>
2015-02-12 14:39:58 +01:00
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Users <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><%= link_to "List" , users_path %></li>
</ul>
</li>
<% end %>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Logged in as <%= current_user.nickname %> <b class="caret"></b></a>
<ul class="dropdown-menu">
2015-03-20 02:21:56 +01:00
<li><%= link_to "Edit avatar", edit_user_path(current_user) %></li>
2015-02-12 14:39:58 +01:00
</ul>
2015-02-10 07:15:25 +01:00
</li>
2015-04-03 22:19:47 +02:00
<li>
<p class="navbar-text">Debt: <%= euro(current_user.debt) %></p>
</li>
<% end %>
2015-02-12 14:39:58 +01:00
</ul>
2014-11-26 11:58:51 +01:00
2015-02-12 14:39:58 +01:00
<div class="visible-xs navbar-form">
<div class="form-group">
<% if user_signed_in? %>
<%= button_to "Logout", destroy_user_session_path, class: "btn btn-default form-control", method: :delete %>
<% else %>
<%= link_to "Login", omniauth_authorize_path("user", "zeuswpi"), class: "btn btn-success form-control" %>
2015-02-12 14:39:58 +01:00
<% end %>
</div>
2014-12-09 19:44:58 +01:00
</div>
2015-02-12 14:39:58 +01:00
<% end %>
2014-12-09 19:44:58 +01:00
2014-11-25 13:09:55 +01:00
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>