diff --git a/app.py b/app.py index ac16906..1f27e26 100644 --- a/app.py +++ b/app.py @@ -191,6 +191,12 @@ def admin_request(rid): if not req: abort(404) + def file_exists(path): + return bool(path and Path(path).exists()) + + def basename(path): + return Path(path).name if path else '' + if request.method == 'POST': action = request.form.get('action') @@ -255,7 +261,7 @@ def admin_request(rid): return redirect(url_for('admin_request', rid=rid)) - return render_template('admin/request.html', req=req, statuses=STATUS_LABELS) + return render_template('admin/request.html', req=req, statuses=STATUS_LABELS, file_exists=file_exists, basename=basename) # ---------------- init ---------------- diff --git a/templates/admin/request.html b/templates/admin/request.html index e2bb916..3ad05d9 100644 --- a/templates/admin/request.html +++ b/templates/admin/request.html @@ -23,8 +23,10 @@ button.success{background:#10b981} .info-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem} .info-grid div{background:#111827;padding:.6rem;border-radius:.5rem} .approved-box{font-size:1.2rem;font-weight:bold;color:#fbbf24} -.copy-hint{font-size:.85rem;color:#9ca3af;margin-top:.3rem} -pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-space:pre-wrap} +.status-badge{display:inline-block;padding:.25rem .6rem;border-radius:9999px;font-size:.8rem;font-weight:600;background:#374151;color:#f3f4f6;margin-right:.3rem} +.status-badge.ok{background:#10b981;color:#000} +.status-badge.missing{background:#ef4444;color:#000} +.status-badge.sent{background:#60a5fa;color:#000} @@ -85,6 +87,22 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa

2. Upload Songs

+

+ Version A: + {% if req.song_a_path and file_exists(req.song_a_path) %} + ✅ Uploaded {{ basename(req.song_a_path) }} + {% else %} + ❌ Not uploaded + {% endif %} +

+

+ Version B: + {% if req.song_b_path and file_exists(req.song_b_path) %} + ✅ Uploaded {{ basename(req.song_b_path) }} + {% else %} + ❌ Not uploaded + {% endif %} +

@@ -98,6 +116,14 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa

3. Notify Customer

+

+ Preview email: + {% if req.preview_sent_at %} + ✅ Sent {{ req.preview_sent_at }} + {% else %} + ❌ Not sent yet + {% endif %} +

Both songs must be uploaded first.

@@ -114,6 +140,14 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa {{ req.customer_approved.upper() }} {% endif %}

+

+ Delivery email: + {% if req.delivery_sent_at %} + ✅ Sent {{ req.delivery_sent_at }} + {% else %} + ❌ Not sent yet + {% endif %} +