feat: Legal Tools v1 — multilingual landing, dashboard, SSO bridge
- Public landing page at / for unauthenticated users (EN/NO/UK/PL) - Authenticated / shows Case Workbench dashboard with manifesto strip, stats, and launched-tool grid (Transcribe, Timeline, BVJ, Advocate, Deep Research, Corpus) - Added includes/i18n.php with full 4-language translation layer - Extended layout.php to Case Workbench shell with tool rail, lang switcher - AI output language normalization extended to en/no/uk/pl in PHP agents - SSO token validation in bootstrap.php / index.php (dobetternorge.no bridge) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+49
-28
@@ -8,55 +8,76 @@ if (!dbnToolsIsAuthenticated()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$navItems = [
|
||||
'ask' => ['Ask', 'Source-grounded'],
|
||||
'search' => ['Search', 'Legal sources'],
|
||||
'deep-research' => ['Deep research', 'Agent + RAG'],
|
||||
'advocate' => ['Advocate', 'Take a side'],
|
||||
'barnevernet' => ['BVJ Analyzer', 'Document'],
|
||||
'summarize' => ['Summarize', 'Pasted text'],
|
||||
'timeline' => ['Timeline', 'Events'],
|
||||
'redact' => ['Redact', 'Privacy'],
|
||||
'transcribe' => ['Transcribe', 'Audio'],
|
||||
'corpus' => ['Corpus', 'Data & stack'],
|
||||
];
|
||||
$toolName = $toolName ?? 'ask';
|
||||
$toolTitle = $toolTitle ?? 'Legal Tools';
|
||||
$toolKind = $toolKind ?? '';
|
||||
$toolBadge = $toolBadge ?? '';
|
||||
$uiLang = dbnToolsCurrentLanguage();
|
||||
$navItems = dbnToolsLaunchedTools($uiLang);
|
||||
$toolName = $toolName ?? 'transcribe';
|
||||
$toolMeta = $navItems[$toolName] ?? null;
|
||||
$toolTitle = $toolMeta['label'] ?? ($toolTitle ?? dbnToolsT('suite_title', $uiLang));
|
||||
$toolKind = $toolMeta['sub'] ?? ($toolKind ?? '');
|
||||
$toolBadge = $toolMeta['badge'] ?? ($toolBadge ?? '');
|
||||
$langPath = strtok((string)($_SERVER['REQUEST_URI'] ?? '/'), '?') ?: '/';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="<?= htmlspecialchars($uiLang) ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= htmlspecialchars($toolTitle) ?> — Do Better Norge</title>
|
||||
<title><?= htmlspecialchars($toolTitle) ?> - Do Better Norge</title>
|
||||
<link rel="stylesheet" href="assets/css/tools.css">
|
||||
</head>
|
||||
<body data-authenticated="true" data-active-tool="<?= htmlspecialchars($toolName) ?>">
|
||||
<script>window.DBN_TOOLS_AUTHENTICATED = true;</script>
|
||||
<script>
|
||||
window.DBN_TOOLS_AUTHENTICATED = true;
|
||||
window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
||||
</script>
|
||||
<main id="appShell" class="app-shell">
|
||||
<header class="topbar">
|
||||
<div>
|
||||
<p class="eyebrow">Do Better Norge</p>
|
||||
<h1>Legal Tools</h1>
|
||||
<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">
|
||||
<span id="healthPill" class="status-pill">Session active</span>
|
||||
<button id="healthButton" class="secondary-button" type="button">Health</button>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="manifesto" role="banner">
|
||||
<div class="manifesto-copy">
|
||||
<p class="manifesto-eyebrow"><?= htmlspecialchars(dbnToolsT('manifesto_eyebrow', $uiLang)) ?></p>
|
||||
<h2 class="manifesto-title"><?= htmlspecialchars(dbnToolsT('manifesto_title', $uiLang)) ?></h2>
|
||||
<p class="manifesto-sub"><?= htmlspecialchars(dbnToolsT('manifesto_sub', $uiLang)) ?></p>
|
||||
</div>
|
||||
<div class="manifesto-stats" aria-label="Headline statistics">
|
||||
<div class="manifesto-stat"><strong>23</strong><span><?= htmlspecialchars(dbnToolsT('stat_echr', $uiLang)) ?></span></div>
|
||||
<div class="manifesto-stat"><strong>64%</strong><span><?= htmlspecialchars(dbnToolsT('stat_loss', $uiLang)) ?></span></div>
|
||||
<div class="manifesto-stat"><strong>1,731</strong><span><?= htmlspecialchars(dbnToolsT('stat_tribunal', $uiLang)) ?></span></div>
|
||||
<div class="manifesto-stat"><strong>20+</strong><span><?= htmlspecialchars(dbnToolsT('stat_pending', $uiLang)) ?></span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="disclaimer" role="note">
|
||||
Legal information and preparation support, not final legal advice. Pasted text is processed in memory by default.
|
||||
<?= htmlspecialchars(dbnToolsT('disclaimer', $uiLang)) ?>
|
||||
</div>
|
||||
|
||||
<section class="workspace" aria-label="Legal tools workspace">
|
||||
<nav class="tool-rail" aria-label="Tools">
|
||||
<?php foreach ($navItems as $slug => [$label, $sub]): ?>
|
||||
<a href="<?= $slug ?>.php" class="tool-tab<?= $slug === $toolName ? ' is-active' : '' ?>" data-tool="<?= $slug ?>"<?= $slug === $toolName ? ' aria-current="page"' : '' ?>>
|
||||
<span><?= $label ?></span>
|
||||
<small><?= $sub ?></small>
|
||||
<?php foreach ($navItems as $slug => $item): ?>
|
||||
<a href="<?= htmlspecialchars($item['url']) ?>" class="tool-tab<?= $slug === $toolName ? ' is-active' : '' ?>" data-tool="<?= htmlspecialchars($slug) ?>"<?= $slug === $toolName ? ' aria-current="page"' : '' ?>>
|
||||
<span><?= htmlspecialchars($item['label']) ?></span>
|
||||
<small><?= htmlspecialchars($item['sub']) ?></small>
|
||||
<em><?= htmlspecialchars($item['icon']) ?></em>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user