Files
gd-list/admelist.html
T
miles 06c6beb0b1 Add admin login overlay and gated UI
Introduce a client-side admin login screen that locks the admin page until the correct password is entered. admelist.html now contains a dedicated admin login card and wraps the actual admin shell content in a hidden section; the body receives an admin-locked class while locked. app.js adds form handling, verifyAdminPassword/unlockAdminShell logic, uses a DELETE /__authcheck__ request to validate the stored password, and shows/hides the admin UI accordingly; it also centralizes auth status messages. styles.css adds styles for the login overlay, locked state, and responsive tweaks. server/server.js removes the previous server-side requireAdmin guard for /admelist so the client can perform the auth check.
2026-03-31 22:47:43 -05:00

115 lines
3.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Edit List - GD fedl</title>
<link rel="stylesheet" href="styles.css">
</head>
<body data-page="admelist" class="admin-locked">
<header id="admin-page-header">
<h1>FEDL Admin</h1>
<nav>
<a href="index.html">Home</a>
<a href="lists.html">Lists</a>
<a href="run.html">Submit Run</a>
<a href="players.html">Players</a>
<a href="rules.html">Rules</a>
<a href="roulette.html">Roulette</a>
</nav>
</header>
<main class="admin-shell">
<section id="admin-login-screen" class="admin-login-screen">
<div class="admin-login-card">
<p class="hero-kicker">Admin Access</p>
<h2>Enter the admin password</h2>
<p class="muted">Submit the server password to unlock the list editor and run moderation tools.</p>
<form id="admin-login-form" class="admin-login-form">
<label class="admin-password-field" for="admin-password">
<span>Admin password</span>
<input id="admin-password" type="password" placeholder="Enter server password" autocomplete="current-password" />
</label>
<div class="admin-login-actions">
<button id="admin-login-submit" type="submit" class="btn">Submit</button>
<p id="admin-auth-status" class="muted">Saved only in this browser session.</p>
</div>
</form>
</div>
</section>
<section id="admin-shell-content" class="admin-shell-content" hidden>
<section class="panel admin-overview-panel">
<div>
<p class="hero-kicker">Control Center</p>
<h2>Manage the live list and incoming runs</h2>
<p class="muted">Use the first panel to edit placements and the second panel to review new run submissions.</p>
</div>
<div class="admin-overview-badges">
<span>Live list editor</span>
<span>Run moderation</span>
</div>
</section>
<section class="panel admin-panel">
<div class="admin-toolbar">
<div>
<p class="hero-kicker">List Editor</p>
<h2>Manage the live list</h2>
<p id="admin-status" class="muted">Loading list data...</p>
</div>
<div class="admin-actions">
<input id="admin-search" type="text" placeholder="Search rows..." />
<button id="add-row" type="button" class="btn ghost-btn">Add Row</button>
<button id="save-list" type="button" class="btn">Save List</button>
</div>
</div>
<div class="table-wrap">
<table class="levels-table admin-table">
<thead>
<tr>
<th style="width:90px">#</th>
<th style="width:140px">Level</th>
<th>Title</th>
<th>Video URL</th>
<th style="width:120px">Delete</th>
</tr>
</thead>
<tbody id="admin-list-body"></tbody>
</table>
</div>
</section>
<section class="panel admin-panel">
<div class="admin-toolbar">
<div>
<p class="hero-kicker">Run Queue</p>
<h2>Review submitted runs</h2>
<p id="runs-admin-status" class="muted">Loading run submissions...</p>
</div>
<div class="admin-actions">
<input id="run-search" type="text" placeholder="Search submissions..." />
</div>
</div>
<div class="table-wrap">
<table class="levels-table admin-table">
<thead>
<tr>
<th style="width:130px">Status</th>
<th style="width:160px">Player</th>
<th>Level</th>
<th style="width:180px">Submitted</th>
<th style="width:240px">Actions</th>
</tr>
</thead>
<tbody id="run-admin-body"></tbody>
</table>
</div>
</section>
</section>
</main>
<script src="app.js"></script>
</body>
</html>