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>
This commit is contained in:
@@ -81,16 +81,24 @@ defmodule BerrypodWeb.CoreComponents do
|
||||
"""
|
||||
attr :rest, :global, include: ~w(href navigate patch method download name value disabled)
|
||||
attr :class, :string
|
||||
attr :variant, :string, values: ~w(primary)
|
||||
attr :variant, :string, values: ~w(primary outline)
|
||||
slot :inner_block, required: true
|
||||
|
||||
def button(%{rest: rest} = assigns) do
|
||||
variants = %{"primary" => "admin-btn-primary", nil => "admin-btn-primary admin-btn-soft"}
|
||||
variants = %{
|
||||
"primary" => "admin-btn-primary",
|
||||
"outline" => "admin-btn-outline",
|
||||
nil => "admin-btn-primary admin-btn-soft"
|
||||
}
|
||||
|
||||
variant_class = Map.fetch!(variants, assigns[:variant])
|
||||
|
||||
assigns =
|
||||
assign_new(assigns, :class, fn ->
|
||||
["admin-btn", Map.fetch!(variants, assigns[:variant])]
|
||||
end)
|
||||
assign(assigns, :class, [
|
||||
"admin-btn",
|
||||
variant_class,
|
||||
assigns[:class]
|
||||
])
|
||||
|
||||
if rest[:href] || rest[:navigate] || rest[:patch] do
|
||||
~H"""
|
||||
|
||||
@@ -43,6 +43,14 @@
|
||||
<%!-- 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"}
|
||||
|
||||
Reference in New Issue
Block a user