document-processor/app/templates/line_items/summary.html

64 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block title %}Line Item Summary{% endblock %}
{% block content %}
<div class="page-header">
<h1 class="page-title">Line Item Summary</h1>
<p class="page-subtitle">Aggregate prices and ratings across extracted line items</p>
</div>
<div class="card">
<form method="get" action="/line-items/summary">
<div class="form-grid">
<div class="form-field">
<label for="q">Item contains</label>
<input id="q" name="q" value="{{ q }}" placeholder="margarita">
</div>
</div>
<div class="button-row" style="margin-top: 1rem;">
<button class="primary" type="submit">Search</button>
<a class="button-link" href="/line-items/summary">Clear</a>
<a class="button-link" href="/line-items/?q={{ q }}">Detailed view</a>
</div>
</form>
</div>
<div class="card">
<h2 class="card-title">Summary Results</h2>
{% if rows %}
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Item</th>
<th>Count</th>
<th>Avg Price</th>
<th>Min Price</th>
<th>Max Price</th>
<th>Rated Count</th>
<th>Avg Rating</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
<td>{{ row.item }}</td>
<td>{{ row.count }}</td>
<td>{{ row.avg_price }}</td>
<td>{{ row.min_price }}</td>
<td>{{ row.max_price }}</td>
<td>{{ row.rated_count }}</td>
<td>{{ row.avg_rating }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="empty-state">No summary rows found for the current search.</p>
{% endif %}
</div>
{% endblock %}