Show admin navbar only for admins
This commit is contained in:
@@ -13,12 +13,14 @@
|
||||
<%= link_to "Profil", profile_path %>
|
||||
</button>
|
||||
</li>
|
||||
<% if (current_user.admin? || current_user.operator?) %>
|
||||
<% if current_user.admin? %>
|
||||
<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 current_user.operator? %>
|
||||
<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 %>
|
||||
|
||||
Reference in New Issue
Block a user