95 lines
3.7 KiB
HTML
95 lines
3.7 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 Dashboard</title>
|
|
<style>
|
|
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;background:#111827;color:#f3f4f6;margin:0;padding:1rem;line-height:1.5}
|
|
.container{max-width:1100px;margin:0 auto}
|
|
h1{color:#60a5fa}
|
|
.filters{margin-bottom:1rem}
|
|
.filters a{color:#93c5fd;text-decoration:none;margin-right:1rem}
|
|
.filters a.active{font-weight:bold;color:#fff}
|
|
table{width:100%;border-collapse:collapse;background:#1f2937;border-radius:.5rem;overflow:hidden}
|
|
th,td{padding:.7rem;text-align:left;border-bottom:1px solid #374151}
|
|
th{background:#111827;color:#9ca3af}
|
|
tr:hover{background:#2d3748}
|
|
.status-badge{display:inline-block;padding:.25rem .6rem;border-radius:9999px;font-size:.8rem;font-weight:600;background:#374151}
|
|
.awaiting_payment{background:#f59e0b;color:#000}
|
|
.paid,.delivered{background:#10b981;color:#000}
|
|
.pending,.prompt_ready{background:#60a5fa;color:#000}
|
|
.songs_uploaded{background:#a78bfa;color:#000}
|
|
.actions a{color:#93c5fd;text-decoration:none;margin-right:.8rem}
|
|
.actions button.delete{background:transparent;color:#f87171;border:none;padding:0;cursor:pointer;font:inherit;text-decoration:none;margin-right:.8rem}
|
|
.logout{float:right;color:#f87171;text-decoration:none}
|
|
.flash{padding:.8rem;background:#064e3b;border-radius:.5rem;margin-bottom:1rem}
|
|
.flash.error{background:#450a0a}
|
|
.reset-box{margin-top:2rem;padding:1rem;background:#450a0a;border:1px solid #7f1d1d;border-radius:.5rem}
|
|
.reset-box form{display:inline}
|
|
.reset-box button{background:#dc2626;color:#fff}
|
|
.reset-box button:hover{background:#b91c1c}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<a href="{{ url_for('admin_logout') }}" class="logout">Log out</a>
|
|
<h1>Theme Song Booth — Admin Dashboard</h1>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% for category, message in messages %}
|
|
<div class="flash {{ category }}">{{ message }}</div>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
|
|
<div class="filters">
|
|
<a href="{{ url_for('admin_dashboard') }}" class="{% if not current_status %}active{% endif %}">All</a>
|
|
{% for key,label in statuses.items() %}
|
|
<a href="{{ url_for('admin_dashboard', status=key) }}" class="{% if current_status == key %}active{% endif %}">{{ label }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Name</th>
|
|
<th>Email</th>
|
|
<th>Genre</th>
|
|
<th>Status</th>
|
|
<th>Approved</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for r in requests %}
|
|
<tr>
|
|
<td>#{{ r.id }}</td>
|
|
<td>{{ r.name }}</td>
|
|
<td>{{ r.email }}</td>
|
|
<td>{{ r.style_genre or '-' }}</td>
|
|
<td><span class="status-badge {{ r.status }}">{{ statuses[r.status] }}</span></td>
|
|
<td>{% if r.customer_approved != 'none' %}{{ r.customer_approved.upper() }}{% else %}-{% endif %}</td>
|
|
<td class="actions"><a href="{{ url_for('admin_request', rid=r.id) }}">Open</a>
|
|
<form method="POST" action="{{ url_for('admin_delete_request', rid=r.id) }}" style="display:inline" onsubmit="return confirm('ARE YOU SURE you want to delete request #{{ r.id }} for {{ r.name }}? This cannot be undone.')">
|
|
<button type="submit" class="delete">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if not requests %}
|
|
<tr><td colspan="7">No requests found.</td></tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="reset-box">
|
|
<h2>⚠️ Reset System</h2>
|
|
<p>Use this once at the start of an event to clear all orders and uploaded files.</p>
|
|
<form method="POST" action="{{ url_for('admin_reset_system') }}" onsubmit="return confirm('ARE YOU SURE? This will delete ALL requests and ALL uploaded files. This cannot be undone.')">
|
|
<button type="submit">Reset System</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|