Skip to content

Commit

Permalink
[upd] _navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
gwmoura committed Nov 13, 2013
1 parent c073d91 commit dc44833
Showing 1 changed file with 38 additions and 26 deletions.
64 changes: 38 additions & 26 deletions app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
<%= link_to "Home", root_path, :class => 'brand' %>
<ul class="nav">
<% if user_signed_in? %>
<li>
<%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %>
</li>
<% else %>
<li>
<%= link_to 'Login', new_user_session_path %>
</li>
<% end %>
<% if user_signed_in? %>
<li>
<%= link_to 'Edit account', edit_user_registration_path %>
</li>
<% if current_user.has_role? :admin %>
<li>
<%= link_to 'Admin', users_path %>
</li>
<% end %>
<% else %>
<li>
<%= link_to 'Sign up', new_user_registration_path %>
</li>
<% end %>
</ul>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%= link_to "Home", root_path, :class => 'navbar-brand' %>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<% if user_signed_in? %>
<li>
<%= link_to 'Logout', destroy_user_session_path, :method=>'delete' %>
</li>
<% else %>
<li>
<%= link_to 'Login', new_user_session_path %>
</li>
<% end %>
<% if user_signed_in? %>
<li>
<%= link_to 'Edit account', edit_user_registration_path %>
</li>
<% if current_user.has_role? :admin %>
<li>
<%= link_to 'Admin', users_path %>
</li>
<% end %>
<% else %>
<li>
<%= link_to 'Sign up', new_user_registration_path %>
</li>
<% end %>
</ul>
</div>
</nav>

0 comments on commit dc44833

Please sign in to comment.