Add status badges for uploaded files and sent emails on admin request page

This commit is contained in:
Troll (Hermes Agent) 2026-07-31 21:43:38 +00:00
parent 30732c0b64
commit 7ef8779eb7
2 changed files with 43 additions and 3 deletions

View file

@ -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}
</style>
</head>
<body>
@ -85,6 +87,22 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa
<div class="section">
<h2>2. Upload Songs</h2>
<p>
Version A:
{% if req.song_a_path and file_exists(req.song_a_path) %}
<span class="status-badge ok">✅ Uploaded</span> {{ basename(req.song_a_path) }}
{% else %}
<span class="status-badge missing">❌ Not uploaded</span>
{% endif %}
</p>
<p>
Version B:
{% if req.song_b_path and file_exists(req.song_b_path) %}
<span class="status-badge ok">✅ Uploaded</span> {{ basename(req.song_b_path) }}
{% else %}
<span class="status-badge missing">❌ Not uploaded</span>
{% endif %}
</p>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload_songs">
<label for="song_a">Version A MP3</label>
@ -98,6 +116,14 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa
<div class="section">
<h2>3. Notify Customer</h2>
<p>
Preview email:
{% if req.preview_sent_at %}
<span class="status-badge sent">✅ Sent</span> {{ req.preview_sent_at }}
{% else %}
<span class="status-badge missing">❌ Not sent yet</span>
{% endif %}
</p>
<p>Both songs must be uploaded first.</p>
<form method="POST">
<input type="hidden" name="action" value="notify_customer">
@ -114,6 +140,14 @@ pre{background:#111827;padding:.8rem;border-radius:.5rem;overflow:auto;white-spa
<span class="approved-box">{{ req.customer_approved.upper() }}</span>
{% endif %}
</p>
<p>
Delivery email:
{% if req.delivery_sent_at %}
<span class="status-badge sent">✅ Sent</span> {{ req.delivery_sent_at }}
{% else %}
<span class="status-badge missing">❌ Not sent yet</span>
{% endif %}
</p>
<form method="POST">
<input type="hidden" name="action" value="mark_paid_deliver">
<label for="square_payment_ref">Square Payment Reference</label>