Add delete-songs controls to admin request page

Operators can now select Version A and/or Version B in the Upload Songs
section and click 'Delete Selected Songs'. The handler removes the
chosen MP3 files, clears their DB paths, resets customer_approved to
'none', and sets the request status back to 'prompt_ready' so new
songs can be uploaded.

Bumps version to 0.5.1.
This commit is contained in:
Troll (Hermes Agent) 2026-08-05 20:05:20 +00:00
parent d7e54809c9
commit 7eb72e511d
4 changed files with 68 additions and 18 deletions

View file

@ -325,22 +325,36 @@
<!-- Upload Songs -->
<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">
<input type="hidden" name="action" value="delete_songs">
<p>
<input type="checkbox" id="delete_a" name="delete_song" value="a"
{% if not (req.song_a_path and file_exists(req.song_a_path)) %}disabled{% endif %}>
<label for="delete_a">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 %}
</label>
</p>
<p>
<input type="checkbox" id="delete_b" name="delete_song" value="b"
{% if not (req.song_b_path and file_exists(req.song_b_path)) %}disabled{% endif %}>
<label for="delete_b">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 %}
</label>
</p>
<div class="actions">
<button type="submit" class="danger" onclick="return confirm('Delete selected song files? This will reset the request to Prompt Ready.')">Delete Selected Songs</button>
</div>
</form>
<hr style="border-color:#374151;margin:1rem 0">
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload_songs">