Preschool / daycare identity: crayon borders, sticker badges, confetti, and a dependency-free bouncing-mascot + confetti-canvas hero showpiece (hero/landing only, lazy-init, prefers-reduced-motion honored, static no-JS fallback). - All 49 mandatory builtin overrides (OVERRIDE-CONTRACT §1), field-correct against the frozen cms builtins, re-skinned to the crayon design system. Legacy button (label/link/style) and card (text/media) field reads reconciled. - 7 page templates: default, full-width, landing, article, blog-index, contact, auth — standard header/main/footer slots, dotted-paper chrome, dual-mode. - Blocks reworked: mascot_hero/big_cta/gallery_of_art/numbers_counter/ storybook_quote/footer converted to builtin overrides; 4 persona blocks kept/ added — alphabet_strip (array-shaped, gotcha-safe), schedule, art_wall, story_time. - 5 presets, all mode "both", bright-classroom light + quiet-time navy dark. - Bundled OFL woff2 (Baloo 2 700, Quicksand 400/700) in assets/fonts + LICENSES; all font-family via var(--font-*); RECOMMENDED_FONTS/ICONS updated; required_icon_packs declared. - Themed email-safe wrapper; master pages (site + auth); seed demo site (home/about/blog+3 posts/contact form+row_inserted email workflow/login), preschool voice. Known platform limit (OVERRIDE-CONTRACT §11): auth-form/auth-status/ password-reset-form/page-suggestions overrides are authored correct-to-model but do not dispatch (compiled BlockFuncs). page-suggestions also omits the dynamic suggestion list (no FTS in codeless). Verified: `make` (ninja plugin build) exit 0; check-safety exit 0. Visual quality UNVERIFIED until Wave B. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
2.8 KiB
Plaintext
37 lines
2.8 KiB
Plaintext
{# auth-status kindergarten override — reproduces the builtin's hardcoded wiring: /login + /login?tab=register when logged out; /account, /account/reviews, and hx-post /api/auth/logout dropdown when logged in; hx-post /api/auth/resend-verification banner when unverified. State from context.*. #}
|
|
{% if not context.isPublicLoggedIn %}
|
|
<div class="auth-status flex items-center gap-2">
|
|
<a href="/login" class="kg-mono rounded-2xl px-3 py-1.5 text-sm font-medium opacity-80 transition-colors hover:bg-primary/10 hover:opacity-100">Login</a>
|
|
<a href="/login?tab=register" class="kg-mono rounded-2xl bg-accent px-3 py-1.5 text-sm font-medium text-accent-foreground hover:bg-accent/90">Sign Up</a>
|
|
</div>
|
|
{% else %}
|
|
{% if not context.publicEmailVerified %}<div class="fixed top-16 inset-x-0 z-40 border-y border-destructive/50 bg-destructive/15 px-4 py-2 text-center text-sm text-destructive">
|
|
<span class="kg-mono">Verify your email address.</span> <button hx-post="/api/auth/resend-verification" hx-swap="outerHTML" class="underline font-medium">Resend verification email</button>
|
|
</div>{% endif %}
|
|
<div class="auth-status relative">
|
|
<button type="button" onclick="this.nextElementSibling.classList.toggle('hidden')" class="flex items-center gap-2 rounded-2xl px-3 py-1.5 text-sm font-medium opacity-90 transition-colors hover:bg-primary/10 hover:opacity-100">
|
|
<span class="flex h-7 w-7 items-center justify-center rounded-2xl bg-accent text-accent-foreground"><svg class="h-4 w-4" aria-hidden="true"><use href="/icons/lucide.svg#user"></use></svg></span>
|
|
<span class="kg-mono">{{ context.publicDisplayName|default:context.publicUsername }}</span>
|
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>
|
|
</button>
|
|
<div id="auth-dropdown-menu" class="hidden absolute right-0 top-full mt-1 w-48 rounded-2xl border border-primary/40 bg-card py-1 text-card-foreground kg-crayon-shadow z-50">
|
|
<a href="/account" class="kg-mono block px-4 py-2 text-sm text-card-foreground hover:bg-primary/10">My Profile</a>
|
|
<a href="/account/reviews" class="kg-mono block px-4 py-2 text-sm text-card-foreground hover:bg-primary/10">My Reviews</a>
|
|
<hr class="my-1 border-border"/>
|
|
<button hx-post="/api/auth/logout" hx-swap="none" class="kg-mono block w-full px-4 py-2 text-left text-sm text-destructive hover:bg-primary/10">Logout</button>
|
|
</div>
|
|
<script>
|
|
(function(){
|
|
document.addEventListener('click', function(e) {
|
|
var menu = document.getElementById('auth-dropdown-menu');
|
|
var btn = document.querySelector('.auth-status > button');
|
|
if (!menu || !btn) return;
|
|
if (!btn.contains(e.target) && !menu.contains(e.target)) {
|
|
menu.classList.add('hidden');
|
|
}
|
|
});
|
|
})();
|
|
</script>
|
|
</div>
|
|
{% endif %}
|