Some rows (schema drift, cancelled requests, manual status edits) have customer_approved = NULL instead of the default 'none'. Templates called .upper() on it blindly, causing a Jinja2 UndefinedError / 500 when the customer player or admin pages loaded. Replace all .upper() calls with (value or 'none').upper() and add truthy checks before rendering the approved choice in status.html and dashboard.html.
191 lines
5.6 KiB
HTML
191 lines
5.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Check Your Order Status — Trollgorithm Theme Song Booth</title>
|
|
<style>
|
|
/*
|
|
Public order status lookup page.
|
|
Customers enter their email to see request status, approval choice,
|
|
and the private player link once two songs have been uploaded.
|
|
*/
|
|
*{box-sizing:border-box;}
|
|
body{
|
|
font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
|
|
background:linear-gradient(135deg,#111827 0%,#1e3a8a 50%,#111827 100%);
|
|
color:#f3f4f6;
|
|
margin:0;
|
|
padding:1rem;
|
|
line-height:1.5;
|
|
min-height:100vh;
|
|
}
|
|
.container{max-width:680px;margin:0 auto;}
|
|
.banner{
|
|
width:100%;
|
|
border-radius:1rem;
|
|
box-shadow:0 10px 40px rgba(0,0,0,.4);
|
|
margin-bottom:1.5rem;
|
|
}
|
|
.card{
|
|
background:rgba(31,41,55,.9);
|
|
padding:1.5rem;
|
|
border-radius:1rem;
|
|
box-shadow:0 10px 25px rgba(0,0,0,.3);
|
|
border:1px solid rgba(96,165,250,.2);
|
|
}
|
|
h1{
|
|
margin-top:0;
|
|
color:#60a5fa;
|
|
text-align:center;
|
|
font-size:1.7rem;
|
|
}
|
|
.subtitle{
|
|
text-align:center;
|
|
color:#9ca3af;
|
|
margin-bottom:1.5rem;
|
|
}
|
|
label{
|
|
display:block;
|
|
margin-top:1rem;
|
|
font-weight:600;
|
|
color:#93c5fd;
|
|
}
|
|
input{
|
|
width:100%;
|
|
padding:.7rem;
|
|
border-radius:.5rem;
|
|
border:1px solid #374151;
|
|
background:#111827;
|
|
color:#f3f4f6;
|
|
font:inherit;
|
|
margin-top:.25rem;
|
|
}
|
|
input:focus{
|
|
outline:none;
|
|
border-color:#60a5fa;
|
|
box-shadow:0 0 0 3px rgba(96,165,250,.2);
|
|
}
|
|
button{
|
|
margin-top:1.5rem;
|
|
width:100%;
|
|
padding:1rem;
|
|
border:none;
|
|
border-radius:.5rem;
|
|
background:linear-gradient(90deg,#3b82f6,#8b5cf6);
|
|
color:#fff;
|
|
font-weight:700;
|
|
font-size:1.1rem;
|
|
cursor:pointer;
|
|
box-shadow:0 4px 15px rgba(59,130,246,.4);
|
|
transition:transform .1s,box-shadow .1s;
|
|
}
|
|
button:hover{
|
|
transform:translateY(-2px);
|
|
box-shadow:0 6px 20px rgba(139,92,246,.5);
|
|
}
|
|
.flash{
|
|
padding:.8rem;
|
|
background:#064e3b;
|
|
border-radius:.5rem;
|
|
margin-bottom:1rem;
|
|
}
|
|
.flash.error{background:#450a0a;}
|
|
.result{
|
|
margin-top:1.5rem;
|
|
}
|
|
.request{
|
|
background:#111827;
|
|
border:1px solid #374151;
|
|
border-radius:.75rem;
|
|
padding:1rem;
|
|
margin-bottom:1rem;
|
|
}
|
|
.request h3{margin-top:0;color:#93c5fd;}
|
|
.status{
|
|
display:inline-block;
|
|
padding:.25rem .6rem;
|
|
border-radius:9999px;
|
|
font-size:.85rem;
|
|
font-weight:600;
|
|
background:#374151;
|
|
color:#f3f4f6;
|
|
margin:.3rem 0;
|
|
}
|
|
.status.pending,.status.prompt_ready{background:#60a5fa;color:#000;}
|
|
.status.songs_uploaded{background:#a78bfa;color:#000;}
|
|
.status.awaiting_payment{background:#f59e0b;color:#000;}
|
|
.status.paid,.status.delivered{background:#10b981;color:#000;}
|
|
.status.revisions_requested{background:#f87171;color:#000;}
|
|
.link-button{
|
|
display:inline-block;
|
|
margin-top:.5rem;
|
|
padding:.6rem 1rem;
|
|
background:#3b82f6;
|
|
border-radius:.5rem;
|
|
color:#fff;
|
|
text-decoration:none;
|
|
font-weight:600;
|
|
}
|
|
.approved{font-weight:600;color:#fbbf24;}
|
|
.back{
|
|
display:block;
|
|
text-align:center;
|
|
margin-top:1.5rem;
|
|
color:#93c5fd;
|
|
text-decoration:none;
|
|
}
|
|
.back:hover{text-decoration:underline;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<img src="{{ url_for('static', filename='Trollgorithm_booth.jpg') }}" alt="Trollgorithm Theme Song Booth" class="banner">
|
|
|
|
<div class="card">
|
|
<h1>🔍 Check Your Order Status</h1>
|
|
<p class="subtitle">Enter the email address you used when you requested your song.</p>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="flash {{ category }}">{{ message }}</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<form method="POST">
|
|
<label for="email">Email address</label>
|
|
<input type="email" id="email" name="email" value="{{ email }}" required>
|
|
<button type="submit">Look Up My Song</button>
|
|
</form>
|
|
|
|
{% if searched %}
|
|
<div class="result">
|
|
{% if requests %}
|
|
{% for req in requests %}
|
|
<div class="request">
|
|
<h3>Request #{{ req.id }} — {{ req.name }}</h3>
|
|
<p><strong>Status:</strong> <span class="status {{ req.status }}">{{ statuses[req.status] }}</span></p>
|
|
|
|
{% if req.customer_approved and req.customer_approved != 'none' %}
|
|
<p class="approved">You selected: {% if req.customer_approved == 'both' %}Both Versions{% else %}Version {{ (req.customer_approved or 'none').upper() }}{% endif %}</p>
|
|
{% endif %}
|
|
|
|
{% if req.song_a_path and req.song_b_path %}
|
|
<p><strong>Your preview link:</strong></p>
|
|
<a class="link-button" href="{{ url_for('play', token=req.player_token) }}" target="_blank" rel="noopener noreferrer">🎧 Listen & Pick Your Version</a>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p>No requests found for that email address. Make sure you used the same email you gave us at the booth.</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<a class="back" href="{{ url_for('request_form') }}">← Back to the request form</a>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|