berrypod/lib/berrypod_web/components/layouts/admin.html.heex
jamey 559798206f extract setup wizard to dedicated /admin/setup page
Move the setup stepper out of the dashboard into its own LiveView.
Dashboard now redirects to setup when site isn't live, and shows
stats-only view once live. Also cleans up button component variant
handling, fixes alert CSS, and removes stale demo.html.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 23:55:42 +00:00

117 lines
3.6 KiB
Plaintext

<div class="admin-layout h-full">
<input id="admin-drawer" type="checkbox" class="admin-layout-toggle" />
<%!-- main content area --%>
<div class="admin-layout-content">
<%!-- mobile header --%>
<header class="admin-topbar">
<label
for="admin-drawer"
class="admin-btn admin-btn-ghost admin-btn-icon"
aria-label="Open navigation"
>
<.icon name="hero-bars-3" class="size-5" />
</label>
<span class="admin-topbar-title">Berrypod</span>
<.link href={~p"/"} class="admin-btn admin-btn-ghost admin-btn-sm">
<.icon name="hero-arrow-top-right-on-square-mini" class="size-4" /> Shop
</.link>
</header>
<%!-- page content --%>
<main class="flex-1 p-4 sm:p-6 lg:p-8">
<div class="mx-auto max-w-5xl">
{@inner_content}
</div>
</main>
</div>
<%!-- sidebar --%>
<div class="admin-sidebar-wrapper">
<label for="admin-drawer" class="admin-sidebar-overlay" aria-label="Close navigation"></label>
<aside class="admin-sidebar">
<%!-- sidebar header --%>
<div class="p-4 border-b border-base-300">
<.link navigate={~p"/admin"} class="text-lg font-bold tracking-tight">
Berrypod
</.link>
<p class="text-xs text-base-content/60 mt-0.5 truncate">
{@current_scope.user.email}
</p>
</div>
<%!-- nav links --%>
<nav class="flex-1 p-2" aria-label="Admin navigation">
<ul class="admin-nav">
<li :if={!@site_live}>
<.link
navigate={~p"/admin/setup"}
class={admin_nav_active?(@current_path, "/admin/setup")}
>
<.icon name="hero-rocket-launch" class="size-5" /> Setup
</.link>
</li>
<li>
<.link
navigate={~p"/admin"}
class={admin_nav_active?(@current_path, "/admin")}
>
<.icon name="hero-home" class="size-5" /> Dashboard
</.link>
</li>
<li>
<.link
navigate={~p"/admin/orders"}
class={admin_nav_active?(@current_path, "/admin/orders")}
>
<.icon name="hero-shopping-bag" class="size-5" /> Orders
</.link>
</li>
<li>
<.link
navigate={~p"/admin/products"}
class={admin_nav_active?(@current_path, "/admin/products")}
>
<.icon name="hero-cube" class="size-5" /> Products
</.link>
</li>
<li>
<.link
href={~p"/admin/theme"}
class={admin_nav_active?(@current_path, "/admin/theme")}
>
<.icon name="hero-paint-brush" class="size-5" /> Theme
</.link>
</li>
<li>
<.link
navigate={~p"/admin/settings"}
class={admin_nav_active?(@current_path, "/admin/settings")}
>
<.icon name="hero-cog-6-tooth" class="size-5" /> Settings
</.link>
</li>
</ul>
</nav>
<%!-- sidebar footer --%>
<div class="p-2 border-t border-base-300">
<ul class="admin-nav">
<li>
<.link href={~p"/"}>
<.icon name="hero-arrow-top-right-on-square" class="size-5" /> View shop
</.link>
</li>
<li>
<.link href={~p"/users/log-out"} method="delete">
<.icon name="hero-arrow-right-start-on-rectangle" class="size-5" /> Log out
</.link>
</li>
</ul>
</div>
</aside>
</div>
</div>
<.flash_group flash={@flash} />