Mercurial > personal > weather-server
annotate 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 |
rev | line source |
---|---|
26
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
1 <!doctype html> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
2 <html> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
3 <head> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
4 <title>The Weather In Places</title> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
5 <link |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
6 rel="stylesheet" |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
7 href="{{ url_for('static', filename='style.css') }}"> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
8 <link |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
9 rel="shortcut icon" |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
10 href="{{ url_for('static', filename='thermometer.png') }}"> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
11 </head> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
12 <body class="home"> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
13 <h1><span>Weather</span></h1> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
14 <ul> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
15 {% for location in locations %} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
16 <li> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
17 <a href="{{ url_for('show', location=location.key) }}"> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
18 <b>{{ location.name }}</b> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
19 <span> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
20 {%- set reading = location.latest() -%} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
21 {%- if reading -%} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
22 {{ reading.temp_f|round|int -}} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
23 °F |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
24 {%- else -%} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
25 ??? |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
26 {%- endif -%} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
27 </span> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
28 </a> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
29 </li> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
30 {% endfor %} |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
31 </ul> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
32 </body> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
33 </html> |