Files
yolkbook/nginx/html/admin.html
derekc 4172b63dc2 Add footer with CHNS.tech credit and Buy Me a Coffee button
Adds a green footer (matching nav colour) to all authenticated pages
with a "Created by: CHNS.tech" link and a styled BMC button. CSP updated
to allow buymeacoffee CDN domains.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:50:30 -07:00

90 lines
3.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin — Yolkbook</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<nav class="nav">
<a class="nav-brand" href="/">🥚 <span>Yolkbook</span></a>
<ul class="nav-links">
<li><a href="/">Dashboard</a></li>
<li><a href="/log">Log Eggs</a></li>
<li><a href="/flock">Flock</a></li>
<li><a href="/budget">Budget</a></li>
<li><a href="/summary">Summary</a></li>
</ul>
</nav>
<main class="container">
<h1>Admin — User Management</h1>
<div id="msg" class="message"></div>
<!-- User list -->
<div class="section-header">
<h2>All Users</h2>
<button class="btn btn-ghost btn-sm" onclick="loadUsers()">Refresh</button>
</div>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Username</th>
<th>Role</th>
<th>Status</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="users-body">
<tr class="empty-row"><td colspan="5">Loading…</td></tr>
</tbody>
</table>
</div>
<!-- Reset password modal -->
<div id="reset-modal" class="modal-overlay" style="display:none">
<div class="modal-box">
<h2>Reset Password</h2>
<p style="margin-bottom:1rem;color:var(--muted)">Setting new password for: <strong id="reset-username"></strong></p>
<div id="reset-msg" class="message"></div>
<div class="form-group" style="margin-bottom:1rem">
<label>New Password</label>
<input type="password" id="reset-password" minlength="6" placeholder="min 6 characters">
</div>
<div style="display:flex;gap:0.5rem;justify-content:flex-end">
<button class="btn btn-ghost" onclick="hideResetModal()">Cancel</button>
<button class="btn btn-primary" onclick="submitReset()">Set Password</button>
</div>
</div>
</div>
<!-- Delete confirmation modal -->
<div id="delete-modal" class="modal-overlay" style="display:none">
<div class="modal-box">
<h2>Delete User</h2>
<p style="margin-bottom:1.5rem">Delete <strong id="delete-username"></strong>? This will permanently remove their account and all associated data.</p>
<div style="display:flex;gap:0.5rem;justify-content:flex-end">
<button class="btn btn-ghost" onclick="hideDeleteModal()">Cancel</button>
<button class="btn btn-danger" onclick="submitDelete()">Delete</button>
</div>
</div>
</div>
</main>
<footer class="site-footer">
Created by: <a href="https://chns.tech" target="_blank" rel="noopener noreferrer">CHNS.tech</a>
<a href="https://www.buymeacoffee.com/CHNS" target="_blank" rel="noopener noreferrer" class="bmc-btn">🎉 Buy me an energy drink</a>
</footer>
<script src="/js/api.js?v=4"></script>
<script src="/js/auth.js?v=4"></script>
<script src="/js/admin.js?v=4"></script>
</body>
</html>