app/views/application/_navbar.html.erb
<%# Bootstrap navbar helper provided by twitter-bootstrap-rails gem %>
<%# https://github.com/seyhunak/twitter-bootstrap-rails#navbar-helper %>
<%= nav_bar brand:
content_tag(:div, class: 'brand-content') {
image_tag('https://owncloud.hpi.de/index.php/s/duKOws3U4vHTnFk/download', class: 'logo-img') +
content_tag(:span, t('appname'), class: 'wordmark')
},
responsive: true, fluid: true do
%>
<% if (request.user_agent =~ /Mobile|webOS/).present? # check if user is moving a mobile device %>
<%= menu_group pull: :right do %>
<div id="user-mobile-back" class="text-center hidden">
<%= '< ' + t('helpers.links.back') %>
</div>
<% if user_signed_in? %>
<div>
<%= (image_tag current_user.avatar_url || 'https://owncloud.hpi.de/index.php/s/57REqYtqsah3A7o/download', class: 'mobile-avatar center-block') %>
<li><a class="text-center"><%= "#{current_user.first_name}" %></a></li>
<%= drop_down_divider %>
</div>
<div id="user-mobile-menu" class="hidden">
<%= drop_down_divider %>
<%= menu_item t('navbar.drop-down.dashboard'), dashboard_user_path(current_user), class: 'text-center' %>
<%= menu_item t('navbar.drop-down.my_profile'), profile_user_path(current_user), class: 'text-center' %>
<%= menu_item t('navbar.drop-down.edit_profile'), edit_user_path(current_user), class: 'text-center' %>
<%= menu_item t('devise.registrations.sign_out'), destroy_user_session_path, method: :delete, class: 'text-center' %>
</div>
<% else %>
<%= menu_item (image_tag 'https://owncloud.hpi.de/index.php/s/45SBYQMw1jnN9UM/download', class: 'login-img center-block'), new_user_session_path %>
<% end %>
<div id="default-mobile-menu">
<% if can? :index, User %>
<%= menu_item User.model_name.human(:count => :many).titleize, users_path, class: 'text-center' %>
<% end %>
<%= menu_item Team.model_name.human(:count => :many).titleize, teams_path, class: 'text-center' %>
<%= menu_item Event.model_name.human(:count => :many).titleize, events_path, class: 'text-center' %>
</div>
<% end %>
<% else %>
<%= menu_group pull: :right do %>
<% if can? :index, User %>
<%= menu_item User.model_name.human(:count => :many).titleize, users_path %>
<% end %>
<%= menu_item Team.model_name.human(:count => :many).titleize, teams_path %>
<%= menu_item Event.model_name.human(:count => :many).titleize, events_path %>
<% if user_signed_in? %>
<%= drop_down (image_tag current_user.avatar_url || 'https://owncloud.hpi.de/index.php/s/57REqYtqsah3A7o/download', class: 'avatar') + " #{current_user.first_name}" do %>
<!--Fill in more drop down menu items-->
<%= menu_item t('navbar.drop-down.dashboard'), dashboard_user_path(current_user) %>
<%= menu_item t('navbar.drop-down.my_profile'), profile_user_path(current_user) %>
<%= menu_item t('navbar.drop-down.edit_profile'), edit_user_path(current_user) %>
<%= drop_down_divider %>
<%= menu_item t('devise.registrations.sign_out'), destroy_user_session_path, method: :delete %>
<% end %>
<% else %>
<%= menu_item (image_tag 'https://owncloud.hpi.de/index.php/s/45SBYQMw1jnN9UM/download', class: 'login-img', pull: :right), new_user_session_path %>
<% end %>
<% end %>
<% end %>
<% end %>