Files
MeteoRedisMongoTest/templates/forecast.html
2025-07-17 12:21:03 +02:00

70 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Prognoza pogody - {{ city }}</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #eef2f3;
color: #333;
margin: 20px;
}
h1 {
color: #2a6ebb;
}
.error {
color: red;
font-weight: bold;
}
table {
border-collapse: collapse;
width: 60%;
margin-top: 20px;
}
th, td {
border: 1px solid #aaa;
padding: 8px 12px;
text-align: center;
}
th {
background-color: #2a6ebb;
color: #fff;
}
tr:nth-child(even) {
background-color: #d9e1ec;
}
</style>
</head>
<body>
<h1>Prognoza pogody dla {{ city }}</h1>
{% if error %}
<p class="error">{{ error }}</p>
{% elif forecast and forecast.time %}
<table>
<thead>
<tr>
<th>Data</th>
<th>Temperatura maks. (°C)</th>
<th>Temperatura min. (°C)</th>
<th>Opady (mm)</th>
</tr>
</thead>
<tbody>
{% for i in range(forecast.time|length) %}
<tr>
<td>{{ forecast.time[i] }}</td>
<td>{{ forecast.temperature_2m_max[i] }}</td>
<td>{{ forecast.temperature_2m_min[i] }}</td>
<td>{{ forecast.precipitation_sum[i] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Brak danych pogodowych.</p>
{% endif %}
</body>
</html>