Replace landing card MCP copy pill with link to /mcp-tool.php; fix preview.php for slugs without authored content (legal-analysis, summarize, translate)
This commit is contained in:
@@ -898,101 +898,39 @@ body[data-active-tool='citations'] .results {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.lt-card__footer-link--primary:hover { color: var(--dbn-red); }
|
.lt-card__footer-link--primary:hover { color: var(--dbn-red); }
|
||||||
.lt-card__mcp-pill {
|
.lt-card__footer-link--mcp {
|
||||||
font-family: ui-monospace, 'IBM Plex Mono', monospace;
|
font-family: ui-monospace, 'IBM Plex Mono', monospace;
|
||||||
font-size: 0.64rem;
|
font-size: 0.68rem;
|
||||||
background: #f1f5f9;
|
font-weight: 700;
|
||||||
border: 1px solid #e2e8f0;
|
letter-spacing: 0.06em;
|
||||||
|
text-transform: uppercase;
|
||||||
color: #64748b;
|
color: #64748b;
|
||||||
padding: 2px 8px;
|
text-decoration: none;
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
transition: background 0.15s;
|
|
||||||
}
|
}
|
||||||
.lt-card__mcp-pill:hover { background: #e2e8f0; }
|
.lt-card__footer-link--mcp:hover { color: var(--dbn-blue); }
|
||||||
|
|
||||||
/* ── Preview page MCP section ─────────────────────────────────── */
|
/* ── Preview page: small MCP info link ───────────────────────── */
|
||||||
.lt-preview-mcp {
|
.lt-preview-mcp-link {
|
||||||
background: #f8fafc;
|
background: #f8fafc;
|
||||||
border-top: 1px solid #e5e7eb;
|
border-top: 1px solid #e5e7eb;
|
||||||
border-bottom: 1px solid #e5e7eb;
|
border-bottom: 1px solid #e5e7eb;
|
||||||
padding: 3rem 1.5rem;
|
padding: 1.25rem 1.5rem;
|
||||||
}
|
}
|
||||||
.lt-preview-mcp__inner {
|
.lt-preview-mcp-link__inner {
|
||||||
max-width: 760px;
|
max-width: 760px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
text-align: center;
|
||||||
flex-direction: column;
|
|
||||||
gap: 1.25rem;
|
|
||||||
}
|
}
|
||||||
.lt-preview-mcp__head {
|
.lt-preview-mcp-link__inner p {
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; margin-top: 0.15rem; }
|
|
||||||
.lt-preview-mcp__title {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--dbn-blue);
|
|
||||||
margin: 0 0 0.25rem;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__sub { font-size: 0.9rem; color: #6b7280; margin: 0; }
|
|
||||||
.lt-preview-mcp__slug-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.75rem;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid #e5e7eb;
|
|
||||||
border-radius: 8px;
|
|
||||||
padding: 0.7rem 1rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__slug-label { font-size: 0.8rem; color: #6b7280; flex-shrink: 0; }
|
|
||||||
.lt-preview-mcp__slug {
|
|
||||||
font-family: ui-monospace, 'IBM Plex Mono', monospace;
|
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
|
color: #6b7280;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.lt-preview-mcp-link__inner a {
|
||||||
color: var(--dbn-blue);
|
color: var(--dbn-blue);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
flex: 1;
|
text-decoration: none;
|
||||||
|
margin-left: 0.4rem;
|
||||||
}
|
}
|
||||||
.lt-preview-mcp__copy {
|
.lt-preview-mcp-link__inner a:hover { color: var(--dbn-red); }
|
||||||
padding: 0.3rem 0.85rem;
|
|
||||||
background: var(--dbn-blue);
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 0.78rem;
|
|
||||||
font-weight: 600;
|
|
||||||
cursor: pointer;
|
|
||||||
flex-shrink: 0;
|
|
||||||
transition: background 0.15s;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__copy:hover { background: var(--dbn-soft-blue); }
|
|
||||||
.lt-preview-mcp__snippet { display: flex; flex-direction: column; gap: 0.4rem; }
|
|
||||||
.lt-preview-mcp__snippet-label {
|
|
||||||
font-family: ui-monospace, 'IBM Plex Mono', monospace;
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: #9ca3af;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.06em;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__pre {
|
|
||||||
background: #1e293b;
|
|
||||||
color: #e2e8f0;
|
|
||||||
font-family: ui-monospace, 'IBM Plex Mono', monospace;
|
|
||||||
font-size: 0.82rem;
|
|
||||||
line-height: 1.65;
|
|
||||||
padding: 1.1rem 1.25rem;
|
|
||||||
border-radius: 8px;
|
|
||||||
overflow-x: auto;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__note {
|
|
||||||
font-size: 0.82rem;
|
|
||||||
color: #9ca3af;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
.lt-preview-mcp__note a { color: var(--dbn-blue); }
|
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ $toolMcpSlugs = [
|
|||||||
'transcribe' => 'dbn.transcribe_audio',
|
'transcribe' => 'dbn.transcribe_audio',
|
||||||
'timeline' => 'dbn.timeline',
|
'timeline' => 'dbn.timeline',
|
||||||
'redact' => 'dbn.redact',
|
'redact' => 'dbn.redact',
|
||||||
|
'summarize' => 'dbn.summarize',
|
||||||
|
'legal-analysis' => 'dbn.legal_analysis',
|
||||||
'korrespond' => 'dbn.korrespond',
|
'korrespond' => 'dbn.korrespond',
|
||||||
'barnevernet' => 'dbn.barnevernet_analyze',
|
'barnevernet' => 'dbn.barnevernet_analyze',
|
||||||
'advocate' => 'dbn.advocate_brief',
|
'advocate' => 'dbn.advocate_brief',
|
||||||
@@ -68,6 +70,7 @@ $toolMcpSlugs = [
|
|||||||
'discrepancy' => 'dbn.discrepancy_find',
|
'discrepancy' => 'dbn.discrepancy_find',
|
||||||
'corpus' => 'dbn.list_documents',
|
'corpus' => 'dbn.list_documents',
|
||||||
'citations' => 'dbn.citation_graph',
|
'citations' => 'dbn.citation_graph',
|
||||||
|
'translate' => 'dbn.translate',
|
||||||
];
|
];
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
@@ -244,8 +247,10 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
|
|||||||
<a href="<?= htmlspecialchars($previewUrl) ?>" onclick="event.stopPropagation();"
|
<a href="<?= htmlspecialchars($previewUrl) ?>" onclick="event.stopPropagation();"
|
||||||
class="lt-card__footer-link lt-card__footer-link--primary"><?= htmlspecialchars(dbnToolsT('learn_more', $uiLang)) ?> →</a>
|
class="lt-card__footer-link lt-card__footer-link--primary"><?= htmlspecialchars(dbnToolsT('learn_more', $uiLang)) ?> →</a>
|
||||||
<?php if ($mcpSlug): ?>
|
<?php if ($mcpSlug): ?>
|
||||||
<code class="lt-card__mcp-pill" onclick="event.stopPropagation(); navigator.clipboard.writeText('<?= htmlspecialchars($mcpSlug) ?>').then(()=>{this.textContent='Copied!';setTimeout(()=>{this.textContent='<?= htmlspecialchars($mcpSlug) ?>';},1200);});"
|
<a href="/mcp-tool.php?tool=<?= urlencode($mcpSlug) ?><?= $uiLang !== 'en' ? '&lang=' . urlencode($uiLang) : '' ?>"
|
||||||
title="Copy MCP slug"><?= htmlspecialchars($mcpSlug) ?></code>
|
onclick="event.stopPropagation();"
|
||||||
|
class="lt-card__footer-link lt-card__footer-link--mcp"
|
||||||
|
title="<?= htmlspecialchars($mcpSlug) ?>">MCP →</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+17
-32
@@ -21,6 +21,8 @@ $toolMcpSlugs = [
|
|||||||
'transcribe' => 'dbn.transcribe_audio',
|
'transcribe' => 'dbn.transcribe_audio',
|
||||||
'timeline' => 'dbn.timeline',
|
'timeline' => 'dbn.timeline',
|
||||||
'redact' => 'dbn.redact',
|
'redact' => 'dbn.redact',
|
||||||
|
'summarize' => 'dbn.summarize',
|
||||||
|
'legal-analysis' => 'dbn.legal_analysis',
|
||||||
'korrespond' => 'dbn.korrespond',
|
'korrespond' => 'dbn.korrespond',
|
||||||
'barnevernet' => 'dbn.barnevernet_analyze',
|
'barnevernet' => 'dbn.barnevernet_analyze',
|
||||||
'advocate' => 'dbn.advocate_brief',
|
'advocate' => 'dbn.advocate_brief',
|
||||||
@@ -28,6 +30,7 @@ $toolMcpSlugs = [
|
|||||||
'discrepancy' => 'dbn.discrepancy_find',
|
'discrepancy' => 'dbn.discrepancy_find',
|
||||||
'corpus' => 'dbn.list_documents',
|
'corpus' => 'dbn.list_documents',
|
||||||
'citations' => 'dbn.citation_graph',
|
'citations' => 'dbn.citation_graph',
|
||||||
|
'translate' => 'dbn.translate',
|
||||||
];
|
];
|
||||||
$toolMcpSlug = $toolMcpSlugs[$slug] ?? null;
|
$toolMcpSlug = $toolMcpSlugs[$slug] ?? null;
|
||||||
|
|
||||||
@@ -207,7 +210,12 @@ $localizedContent = [
|
|||||||
|
|
||||||
// uk/pl fall back to 'en' — sample documents are Norwegian regardless
|
// uk/pl fall back to 'en' — sample documents are Norwegian regardless
|
||||||
$contentLang = array_key_exists($uiLang, $localizedContent) ? $uiLang : 'en';
|
$contentLang = array_key_exists($uiLang, $localizedContent) ? $uiLang : 'en';
|
||||||
$localContent = $localizedContent[$contentLang][$slug];
|
$localContent = $localizedContent[$contentLang][$slug] ?? $localizedContent['en'][$slug] ?? null;
|
||||||
|
if ($localContent === null) {
|
||||||
|
// No marketing copy authored for this slug yet — send the visitor straight to the tool.
|
||||||
|
header('Location: /' . $slug . '.php' . ($uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : ''));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// ── Sample inputs/outputs (always Norwegian — legal domain is Norway) ─────────
|
// ── Sample inputs/outputs (always Norwegian — legal domain is Norway) ─────────
|
||||||
$samples = [
|
$samples = [
|
||||||
@@ -483,7 +491,7 @@ $samples = [
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$sample = $samples[$slug];
|
$sample = $samples[$slug] ?? null;
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="<?= htmlspecialchars($uiLang) ?>">
|
<html lang="<?= htmlspecialchars($uiLang) ?>">
|
||||||
@@ -551,6 +559,7 @@ $sample = $samples[$slug];
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<?php if ($sample): ?>
|
||||||
<section class="lt-preview-sample">
|
<section class="lt-preview-sample">
|
||||||
<div class="lt-preview-sample__inner">
|
<div class="lt-preview-sample__inner">
|
||||||
<div class="lt-preview-sample__col">
|
<div class="lt-preview-sample__col">
|
||||||
@@ -573,38 +582,14 @@ $sample = $samples[$slug];
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($toolMcpSlug): ?>
|
<?php if ($toolMcpSlug): ?>
|
||||||
<section class="lt-preview-mcp">
|
<section class="lt-preview-mcp-link">
|
||||||
<div class="lt-preview-mcp__inner">
|
<div class="lt-preview-mcp-link__inner">
|
||||||
<div class="lt-preview-mcp__head">
|
<p>
|
||||||
<span class="lt-preview-mcp__icon" aria-hidden="true">⚙️</span>
|
<?= $uiLang === 'no' ? 'Bruker du Claude Desktop, Claude Code eller Cursor?' : 'Using Claude Desktop, Claude Code, or Cursor?' ?>
|
||||||
<div>
|
<a href="/mcp-tool.php?tool=<?= urlencode($toolMcpSlug) ?><?= $uiLang !== 'en' ? '&lang=' . urlencode($uiLang) : '' ?>"><?= $uiLang === 'no' ? 'Se MCP-oppsett for dette verktøyet' : 'See MCP setup for this tool' ?> →</a>
|
||||||
<h2 class="lt-preview-mcp__title"><?= $uiLang === 'no' ? 'MCP-integrasjon' : 'MCP Integration' ?></h2>
|
|
||||||
<p class="lt-preview-mcp__sub"><?= $uiLang === 'no' ? 'Bruk dette verktøyet direkte fra Claude Desktop, Claude Code eller Cursor.' : 'Use this tool directly from Claude Desktop, Claude Code, or Cursor.' ?></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="lt-preview-mcp__slug-row">
|
|
||||||
<span class="lt-preview-mcp__slug-label"><?= $uiLang === 'no' ? 'MCP-verktøyslug' : 'MCP tool slug' ?></span>
|
|
||||||
<code class="lt-preview-mcp__slug" id="mcpSlugCode"><?= htmlspecialchars($toolMcpSlug) ?></code>
|
|
||||||
<button class="lt-preview-mcp__copy" onclick="navigator.clipboard.writeText('<?= htmlspecialchars($toolMcpSlug) ?>').then(()=>{this.textContent='<?= $uiLang === 'no' ? 'Kopiert!' : 'Copied!' ?>';setTimeout(()=>{this.textContent='<?= $uiLang === 'no' ? 'Kopier' : 'Copy' ?>';},1400);});"><?= $uiLang === 'no' ? 'Kopier' : 'Copy' ?></button>
|
|
||||||
</div>
|
|
||||||
<div class="lt-preview-mcp__snippet">
|
|
||||||
<p class="lt-preview-mcp__snippet-label">claude_desktop_config.json</p>
|
|
||||||
<pre class="lt-preview-mcp__pre">{
|
|
||||||
"mcpServers": {
|
|
||||||
"dbn-tools": {
|
|
||||||
"command": "npx",
|
|
||||||
"args": ["-y", "@dobetternorge/mcp"],
|
|
||||||
"env": { "DBN_API_TOKEN": "YOUR_TOKEN" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}</pre>
|
|
||||||
</div>
|
|
||||||
<p class="lt-preview-mcp__note">
|
|
||||||
<?= $uiLang === 'no'
|
|
||||||
? 'API-token krever Plus- eller Pro-plan. <a href="' . htmlspecialchars($toolsLogin) . '">Logg inn</a> for å generere token og se full oppsettsguide.'
|
|
||||||
: 'API tokens require a Plus or Pro plan. <a href="' . htmlspecialchars($toolsLogin) . '">Log in</a> to generate a token and view the full setup guide.' ?>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user