From f4acf39ca7e303aa7bfa6809fff1cbe1d10573bd Mon Sep 17 00:00:00 2001 From: overcuriousity Date: Tue, 22 Jul 2025 22:36:08 +0200 Subject: [PATCH] progress --- src/components/ContributionButton.astro | 101 +++++++++++++ src/components/Navigation.astro | 39 +---- src/components/ToolCard.astro | 57 ++++--- src/components/ToolMatrix.astro | 68 ++++++++- src/pages/contribute/index.astro | 193 ++++++++++++++++++++++++ src/pages/index.astro | 13 +- src/pages/knowledgebase.astro | 67 ++++---- src/scripts/auth-utils.js | 30 ++++ src/styles/global.css | 13 ++ 9 files changed, 496 insertions(+), 85 deletions(-) create mode 100644 src/components/ContributionButton.astro create mode 100644 src/pages/contribute/index.astro create mode 100644 src/scripts/auth-utils.js diff --git a/src/components/ContributionButton.astro b/src/components/ContributionButton.astro new file mode 100644 index 0000000..ea8a041 --- /dev/null +++ b/src/components/ContributionButton.astro @@ -0,0 +1,101 @@ +--- +// src/components/ContributionButton.astro +export interface Props { + type: 'edit' | 'new' | 'write'; + toolName?: string; + variant?: 'primary' | 'secondary' | 'small'; + text?: string; + className?: string; + style?: string; +} + +const { + type, + toolName, + variant = 'secondary', + text, + className = '', + style = '' +} = Astro.props; + +// Generate appropriate URLs and text based on type +let href: string; +let defaultText: string; +let icon: string; + +switch (type) { + case 'edit': + href = `/contribute/tool?edit=${encodeURIComponent(toolName || '')}`; + defaultText = 'Edit'; + icon = ` + `; + break; + case 'new': + href = '/contribute/tool'; + defaultText = 'Add Tool'; + icon = ` + `; + break; + case 'write': + href = '/contribute/knowledgebase'; + defaultText = 'Write Article'; + icon = ` + + + + `; + break; + default: + href = '/contribute'; + defaultText = 'Contribute'; + icon = ` + `; +} + +const displayText = text || defaultText; +const buttonClass = `btn btn-${variant} ${className}`.trim(); +const iconSize = variant === 'small' ? '14' : '16'; +--- + + + + + + {displayText} + + + \ No newline at end of file diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro index e980a0c..abf4e55 100644 --- a/src/components/Navigation.astro +++ b/src/components/Navigation.astro @@ -1,4 +1,5 @@ --- +// src/components/Navigation.astro import ThemeToggle from './ThemeToggle.astro'; const currentPath = Astro.url.pathname; @@ -24,6 +25,11 @@ const currentPath = Astro.url.pathname; ~/knowledgebase +
  • + + ~/contribute + +
  • ~/status @@ -40,35 +46,4 @@ const currentPath = Astro.url.pathname; - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/ToolCard.astro b/src/components/ToolCard.astro index 75507cf..2df6f74 100644 --- a/src/components/ToolCard.astro +++ b/src/components/ToolCard.astro @@ -1,4 +1,8 @@ --- +// src/components/ToolCard.astro (Updated) +import ContributionButton from './ContributionButton.astro'; +import ShareButton from './ShareButton.astro'; + export interface Props { tool: { name: string; @@ -52,6 +56,7 @@ const cardClass = isConcept ? 'card card-concept tool-card' : {!isMethod && hasValidProjectUrl && CC24-Server} {hasKnowledgebase && 📖} + @@ -101,33 +106,45 @@ const cardClass = isConcept ? 'card card-concept tool-card' : ))} - + \ No newline at end of file diff --git a/src/components/ToolMatrix.astro b/src/components/ToolMatrix.astro index a2ace61..c4be5fc 100644 --- a/src/components/ToolMatrix.astro +++ b/src/components/ToolMatrix.astro @@ -152,6 +152,9 @@ domains.forEach((domain: any) => { + + + + + + + + + + Beitragen + + - Entdecken + Entdecken diff --git a/src/pages/knowledgebase.astro b/src/pages/knowledgebase.astro index 9c3f362..9729308 100644 --- a/src/pages/knowledgebase.astro +++ b/src/pages/knowledgebase.astro @@ -1,6 +1,7 @@ --- import BaseLayout from '../layouts/BaseLayout.astro'; import { getToolsData } from '../utils/dataService.js'; +import ContributionButton from '../components/ContributionButton.astro'; // Load tools data const data = await getToolsData(); @@ -17,12 +18,24 @@ knowledgebaseTools.sort((a: any, b: any) => a.name.localeCompare(b.name));

    Knowledgebase

    -

    +

    Erweiterte Dokumentation und Erkenntnisse

    -

    +

    Praktische Erfahrungen, Konfigurationshinweise und Lektionen aus der Praxis

    + + +
    @@ -100,17 +113,23 @@ knowledgebaseTools.sort((a: any, b: any) => a.name.localeCompare(b.name)); - - - - - - - - Artikel öffnen - + + +

    {tool.description} @@ -151,25 +170,17 @@ knowledgebaseTools.sort((a: any, b: any) => a.name.localeCompare(b.name));

    Versuchen Sie es mit anderen Suchbegriffen.

    + -