Fix dashboard filters: Delivered instead of Done, correct Needs Upload status mapping
This commit is contained in:
parent
ec313601b6
commit
14ed80fe4b
2 changed files with 4 additions and 2 deletions
|
|
@ -118,6 +118,8 @@ def list_requests(status=None):
|
||||||
"""List all requests, optionally filtered by status, newest first."""
|
"""List all requests, optionally filtered by status, newest first."""
|
||||||
db = get_db()
|
db = get_db()
|
||||||
if status:
|
if status:
|
||||||
|
# Translate human filter names to stored status values.
|
||||||
|
status = status.lower().replace(' ', '_')
|
||||||
rows = db.execute('SELECT * FROM requests WHERE status = ? ORDER BY created_at DESC', (status,)).fetchall()
|
rows = db.execute('SELECT * FROM requests WHERE status = ? ORDER BY created_at DESC', (status,)).fetchall()
|
||||||
else:
|
else:
|
||||||
rows = db.execute('SELECT * FROM requests ORDER BY created_at DESC').fetchall()
|
rows = db.execute('SELECT * FROM requests ORDER BY created_at DESC').fetchall()
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,9 @@
|
||||||
<!-- Status filter links -->
|
<!-- Status filter links -->
|
||||||
<div class="filters">
|
<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') }}" class="{% if current_status in (None, '') %}active{% endif %}">All</a>
|
||||||
<a href="{{ url_for('admin_dashboard', status='needs_upload') }}" class="{% if current_status == 'needs_upload' %}active{% endif %}">Needs Upload</a>
|
<a href="{{ url_for('admin_dashboard', status='songs_uploaded') }}" class="{% if current_status == 'songs_uploaded' %}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='awaiting_payment') }}" class="{% if current_status == 'awaiting_payment' %}active{% endif %}">Awaiting Payment</a>
|
||||||
<a href="{{ url_for('admin_dashboard', status='done') }}" class="{% if current_status == 'done' %}active{% endif %}">Done</a>
|
<a href="{{ url_for('admin_dashboard', status='delivered') }}" class="{% if current_status == 'delivered' %}active{% endif %}">Delivered</a>
|
||||||
<span class="refresh-hint">
|
<span class="refresh-hint">
|
||||||
{% if refresh_seconds and refresh_seconds > 0 %}
|
{% if refresh_seconds and refresh_seconds > 0 %}
|
||||||
Auto-refresh every {{ refresh_seconds }}s
|
Auto-refresh every {{ refresh_seconds }}s
|
||||||
|
|
|
||||||
Reference in a new issue