Mercurial > personal > weather-server
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weather_server/templates/index.html Sun Nov 10 23:46:51 2019 -0500 @@ -0,0 +1,33 @@ +<!doctype html> +<html> + <head> + <title>The Weather In Places</title> + <link + rel="stylesheet" + href="{{ url_for('static', filename='style.css') }}"> + <link + rel="shortcut icon" + href="{{ url_for('static', filename='thermometer.png') }}"> + </head> + <body class="home"> + <h1><span>Weather</span></h1> + <ul> + {% for location in locations %} + <li> + <a href="{{ url_for('show', location=location.key) }}"> + <b>{{ location.name }}</b> + <span> + {%- set reading = location.latest() -%} + {%- if reading -%} + {{ reading.temp_f|round|int -}} + °F + {%- else -%} + ??? + {%- endif -%} + </span> + </a> + </li> + {% endfor %} + </ul> + </body> +</html>