diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-01-11 18:02:05 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-01-11 18:02:05 -0500 |
| commit | 7e65ae0e135098acad76b8081f34478b4efc077f (patch) | |
| tree | b7efc060fca4257a875a5a3e525e2733b6579040 /web/src | |
| parent | f5de90ba89146008af78c16e798e216efccf0c50 (diff) | |
| download | AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.tar.gz AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.tar.bz2 AleeBot-7e65ae0e135098acad76b8081f34478b4efc077f.zip | |
Cleaned up some code, author image now support attachments
Diffstat (limited to 'web/src')
| -rw-r--r-- | web/src/components/Quotes.jsx | 1 | ||||
| -rw-r--r-- | web/src/layouts/Layout.astro | 2 | ||||
| -rw-r--r-- | web/src/pages/index.astro | 19 |
3 files changed, 19 insertions, 3 deletions
diff --git a/web/src/components/Quotes.jsx b/web/src/components/Quotes.jsx index 1d563e7..831408d 100644 --- a/web/src/components/Quotes.jsx +++ b/web/src/components/Quotes.jsx @@ -72,6 +72,7 @@ export function PendingQuotes() { </div> <p className="quoteText">{quote.quote}</p> <small>- {quote.year}</small> + <small>Submitted by {quote.submitterAuthor} ({quote.submitterID})</small> </div> <button onClick={() => approveQuote(quote.id)}>Approve</button> <button onClick={() => rejectQuote(quote.id)}>Reject</button> diff --git a/web/src/layouts/Layout.astro b/web/src/layouts/Layout.astro index e455c61..2f6032d 100644 --- a/web/src/layouts/Layout.astro +++ b/web/src/layouts/Layout.astro @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <meta name="generator" content={Astro.generator} /> - <title>Astro Basics</title> + <title>AleeBot Web Interface</title> </head> <body> <slot /> diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index b5c607d..8136402 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -2,12 +2,11 @@ import Layout from '../layouts/Layout.astro'; import { PendingQuotes } from '../components/Quotes'; -const version = await fetch('http://localhost:3000/api/version').then(res => res.json()); --- <Layout> <div class="container"> - <h1>AleeBot {version}</h1> + <h1 id="version">AleeBot</h1> <PendingQuotes client:load /> </div> </Layout> @@ -27,3 +26,19 @@ const version = await fetch('http://localhost:3000/api/version').then(res => res } </style> + +<script> + document.addEventListener('DOMContentLoaded', async () => { + try { + const version = await fetch('http://localhost:3000/api/version').then((res) => res.json()); + const versionElement = document.getElementById('version'); + if (versionElement) { + versionElement.textContent = `AleeBot ${version}`; + } else { + console.error('Element with ID "version" not found.'); + } + } catch (e) { + console.error('Failed to fetch version:', e); + } + }); +</script> |
