Files
plottservice/app/views/layouts/_header.html.erb

46 lines
2.1 KiB
Plaintext

<header class="container flex items-center justify-between px-4 py-6 mx-auto border-b-2 border-gray-300">
<a href="/" class="text-4xl font-bold text-hsrm-gray">Plottservice FAB</a>
<nav>
<ul class="flex justify-center space-x-2 font-semibold items-color">
<li class="relative">
<button class="px-4 py-2 hover:text-hsrm-red border-b-4 <%= root_tab? && 'border-hsrm-red-light' || 'hover:border-hsrm-red-light hover:bg-gray-100' %>">
<%= link_to "Aktuelle Druckaufträge", root_path %>
</button>
</li>
<% if user_signed_in? %>
<li class="relative">
<button class="px-4 py-2 hover:text-hsrm-red border-b-4 <%= profile_tab? && 'border-hsrm-red-light' || 'hover:border-hsrm-red-light hover:bg-gray-100' %>">
<%= link_to "Profil", profile_path %>
</button>
</li>
<% if allowed_to? :admin?, with: ApplicationPolicy %>
<li class="relative">
<button class="px-4 py-2 <%= current_user.admin? && 'hover:text-hsrm-red' || 'text-hsrm-gray-light' %> border-b-4 <%= admin_tab? && 'border-hsrm-red-light' || 'hover:border-hsrm-red-light hover:bg-gray-100' %>">
<%= link_to_if current_user.admin?, "Admin", admin_dashboard_path %>
</button>
</li>
<% end %>
<% if allowed_to? :operate?, with: ApplicationPolicy %>
<li class="relative">
<button class="px-4 py-2 hover:text-hsrm-red border-b-4 <%= operator_tab? && 'border-hsrm-red-light' || 'hover:border-hsrm-red-light hover:bg-gray-100' %>">
<%= link_to 'Operator', operator_jobs_path %>
</button>
</li>
<% end %>
<% end %>
</ul>
</nav>
<nav>
<ul class="flex items-center">
<% if user_signed_in? %>
<li><%= button_to Current.session, method: :delete, class: "flex btn btn-primary" do %>
<%= current_user.email %>
<%= icon "arrow-right-on-rectangle", class: "ml-2 size-6" %>
<% end %>
</li>
<% else %>
<li><%= link_to 'Anmelden', sign_in_path, class: "btn btn-primary" %></li>
<% end %>
</ul>
</nav>
</header>