113 lines
5.7 KiB
HTML
113 lines
5.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>
|
|
{% if refresh_seconds and refresh_seconds > 0 %}
|
|
<meta http-equiv="refresh" content="{{ refresh_seconds }}">
|
|
{% endif %}
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@500;700;800&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/booth.css') }}">
|
|
<style>
|
|
.dashboard-table td { white-space: nowrap; }
|
|
.dashboard-table td.wrap { white-space: normal; max-width: 220px; }
|
|
.dashboard-table .id-cell { font-family: var(--font-mono); font-weight: 700; }
|
|
</style>
|
|
</head>
|
|
<body class="booth-page">
|
|
<div class="container container-wide">
|
|
<div class="topbar">
|
|
<h1>Theme Song Booth — Admin Dashboard</h1>
|
|
<div class="nav">
|
|
<a href="{{ url_for('kiosk') }}" target="_blank" rel="noopener noreferrer">Kiosk</a>
|
|
<a href="{{ url_for('admin_pricing') }}">Pricing</a>
|
|
<a href="{{ url_for('admin_sales') }}">Sales</a>
|
|
<a href="{{ url_for('admin_settings') }}" class="text-success" style="font-weight:700">Settings</a>
|
|
<a href="{{ url_for('admin_logout') }}" class="text-danger">Log out</a>
|
|
</div>
|
|
</div>
|
|
|
|
{% 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 current_status in (None, '') %}active{% endif %}">All</a>
|
|
<a href="{{ url_for('admin_dashboard', status='pending') }}" class="{% if current_status == 'pending' %}active{% endif %}">Pending</a>
|
|
<a href="{{ url_for('admin_dashboard', status='prompt_ready') }}" class="{% if current_status == 'prompt_ready' %}active{% endif %}">Needs Upload</a>
|
|
<a href="{{ url_for('admin_dashboard', status='awaiting_payment') }}" class="{% if current_status == 'awaiting_payment' %}active{% endif %}">Awaiting Payment</a>
|
|
<a href="{{ url_for('admin_dashboard', status='delivered') }}" class="{% if current_status == 'delivered' %}active{% endif %}">Delivered</a>
|
|
<form method="POST" action="{{ url_for('admin_musicgpt_refresh') }}" style="display:inline;margin-left:auto">
|
|
<button type="submit" class="button-secondary" style="padding:var(--space-1) var(--space-3);font-size:0.85rem">Refresh MusicGPT Status</button>
|
|
</form>
|
|
<span class="refresh-hint">
|
|
{% if refresh_seconds and refresh_seconds > 0 %}
|
|
Auto-refresh every {{ refresh_seconds }}s
|
|
{% else %}
|
|
Auto-refresh off
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
|
|
<div class="table-wrap">
|
|
<table class="dashboard-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 class="id-cell">#{{ r.id }}</td>
|
|
<td class="wrap">{{ r.name }}</td>
|
|
<td class="wrap">{{ r.email }}</td>
|
|
<td class="wrap">{{ r.style_genre or '-' }}</td>
|
|
<td><span class="status-badge {{ r.status }}">{{ statuses[r.status] }}</span></td>
|
|
<td>{% if r.customer_approved and r.customer_approved != 'none' %}{{ (r.customer_approved or 'none').upper() }}{% else %}-<{% endif %}</td>
|
|
<td class="table-actions">
|
|
<a href="{{ url_for('admin_request', rid=r.id) }}" class="button">Open</a>
|
|
{% if r.status in ('pending', 'revisions_requested') %}
|
|
<a href="{{ url_for('admin_request', rid=r.id) }}#prompt" class="button-secondary">Prompt</a>
|
|
{% endif %}
|
|
{% if r.status == 'prompt_ready' and not r.musicgpt_status %}
|
|
<form method="POST" action="{{ url_for('admin_request', rid=r.id) }}" style="display:inline">
|
|
<input type="hidden" name="action" value="generate_musicgpt">
|
|
<button type="submit" class="button-secondary" style="font-size:0.8rem">Generate</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if r.status == 'songs_uploaded' and r.customer_approved == 'none' %}
|
|
<form method="POST" action="{{ url_for('admin_request', rid=r.id) }}" style="display:inline">
|
|
<input type="hidden" name="action" value="notify_customer">
|
|
<button type="submit" class="button-secondary" style="font-size:0.8rem">Send Preview</button>
|
|
</form>
|
|
{% endif %}
|
|
{% if r.status == 'awaiting_payment' %}
|
|
<a href="{{ url_for('admin_request', rid=r.id) }}#delivery" class="button-secondary">Deliver</a>
|
|
{% endif %}
|
|
<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="button-danger" style="font-size:0.8rem">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if not requests %}
|
|
<tr><td colspan="7" style="text-align:center;color:var(--text-muted);padding:var(--space-8)">No requests found.</td></tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|