aboutsummaryrefslogtreecommitdiff
path: root/web/src
diff options
context:
space:
mode:
Diffstat (limited to 'web/src')
-rw-r--r--web/src/components/Quotes.jsx1
-rw-r--r--web/src/layouts/Layout.astro2
-rw-r--r--web/src/pages/index.astro19
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>