Add Tool info links and MCP section to tool cards and preview pages

- Dashboard: add "Tool info" link → preview.php on every tool card footer
- Landing page: convert lt-card <a> to div+onclick, add footer with "Learn more" link and copyable MCP slug pill
- preview.php: add MCP Integration section per tool (slug, copy button, claude_desktop_config.json snippet, login note)
- CSS: lt-card__footer, lt-card__mcp-pill, lt-preview-mcp section styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 21:25:09 +02:00
parent 61425d7f17
commit 38d617bf02
4 changed files with 207 additions and 5 deletions
+30 -4
View File
@@ -56,6 +56,19 @@ $toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode('/
$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',
];
?>
<!doctype html>
<html lang="<?= htmlspecialchars($uiLang) ?>">
@@ -212,8 +225,14 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
<span class="lt-card__arrow"><?= htmlspecialchars(dbnToolsT('primary_access', $uiLang)) ?> &#x2192;</span>
</div>
</a>
<?php foreach ($tools as $slug => $item): ?>
<a class="lt-card" href="preview.php?tool=<?= htmlspecialchars($slug) ?>" data-tool="<?= htmlspecialchars($slug) ?>">
<?php foreach ($tools as $slug => $item):
$previewUrl = 'preview.php?tool=' . urlencode($slug) . ($uiLang !== 'en' ? '&lang=' . urlencode($uiLang) : '');
$mcpSlug = $toolMcpSlugs[$slug] ?? null;
?>
<div class="lt-card" data-tool="<?= htmlspecialchars($slug) ?>"
onclick="location.href='<?= htmlspecialchars($previewUrl) ?>'"
style="cursor:pointer;" tabindex="0" role="link"
onkeydown="if(event.key==='Enter')location.href='<?= htmlspecialchars($previewUrl) ?>'">
<div class="lt-card__art" aria-hidden="true">
<?= $toolSvgs[$slug] ?? '' ?>
</div>
@@ -221,9 +240,16 @@ window.DBN_TOOLS_LANG = <?= json_encode($uiLang, JSON_UNESCAPED_UNICODE) ?>;
<p class="lt-card__badge"><?= htmlspecialchars($item['badge']) ?></p>
<h3 class="lt-card__title"><?= htmlspecialchars($item['label']) ?></h3>
<p class="lt-card__desc"><?= htmlspecialchars($item['description']) ?></p>
<span class="lt-card__arrow"><?= htmlspecialchars(dbnToolsT('learn_more', $uiLang)) ?></span>
<div class="lt-card__footer">
<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>
<?php endif; ?>
</div>
</div>
</a>
</div>
<?php endforeach; ?>
</div>
</section>