Spaces:
Running
Running
Upload folder using huggingface_hub
Browse filesFiles changed (7)
273 unmodified lines274275276277278279273 unmodified linesid uuid primary key default gen_random_uuid(),submitted_at timestamptz not null default now(),kol_email text not null, -- normalized join keyreceived_size text, received_model text, best_fit_finger text,fit_quality text, hand text, photo_url text, notes text);273 unmodified lines274275276277278279280281282283273 unmodified linesid uuid primary key default gen_random_uuid(),submitted_at timestamptz not null default now(),kol_email text not null, -- normalized join keykol_name text, -- also captured: legacy KOLs measured-- pre-email-switch have kol_name (not-- kol_email) on their measurements row,-- so name lets their feedback join backreceived_size text, received_model text, best_fit_finger text,fit_quality text, hand text, photo_url text, notes text);
273 unmodified lines274275276277278279273 unmodified linesid uuid primary key default gen_random_uuid(),submitted_at timestamptz not null default now(),kol_email text not null, -- normalized join keyreceived_size text, received_model text, best_fit_finger text,fit_quality text, hand text, photo_url text, notes text);273 unmodified lines274275276277278279280281282283273 unmodified linesid uuid primary key default gen_random_uuid(),submitted_at timestamptz not null default now(),kol_email text not null, -- normalized join keykol_name text, -- also captured: legacy KOLs measured-- pre-email-switch have kol_name (not-- kol_email) on their measurements row,-- so name lets their feedback join backreceived_size text, received_model text, best_fit_finger text,fit_quality text, hand text, photo_url text, notes text);
650 unmodified lines65165265365465565618 unmodified lines675676677678679680650 unmodified lineskol_email = (request.form.get("kol_email") or "").strip().lower()if not kol_email or "@" not in kol_email:return jsonify({"success": False, "error": "A valid email is required"}), 400def _field(name: str) -> Optional[str]:v = (request.form.get(name) or "").strip()18 unmodified linesrecord = {"kol_email": kol_email,"received_size": _field("received_size"),"received_model": _field("received_model"),"best_fit_finger": _field("best_fit_finger"),650 unmodified lines65165265365465565665765865966066166266366418 unmodified lines683684685686687688689650 unmodified lineskol_email = (request.form.get("kol_email") or "").strip().lower()if not kol_email or "@" not in kol_email:return jsonify({"success": False, "error": "A valid email is required"}), 400# Name is also required: legacy KOLs were measured under the old# name-based identity (before the email switch), so their measurements# rows have kol_name but no kol_email. Capturing the name here lets their# post-shipment feedback join back to those historical rows. See# doc/v8/PRD.md.kol_name = (request.form.get("kol_name") or "").strip()if not kol_name:return jsonify({"success": False, "error": "A name is required"}), 400def _field(name: str) -> Optional[str]:v = (request.form.get(name) or "").strip()18 unmodified linesrecord = {"kol_email": kol_email,"kol_name": kol_name,"received_size": _field("received_size"),"received_model": _field("received_model"),"best_fit_finger": _field("best_fit_finger"),
31 unmodified lines3233343536373831 unmodified lines.controls input[type="file"] {width: 100%;font-size: 1rem;color: var(--ink-soft);}/* Enlarge the native "Choose File" button — iOS Safari renders it small31 unmodified lines3233343536373839404131 unmodified lines.controls input[type="file"] {width: 100%;font-size: 1rem;/* Hide the native status text ("No file chosen" / the picked filename) —it's redundant next to the labelled button. The button keeps its owncolor (set on ::file-selector-button below), so it stays visible. */color: transparent;}/* Enlarge the native "Choose File" button — iOS Safari renders it small
33 unmodified lines3435363738394039 unmodified lines80818283848521 unmodified lines10710810911011111233 unmodified lines];// Every field that can produce a validation error, in DOM order.const FIELD_IDS = ["kolEmail", ...REQUIRED.map(([id]) => id)];// Inject an inline error slot under each validatable field and clear it// as soon as the user edits that field.39 unmodified lines// Returns [fieldId, message] for the first invalid field, or null.function firstInvalid() {if (!EMAIL_RE.test(val("kolEmail").toLowerCase())) {return ["kolEmail", "Please enter a valid email."];}21 unmodified lines}const fd = new FormData();fd.append("kol_email", val("kolEmail").toLowerCase());fd.append("received_size", val("receivedSize"));fd.append("received_model", val("receivedModel"));33 unmodified lines3435363738394039 unmodified lines80818283848586878821 unmodified lines11011111211311411511633 unmodified lines];// Every field that can produce a validation error, in DOM order.const FIELD_IDS = ["kolName", "kolEmail", ...REQUIRED.map(([id]) => id)];// Inject an inline error slot under each validatable field and clear it// as soon as the user edits that field.39 unmodified lines// Returns [fieldId, message] for the first invalid field, or null.function firstInvalid() {if (!val("kolName")) {return ["kolName", "Please enter your name."];}if (!EMAIL_RE.test(val("kolEmail").toLowerCase())) {return ["kolEmail", "Please enter a valid email."];}21 unmodified lines}const fd = new FormData();fd.append("kol_name", val("kolName"));fd.append("kol_email", val("kolEmail").toLowerCase());fd.append("received_size", val("receivedSize"));fd.append("received_model", val("receivedModel"));
284 unmodified lines2852862872882892907 unmodified lines298299300301302303304221 unmodified lines52652752852953053114 unmodified lines54654754854955055155220 unmodified lines573574575576577578579284 unmodified lines<table><thead><tr><th>Email</th><th>Submitted</th><th>Size</th>7 unmodified lines</tr></thead><tbody id="fbTableBody"><tr><td colspan="10" class="empty">Loading...</td></tr></tbody></table></div>221 unmodified lines? `<img class="thumb" loading="lazy" src="${esc(r.photo_url)}" onclick="window.open('${esc(r.photo_url)}')" />`: "-";return `<tr data-id="${esc(r.id)}"><td><strong>${esc(r.kol_email) || "-"}</strong></td><td>${fmtDate(r.submitted_at)}</td><td>${esc(r.received_size) || "-"}</td>14 unmodified linesif (fbCurrentPage < 1) fbCurrentPage = 1;if (total === 0) {fbCountLabel.textContent = "0 feedback rows";fbTableBody.innerHTML = '<tr><td colspan="10" class="empty">No feedback yet</td></tr>';} else {const start = (fbCurrentPage - 1) * PAGE_SIZE;const slice = fbAllRows.slice(start, start + PAGE_SIZE);20 unmodified linesfbCurrentPage = 1;renderFbPage();} catch (e) {fbTableBody.innerHTML = `<tr><td colspan="10" class="empty">Error loading feedback: ${e.message}</td></tr>`;}};284 unmodified lines2852862872882892902917 unmodified lines299300301302303304305221 unmodified lines52752852953053153253314 unmodified lines54854955055155255355420 unmodified lines575576577578579580581284 unmodified lines<table><thead><tr><th>Name</th><th>Email</th><th>Submitted</th><th>Size</th>7 unmodified lines</tr></thead><tbody id="fbTableBody"><tr><td colspan="11" class="empty">Loading...</td></tr></tbody></table></div>221 unmodified lines? `<img class="thumb" loading="lazy" src="${esc(r.photo_url)}" onclick="window.open('${esc(r.photo_url)}')" />`: "-";return `<tr data-id="${esc(r.id)}"><td>${esc(r.kol_name) || "-"}</td><td><strong>${esc(r.kol_email) || "-"}</strong></td><td>${fmtDate(r.submitted_at)}</td><td>${esc(r.received_size) || "-"}</td>14 unmodified linesif (fbCurrentPage < 1) fbCurrentPage = 1;if (total === 0) {fbCountLabel.textContent = "0 feedback rows";fbTableBody.innerHTML = '<tr><td colspan="11" class="empty">No feedback yet</td></tr>';} else {const start = (fbCurrentPage - 1) * PAGE_SIZE;const slice = fbAllRows.slice(start, start + PAGE_SIZE);20 unmodified linesfbCurrentPage = 1;renderFbPage();} catch (e) {fbTableBody.innerHTML = `<tr><td colspan="11" class="empty">Error loading feedback: ${e.message}</td></tr>`;}};
21 unmodified lines22232425262721 unmodified lines<form class="panel" id="feedbackForm" novalidate><div class="controls"><label><span>Email</span><input21 unmodified lines222324252627282930313233343536373821 unmodified lines<form class="panel" id="feedbackForm" novalidate><div class="controls"><label><span>Name</span><inputtype="text"id="kolName"placeholder="Your name"autocomplete="name"required/></label><label><span>Email</span><input
AGENTS.md+4
CLAUDE.md+4
web_demo/app.py+9
web_demo/static/feedback/feedback.css+4-1
web_demo/static/feedback/feedback.js+5-1
web_demo/templates/admin.html+5-3
web_demo/templates/feedback.html+11