Skip to content

Commit 6e8eb46

Browse files
committed
only admin sees admin links
1 parent 255a56d commit 6e8eb46

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

app/views/shared/_navbar.html.erb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@
3939
<%# right %>
4040
<div class="flex items-center gap-2">
4141
<% if signed_in? %>
42-
<details class="relative group flex items-center" data-controller="dropdown" data-action="keydown.esc@window->dropdown#close">
43-
<summary class="inline-flex items-center gap-1 font-medium text-sm cursor-pointer [&::-webkit-details-marker]:hidden">
44-
<span class="font-medium font-mono">Admin</span>
45-
<%= inline_svg_tag "svg/chevron-down.svg", class: "w-4 h-4 stroke-2 transition-transform duration-200 group-open:rotate-180" %>
46-
</summary>
47-
<div class="absolute right-0 mt-5 bg-base-200 border border-base-content/20 z-1 rounded-lg p-1 space-y-1">
48-
<%= active_link_to "Avo", "/admin/avo/resources/users", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
49-
<%= active_link_to "Profitable", "/profitable", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
50-
<%= active_link_to "Jobs", "/jobs", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
51-
</div>
52-
</details>
42+
<% if current_user.admin? %>
43+
<details class="relative group flex items-center" data-controller="dropdown" data-action="keydown.esc@window->dropdown#close">
44+
<summary class="inline-flex items-center gap-1 font-medium text-sm cursor-pointer [&::-webkit-details-marker]:hidden">
45+
<span class="font-medium font-mono">Admin</span>
46+
<%= inline_svg_tag "svg/chevron-down.svg", class: "w-4 h-4 stroke-2 transition-transform duration-200 group-open:rotate-180" %>
47+
</summary>
48+
<div class="absolute right-0 mt-5 bg-base-200 border border-base-content/20 z-1 rounded-lg p-1 space-y-1">
49+
<%= active_link_to "Avo", "/admin/avo/resources/users", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
50+
<%= active_link_to "Profitable", "/profitable", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
51+
<%= active_link_to "Jobs", "/jobs", class_active: "du-btn-active", class: "whitespace-nowrap du-btn du-btn-ghost justify-start w-full" %>
52+
</div>
53+
</details>
54+
<% end %>
5355
<details class="relative group flex items-center" data-controller="dropdown" data-action="keydown.esc@window->dropdown#close">
5456
<summary class="inline-flex items-center gap-1 font-medium text-sm cursor-pointer [&::-webkit-details-marker]:hidden">
5557
<%= user_avatar(current_user) %>

0 commit comments

Comments
 (0)