diff --git a/Program.cs b/Program.cs index eff18d7..8956825 100644 --- a/Program.cs +++ b/Program.cs @@ -303,7 +303,11 @@ api.MapGet("/results", async (AppDbContext db) => Author = s.Player!.DisplayName, Total = s.Votes.Sum(v => v.Score), Count = s.Votes.Count, - Average = s.Votes.Count == 0 ? 0 : s.Votes.Average(v => v.Score) + Average = s.Votes.Count == 0 ? 0 : s.Votes.Average(v => v.Score), + s.ScreenshotUrl, + s.YoutubeUrl, + s.Description, + s.Genre }) .OrderByDescending(r => r.Total) .ToListAsync(); diff --git a/TASKS.md b/TASKS.md index 248285e..6d329e1 100644 --- a/TASKS.md +++ b/TASKS.md @@ -42,6 +42,5 @@ ## Deployment - [x] Add minimal publish profile/notes for IIS (respect `ASPNETCORE_ENVIRONMENT`, admin password env var, writable App_Data). -## Stretch (later) -- [ ] Support multiple sessions/rooms. -- [ ] Add rate limiting or spam safeguards. +## Stretch (removed for now) +*(none)* diff --git a/wwwroot/app.js b/wwwroot/app.js index a6fd26c..4a707b3 100644 --- a/wwwroot/app.js +++ b/wwwroot/app.js @@ -160,10 +160,11 @@ function renderResults() { id: r.id, name: r.name, genre: `${r.total} pts • ${r.count} votes • avg ${r.average.toFixed(1)}`, - description: r.author ? `By ${r.author}` : "", + description: r.description || (r.author ? `By ${r.author}` : ""), screenshotUrl: r.screenshotUrl, - youtubeUrl: r.youtubeUrl - }, { showAuthor: false }); + youtubeUrl: r.youtubeUrl, + author: r.author + }, { showAuthor: true }); list.appendChild(card); }); } @@ -235,9 +236,11 @@ function setupHandlers() { const adminToggle = $("admin-toggle"); const adminCard = $("admin-card"); const adminClose = $("admin-close"); - const togglePanel = (show) => adminCard.classList.toggle("hidden", !show); - adminToggle.addEventListener("click", () => togglePanel(!adminCard.classList.contains("hidden"))); - adminClose.addEventListener("click", () => togglePanel(false)); + if (adminToggle && adminCard && adminClose) { + const togglePanel = (show) => adminCard.classList.toggle("hidden", !show); + adminToggle.addEventListener("click", () => togglePanel(!adminCard.classList.contains("hidden"))); + adminClose.addEventListener("click", () => togglePanel(false)); + } } async function adminAction(path, successMessage) { diff --git a/wwwroot/styles.css b/wwwroot/styles.css index 5716469..e5070e8 100644 --- a/wwwroot/styles.css +++ b/wwwroot/styles.css @@ -199,6 +199,7 @@ button.ghost { color: #9ca3af; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,0.35); + z-index: 30; } .admin-panel { @@ -206,7 +207,10 @@ button.ghost { bottom: 70px; right: 18px; width: 320px; - z-index: 20; + z-index: 40; + display: flex; + flex-direction: column; + gap: 10px; } .panel-header {