Add main menubar to /orgs page

- Change /orgs to use Layouts.authenticated instead of Layouts.app
- Update authenticated layout to show user menu without organization
- Menu button shows org name when in org, 'Menu' on org list page
- Always show Settings and Log out options
This commit is contained in:
Graham McIntire 2026-01-04 11:34:21 -06:00
parent c87630f472
commit 5fdb0e81fd
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View file

@ -108,14 +108,14 @@ defmodule ToweropsWeb.Layouts do
</.nav_link>
</div>
</div>
<div :if={@current_organization} class="relative flex items-center">
<div class="relative flex items-center">
<button
type="button"
id="org-menu-button"
phx-click={JS.toggle(to: "#org-menu")}
class="flex items-center gap-2 text-sm font-medium text-zinc-700 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-zinc-100"
>
{@current_organization.name}
{if @current_organization, do: @current_organization.name, else: "Menu"}
<.icon name="hero-chevron-down" class="h-4 w-4" />
</button>
@ -126,6 +126,7 @@ defmodule ToweropsWeb.Layouts do
>
<div class="py-1">
<.link
:if={@current_organization}
navigate={~p"/orgs"}
class="block px-4 py-2 text-sm text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-700"
phx-click={JS.hide(to: "#org-menu")}

View file

@ -1,4 +1,4 @@
<Layouts.app flash={@flash}>
<Layouts.authenticated flash={@flash} current_organization={nil}>
<.header>
{@page_title}
<:actions>
@ -35,4 +35,4 @@
</.button>
</div>
</div>
</Layouts.app>
</Layouts.authenticated>