comparison weather_server/templates/index.html @ 26:7def5611895b

Add support for an index page displaying all locations. This seems as good a time as any to declare 0.1.0.
author Paul Fisher <paul@pfish.zone>
date Sun, 10 Nov 2019 23:46:51 -0500
parents
children 99b0759386b1
comparison
equal deleted inserted replaced
25:a4147ecb18b3 26:7def5611895b
1 <!doctype html>
2 <html>
3 <head>
4 <title>The Weather In Places</title>
5 <link
6 rel="stylesheet"
7 href="{{ url_for('static', filename='style.css') }}">
8 <link
9 rel="shortcut icon"
10 href="{{ url_for('static', filename='thermometer.png') }}">
11 </head>
12 <body class="home">
13 <h1><span>Weather</span></h1>
14 <ul>
15 {% for location in locations %}
16 <li>
17 <a href="{{ url_for('show', location=location.key) }}">
18 <b>{{ location.name }}</b>
19 <span>
20 {%- set reading = location.latest() -%}
21 {%- if reading -%}
22 {{ reading.temp_f|round|int -}}
23 &nbsp;°F
24 {%- else -%}
25 ???
26 {%- endif -%}
27 </span>
28 </a>
29 </li>
30 {% endfor %}
31 </ul>
32 </body>
33 </html>