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

48 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-08-28 10:18:23 +00:00
<div class="polyglot-navbar">
2018-09-01 17:45:52 +00:00
<div class="logo"><%= link_to "Polyglot", contacts_path %></div>
<div class="right-align hidden-xs hidden-sm">
2018-08-28 10:18:23 +00:00
<div class="links">
<div id="contacts"><%= link_to "Contacts", contacts_path %></div>
<div id="settings"><%= link_to "Settings", setting_path %></div>
2018-08-28 10:18:23 +00:00
</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", transformation: [
{ gravity: "face:auto", width: 100, height: 100, radius: "max", crop: "crop" }
])%>
<% 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>