first commit
This commit is contained in:
67
templates/history_range.html
Normal file
67
templates/history_range.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Historia 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: 80%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid #aaa;
|
||||
padding: 6px 10px;
|
||||
text-align: center;
|
||||
}
|
||||
th {
|
||||
background-color: #2a6ebb;
|
||||
color: #fff;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: #d9e1ec;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Historia pogody dla {{ city }} <br> od {{ start_date }} do {{ end_date }}</h1>
|
||||
|
||||
{% if error %}
|
||||
<p class="error">{{ error }}</p>
|
||||
{% elif history %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Data</th>
|
||||
<th>Temp. maks. (°C)</th>
|
||||
<th>Temp. min. (°C)</th>
|
||||
<th>Opady (mm)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for i in range(history["time"]|length) %}
|
||||
<tr>
|
||||
<td>{{ history["time"][i] }}</td>
|
||||
<td>{{ history["temperature_2m_max"][i] }}</td>
|
||||
<td>{{ history["temperature_2m_min"][i] }}</td>
|
||||
<td>{{ history["precipitation_sum"][i] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user