feat(nav): unified navbar, account page, corpus summary widget, and i18n fixes

- New includes/nav.php: sticky site-wide nav with Tools dropdown, Dashboard
  link, compact language switcher, user identity → /account.php, Log out
- New account.php: credits & plan, profile, team, usage sections
- New api/corpus-summary.php: JSON endpoint for corpus doc count + last updated
- Replaces topbar in layout.php, layout_dashboard.php, and dashboard.php
- Fixes hardcoded Norwegian strings in dashboard.php credit cards via dbnToolsT()
- Adds 35 new i18n keys across all 4 languages (en/no/uk/pl) in i18n.php
- CSS: .dbn-nav navbar + .account-* account page styles in tools.css

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 19:11:39 +02:00
parent 33dc5406b2
commit 90117fa9de
8 changed files with 918 additions and 87 deletions
+3 -32
View File
@@ -31,6 +31,7 @@ if ($layoutAuthUser !== null) {
}
$layoutReturnUrl = urlencode($_SERVER['REQUEST_URI'] ?? '/');
// $layoutAuthUser / $layoutUserDisplay kept for backwards compat (now also used by nav.php internally)
?>
<!doctype html>
<html lang="<?= htmlspecialchars($uiLang) ?>">
@@ -58,6 +59,8 @@ window.DBN_FREE_TIER_BALANCE = <?= $layoutFreeTierBalance ?>;
</div>
<?php endif; ?>
<?php include __DIR__ . '/nav.php'; ?>
<?php if ($layoutIsGuest): ?>
<div id="guestBanner" class="guest-banner" role="alert" aria-live="polite">
<span>Du er ikke innlogget — verktøyene krever konto for å fungere.</span>
@@ -67,38 +70,6 @@ window.DBN_FREE_TIER_BALANCE = <?= $layoutFreeTierBalance ?>;
<?php endif; ?>
<main id="appShell" class="app-shell">
<header class="topbar">
<div>
<p class="eyebrow"><?= htmlspecialchars(dbnToolsT('brand_line', $uiLang)) ?></p>
<h1><?= htmlspecialchars(dbnToolsT('suite_title', $uiLang)) ?> <span class="title-mark">.</span> <?= htmlspecialchars(dbnToolsT('workspace_title', $uiLang)) ?></h1>
<div class="case-no">
<span class="pulse"></span>
<span>family-legal</span>
<span class="case-sep">.</span>
<span><?= htmlspecialchars(dbnToolsT('retention', $uiLang)) ?></span>
</div>
</div>
<div class="topbar-actions">
<nav class="shell-lang-switcher" aria-label="Language">
<?php foreach (dbnToolsSupportedLanguages() as $langCode): ?>
<a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
<?php endforeach; ?>
</nav>
<?php if ($layoutIsGuest): ?>
<a href="/?return=<?= $layoutReturnUrl ?>" class="secondary-button" style="text-decoration:none;">Logg inn</a>
<?php else: ?>
<a href="/dashboard/" class="secondary-button" style="text-decoration:none;">📚 Min korpus</a>
<span id="healthPill" class="status-pill"><?= htmlspecialchars(dbnToolsT('session_active', $uiLang)) ?></span>
<button id="healthButton" class="secondary-button" type="button"><?= htmlspecialchars(dbnToolsT('health', $uiLang)) ?></button>
<span class="topbar-user">
<?php if ($layoutUserDisplay !== ''): ?>
<span class="topbar-user__name" title="<?= htmlspecialchars($layoutAuthUser['email'] ?? '') ?>"><?= htmlspecialchars($layoutUserDisplay) ?></span>
<?php endif; ?>
<a href="/api/logout.php" class="topbar-user__logout">Logg ut</a>
</span>
<?php endif; ?>
</div>
</header>
<section class="manifesto" role="banner">
<div class="manifesto-copy">