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

81 lines
1.8 KiB
HTML

<!-- templates/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Print Cost Calculator</title>
<link rel="stylesheet" href="/static/css/style.css">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f9f9f9;
color: #333;
margin: 0;
padding: 0;
}
.container {
max-width: 700px;
margin: 3em auto;
background: #fff;
padding: 2em;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
border-radius: 10px;
}
h1 {
text-align: center;
color: #444;
}
form {
display: flex;
flex-direction: column;
gap: 1em;
margin-top: 1em;
}
input[type="file"] {
padding: 0.5em;
}
button {
padding: 0.7em;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 6px;
font-size: 1em;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.rate-info {
text-align: center;
color: #555;
margin-top: 1em;
}
.error {
color: red;
font-weight: bold;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Print Cost Calculator</h1>
{% if error %}
<p class="error">{{ error }}</p>
{% endif %}
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="file" accept="application/pdf" required />
<button type="submit">Upload & Calculate</button>
</form>
<p class="rate-info">
Rates are fixed via environment variables:<br>
B&W: {{ rate_black if rate_black else 'RATE_PER_M2_BLACK' }} € / m²,
Color: {{ rate_color if rate_color else 'RATE_PER_M2_COLOR' }} € / m²
</p>
</div>
</body>
</html>