add setup foundations: site gate, registration lockdown, coming soon page
- Settings.site_live?/0 and set_site_live/1 for shop visibility control - Accounts.has_admin?/0 to detect single-tenant admin existence - Registration lockdown: /users/register redirects when admin exists - Setup.setup_status/0 aggregates provider, product, and stripe checks - Coming soon page at /coming-soon with themed styling - ThemeHook :require_site_live gate on all public shop routes - Site live → everyone through - Authenticated → admin preview through - No admin → fresh install demo through - Otherwise → redirect to coming soon - Go live / take offline toggle on /admin/settings - 648 tests, 0 failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
22
lib/simpleshop_theme_web/live/shop_live/coming_soon.ex
Normal file
22
lib/simpleshop_theme_web/live/shop_live/coming_soon.ex
Normal file
@@ -0,0 +1,22 @@
|
||||
defmodule SimpleshopThemeWeb.ShopLive.ComingSoon do
|
||||
use SimpleshopThemeWeb, :live_view
|
||||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
{:ok, assign(socket, :page_title, "Coming soon")}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<main class="flex min-h-screen items-center justify-center px-6 text-center" role="main">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold tracking-tight sm:text-4xl">{@theme_settings.site_name}</h1>
|
||||
<p class="mt-4 text-lg text-[var(--t-text-muted)]">
|
||||
We're getting things ready. Check back soon.
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
"""
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user