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:
+50
@@ -17,6 +17,20 @@ $tool = $tools[$slug];
|
||||
$returnPath = '/';
|
||||
$toolsLogin = 'https://dobetternorge.no/tools-login.php?return=' . urlencode($returnPath);
|
||||
|
||||
$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',
|
||||
];
|
||||
$toolMcpSlug = $toolMcpSlugs[$slug] ?? null;
|
||||
|
||||
// ── Localized pitch + feature content (en / no; uk/pl fall back to en) ────────
|
||||
$localizedContent = [
|
||||
|
||||
@@ -560,6 +574,42 @@ $sample = $samples[$slug];
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if ($toolMcpSlug): ?>
|
||||
<section class="lt-preview-mcp">
|
||||
<div class="lt-preview-mcp__inner">
|
||||
<div class="lt-preview-mcp__head">
|
||||
<span class="lt-preview-mcp__icon" aria-hidden="true">⚙️</span>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="lt-preview-cta">
|
||||
<div class="lt-preview-cta__inner">
|
||||
<p class="lt-preview-cta__eyebrow">Do Better Norge members</p>
|
||||
|
||||
Reference in New Issue
Block a user