Bring the terminal dev-tool/OSS-docs theme to full Wave A OVERRIDE-CONTRACT compliance. - 49 mandatory builtin overrides in templates/overrides/terminal/ (TTY chrome, re-skinned from the frozen builtin defaults; every content field, provider var, custom tag, data-bn-* attr and inline script preserved verbatim). - 7 page templates (default, full-width, landing, article, blog-index, contact, auth) with TTY-window chrome, man-page article layout, and theme_mode-driven light/dark switching. - GO BIG motion: dependency-free ASCII glyph-rain canvas on the hero override only (lazy-init, prefers-reduced-motion honored, static phosphor fallback). - 4 persona blocks (manpage_header, code_console, keybind_table, boot_log); ascii_header/toc/footer blocks retired in favour of overrides + template furniture. - 5 dual-mode presets (mode "both", all 19 tokens) with intentional paper-teletype light and phosphor dark sides. - Bundled OFL mono fonts (JetBrains Mono, IBM Plex Mono) with LICENSES record; all font-family via var(--font-heading|body|mono, fallback). - Themed email-safe wrapper (retained), master pages, and a seeded "grid" OSS dev-tool demo site (home, about, changelog + 3 posts, contact with row_inserted -> email-admins workflow, login). - Declared required_icon_packs = [lucide, simple-icons]. Verified: make build exit 0, make verify exit 0, check-safety exit 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
3.0 KiB
Plaintext
37 lines
3.0 KiB
Plaintext
{# auth-status terminal 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="terminal-mono rounded-md px-3 py-1.5 text-sm font-medium uppercase tracking-wide opacity-80 transition-colors hover:bg-primary/10 hover:opacity-100">Login</a>
|
|
<a href="/login?tab=register" class="terminal-mono rounded-md bg-accent px-3 py-1.5 text-sm font-medium uppercase tracking-wide 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="terminal-mono uppercase tracking-wide">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-md 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-md 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="terminal-mono uppercase tracking-wide">{{ 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="tty-corners hidden absolute right-0 top-full mt-1 w-48 rounded-md border border-primary/40 bg-card py-1 text-card-foreground tty-frame z-50">
|
|
<a href="/account" class="terminal-mono block px-4 py-2 text-sm uppercase tracking-wide text-card-foreground hover:bg-primary/10">My Profile</a>
|
|
<a href="/account/reviews" class="terminal-mono block px-4 py-2 text-sm uppercase tracking-wide 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="terminal-mono block w-full px-4 py-2 text-left text-sm uppercase tracking-wide 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 %}
|