Add delete request button to admin dashboard with confirmation and file cleanup

This commit is contained in:
Troll (Hermes Agent) 2026-07-31 21:47:45 +00:00
parent 7ef8779eb7
commit b8f1fee102
3 changed files with 41 additions and 2 deletions

View file

@ -21,6 +21,7 @@ tr:hover{background:#2d3748}
.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}
@ -65,7 +66,11 @@ tr:hover{background:#2d3748}
<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></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 %}