<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>

<div class="head header">
  <%= link_to root_path do %>
    <%= render :partial => 'layouts/logo' %>
  <% end %>

  <div class="user-action">
    <span class="user">
      <i class="fa fa-user" aria-hidden="true"></i>
      <span>
        <%= theUser(session).loginname %></span>
    </span>
    <%= link_to({:controller => 'login', :action => 'logout'}, {:class => 'nav_link'}) do %>
    <span class="logout">
      <i class="fa fa-sign-out" aria-hidden="true"></i>
      <span>
        Abmelden</span>
    </span>
    <% end %>
  </div>
    <% if session[:sudo_user]
         @user = User.find_by(id: session[:sudo_user]) %>
     <br />
     <div class="user-action">
     <span class="user">
      <i class="fa fa-user-secret" aria-hidden="true"></i>
    <%= link_to({:controller => 'users', :action => 'unsudo', :id => session[:user]}, {:class => 'nav_link'}) do %>
     Anwendersupport beenden
    <% end %>
     </span>
     </div>
    <% end %>
</div>
<!-- end of header template -->
