polyglot/app/views/shared/_navbar.html.erb

46 lines
1.8 KiB
Plaintext

<div class="polyglot-navbar">
<div class="logo"><%= link_to "Polyglot", contacts_path %></div>
<div class="right-align hidden-xs hidden-sm">
<div class="links">
<div id="contacts"><%= link_to "Contacts", contacts_path %></div>
<div id="settings"><%= link_to "Settings", setting_path %></div>
</div>
<div class="profile">
<% if current_user.nil? %>
<%= link_to "Login", new_user_session_path %>
<% else %>
<div class="dropdown">
<div data-toggle="dropdown">
<% if current_user.photo.url.nil? %>
<img src="https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png" class="avatar dropdown-toggle img-circle">
<% else %>
<%= cl_image_tag current_user.photo, class: "avatar dropdown-toggle img-circle"%>
<% end %>
</div>
<ul class="dropdown-menu dropdown-menu-right polyglot-dropdown">
<li><%= link_to "Profile", user_path(current_user) %></li>
<li><%= link_to "Logout", destroy_user_session_path %></li>
</ul>
</div>
<% end %>
</div>
</div>
<div class="burger-menu hidden-md hidden-lg">
<div class="dropdown">
<i class="fa fa-bars dropdown-toggle" data-toggle="dropdown"></i>
<ul class="dropdown-menu dropdown-menu-right polyglot-dropdown">
<li><%= link_to "Contacts", contacts_path %></li>
<li><%= link_to "Settings", setting_path %></li>
<% if current_user.nil? %>
<li><%= link_to "Login", new_user_session_path %></li>
<% else %>
<li><%= link_to "Profile", user_path(current_user) %></li>
<li><%= link_to "Logout", destroy_user_session_path %></li>
<% end %>
</ul>
</div>
</div>
</div>