187 lines
9.5 KiB
HTML
187 lines
9.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Review Queue</title>
|
|
<link rel="stylesheet" href="/static/app.css">
|
|
</head>
|
|
<body>
|
|
<div class="app-shell" id="app-shell">
|
|
{% include "partials/sidebar.html" %}
|
|
|
|
<main class="main">
|
|
<div class="topbar">
|
|
<div>
|
|
<h1 class="page-title">Review Queue</h1>
|
|
<p class="page-subtitle">Work through OCR review, field extraction, quality review, and recent activity.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="button-row">
|
|
{% if next_ocr %}
|
|
<a class="button-link primary" href="/documents/{{ next_ocr.document_id }}?queue=ocr">Next needing OCR review</a>
|
|
{% endif %}
|
|
{% if next_fields %}
|
|
<a class="button-link" href="/documents/{{ next_fields.document_id }}?queue=fields">Next needing field extraction</a>
|
|
{% endif %}
|
|
{% if next_quality %}
|
|
<a class="button-link" href="/queue/?tab=quality#quality-{{ next_quality.line_item_id }}">Next needing quality review</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="right-pane-tabs">
|
|
<a class="tab-button{% if active_tab == 'ocr' %} active{% endif %}" href="/queue/?tab=ocr">OCR Review</a>
|
|
<a class="tab-button{% if active_tab == 'fields' %} active{% endif %}" href="/queue/?tab=fields">Field Extraction</a>
|
|
<a class="tab-button{% if active_tab == 'quality' %} active{% endif %}" href="/queue/?tab=quality">Quality Review</a>
|
|
<a class="tab-button{% if active_tab == 'recent' %} active{% endif %}" href="/queue/?tab=recent">Recently Updated</a>
|
|
</div>
|
|
|
|
<div class="tab-panel{% if active_tab == 'ocr' %} active{% endif %}">
|
|
<h2 class="card-title">Needs OCR review ({{ needs_ocr_review|length }})</h2>
|
|
{% if needs_ocr_review %}
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Document</th><th>Type</th><th>Review status</th><th>Updated</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for doc in needs_ocr_review %}
|
|
<tr>
|
|
<td><a href="/documents/{{ doc.document_id }}?queue=ocr">{{ doc.document_id }}</a></td>
|
|
<td>{{ doc.document_type }}</td>
|
|
<td><span class="badge pending">{{ doc.review_status }}</span></td>
|
|
<td>{{ doc.updated_at }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-state">No documents currently need OCR review.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="tab-panel{% if active_tab == 'fields' %} active{% endif %}">
|
|
<h2 class="card-title">Needs field extraction ({{ needs_field_extraction|length }})</h2>
|
|
{% if needs_field_extraction %}
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Document</th><th>Type</th><th>Review status</th><th>Updated</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for doc in needs_field_extraction %}
|
|
<tr>
|
|
<td><a href="/documents/{{ doc.document_id }}?queue=fields">{{ doc.document_id }}</a></td>
|
|
<td>{{ doc.document_type }}</td>
|
|
<td><span class="badge reviewed">{{ doc.review_status }}</span></td>
|
|
<td>{{ doc.updated_at }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-state">No reviewed documents are waiting on field extraction.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="tab-panel{% if active_tab == 'quality' %} active{% endif %}">
|
|
<h2 class="card-title">Needs cocktail quality review ({{ needs_quality_review|length }})</h2>
|
|
{% if needs_quality_review %}
|
|
{% for row in needs_quality_review %}
|
|
<div class="card" id="quality-{{ row.line_item_id }}" style="margin-bottom: 1rem;">
|
|
<div class="topbar" style="margin-bottom: 0.75rem;">
|
|
<div>
|
|
<div class="page-subtitle">{{ row.transaction_date }} · {{ row.merchant }}</div>
|
|
<h3 class="card-title" style="margin: 0.2rem 0 0 0;">{{ row.description }}</h3>
|
|
<div class="page-subtitle">{{ row.raw_description }}</div>
|
|
</div>
|
|
<div class="badges">
|
|
{% if row.category %}
|
|
<span class="badge">{{ row.category }}</span>
|
|
{% endif %}
|
|
{% if row.line_total %}
|
|
<span class="badge">${{ row.line_total }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<form method="post" action="/line-items/{{ row.line_item_id }}/review">
|
|
<input type="hidden" name="return_to" value="quality_queue">
|
|
|
|
<div class="form-grid">
|
|
<div class="form-field">
|
|
<label for="quality_rating_{{ row.line_item_id }}">Quality rating</label>
|
|
<input id="quality_rating_{{ row.line_item_id }}" type="text" name="quality_rating" value="{{ row.quality_rating }}" placeholder="e.g. 8">
|
|
</div>
|
|
<div class="form-field full">
|
|
<label for="quality_note_{{ row.line_item_id }}">Quality note</label>
|
|
<textarea id="quality_note_{{ row.line_item_id }}" name="quality_note" rows="3" placeholder="Taste, sweetness, strength, food notes...">{{ row.quality_note }}</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="button-row" style="margin-top: 1rem;">
|
|
<button class="primary" type="submit" name="quality_status" value="rated">Save rating</button>
|
|
<button type="submit" name="quality_status" value="na">Mark N/A</button>
|
|
<a class="button-link" href="/documents/{{ row.document_id }}?tab=extracted-fields">Open document</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p class="empty-state">No cocktail line items are waiting for quality review.</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="tab-panel{% if active_tab == 'recent' %} active{% endif %}">
|
|
<h2 class="card-title">Recently updated</h2>
|
|
{% if recently_updated %}
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead>
|
|
<tr><th>Document</th><th>Type</th><th>Review status</th><th>Current path</th><th>Updated</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for doc in recently_updated %}
|
|
<tr>
|
|
<td><a href="/documents/{{ doc.document_id }}?queue=recent">{{ doc.document_id }}</a></td>
|
|
<td>{{ doc.document_type }}</td>
|
|
<td><span class="badge {% if doc.review_status == 'reviewed' %}reviewed{% else %}pending{% endif %}">{{ doc.review_status }}</span></td>
|
|
<td>{{ doc.current_path }}</td>
|
|
<td>{{ doc.updated_at }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<p class="empty-state">No recent documents found.</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script>
|
|
(function () {
|
|
const appShell = document.getElementById("app-shell");
|
|
const menuToggle = document.getElementById("menu-toggle");
|
|
if (!appShell || !menuToggle) return;
|
|
menuToggle.addEventListener("click", function () {
|
|
appShell.classList.toggle("nav-open");
|
|
});
|
|
menuToggle.addEventListener("keydown", function (e) {
|
|
if (e.key === "Enter" || e.key === " ") {
|
|
e.preventDefault();
|
|
appShell.classList.toggle("nav-open");
|
|
}
|
|
});
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|