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:
2026-05-25 06:54:04 +02:00
parent 38d617bf02
commit a821d39dcd
3 changed files with 64 additions and 136 deletions
+17 -12
View File
@@ -58,16 +58,19 @@ $registerUrl = 'https://dobetternorge.no/register.php';
require_once __DIR__ . '/includes/tool-svgs.php';
$toolMcpSlugs = [
'transcribe' => 'dbn.transcribe_audio',
'timeline' => 'dbn.timeline',
'redact' => 'dbn.redact',
'korrespond' => 'dbn.korrespond',
'barnevernet' => 'dbn.barnevernet_analyze',
'advocate' => 'dbn.advocate_brief',
'deep-research' => 'dbn.deep_research',
'discrepancy' => 'dbn.discrepancy_find',
'corpus' => 'dbn.list_documents',
'citations' => 'dbn.citation_graph',
'transcribe' => 'dbn.transcribe_audio',
'timeline' => 'dbn.timeline',
'redact' => 'dbn.redact',
'summarize' => 'dbn.summarize',
'legal-analysis' => 'dbn.legal_analysis',
'korrespond' => 'dbn.korrespond',
'barnevernet' => 'dbn.barnevernet_analyze',
'advocate' => 'dbn.advocate_brief',
'deep-research' => 'dbn.deep_research',
'discrepancy' => 'dbn.discrepancy_find',
'corpus' => 'dbn.list_documents',
'citations' => 'dbn.citation_graph',
'translate' => 'dbn.translate',
];
?>
<!doctype html>
@@ -244,8 +247,10 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
<a href="<?= htmlspecialchars($previewUrl) ?>" onclick="event.stopPropagation();"
class="lt-card__footer-link lt-card__footer-link--primary"><?= htmlspecialchars(dbnToolsT('learn_more', $uiLang)) ?> →</a>
<?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);});"
title="Copy MCP slug"><?= htmlspecialchars($mcpSlug) ?></code>
<a href="/mcp-tool.php?tool=<?= urlencode($mcpSlug) ?><?= $uiLang !== 'en' ? '&amp;lang=' . urlencode($uiLang) : '' ?>"
onclick="event.stopPropagation();"
class="lt-card__footer-link lt-card__footer-link--mcp"
title="<?= htmlspecialchars($mcpSlug) ?>">MCP →</a>
<?php endif; ?>
</div>
</div>