124-webapp/templates/result.html
2025-09-11 16:01:32 +02:00

74 lines
2.2 KiB
HTML

<!-- templates/result.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Print Cost Result</title>
<link rel="stylesheet" href="/static/css/style.css">
<style>
body { font-family: sans-serif; margin: 2em; }
table { border-collapse: collapse; width: 100%; margin-top: 1em; }
th, td { border: 1px solid #ccc; padding: 0.5em; text-align: center; }
th { background-color: #f2f2f2; }
.color { background-color: #ffdede; }
.black { background-color: #e0e0ff; }
.totals { font-weight: bold; }
.container { max-width: 900px; margin: auto; }
h1, h2 { text-align: center; }
</style>
</head>
<body>
<div class="container">
<h1>Print Cost for {{ result.filename }}</h1>
<table>
<thead>
<tr>
<th>Page</th>
<th>Width (m)</th>
<th>Height (m)</th>
<th>Area (m²)</th>
<th>Ink %</th>
<th>Type</th>
<th>Cost (€)</th>
</tr>
</thead>
<tbody>
{% for page in result.pages %}
<tr class="{{ 'color' if page.is_color else 'black' }}">
<td>{{ page.page }}</td>
<td>{{ "%.3f"|format(page.width_m) }}</td>
<td>{{ "%.3f"|format(page.height_m) }}</td>
<td>{{ "%.4f"|format(page.area_m2) }}</td>
<td>{{ "%.1f"|format(page.ink_pct) if page.ink_pct is not none else '-' }}</td>
<td>{{ 'Color' if page.is_color else 'B&W' }}</td>
<td>{{ "%.2f"|format(page.cost) }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr class="totals">
<td colspan="3">Total Black Pages</td>
<td>{{ "%.4f"|format(result.total_area_black) }}</td>
<td colspan="2"></td>
<td>{{ "%.2f"|format(result.total_cost_black) }}</td>
</tr>
<tr class="totals">
<td colspan="3">Total Color Pages</td>
<td>{{ "%.4f"|format(result.total_area_color) }}</td>
<td colspan="2"></td>
<td>{{ "%.2f"|format(result.total_cost_color) }}</td>
</tr>
<tr class="totals">
<td colspan="6">Grand Total</td>
<td>{{ "%.2f"|format(result.grand_total) }}</td>
</tr>
</tfoot>
</table>
<p style="text-align:center; margin-top:2em;">
<a href="/">Upload another PDF</a>
</p>
</div>
</body>
</html>