Mercurial > personal > weather-server
annotate weather_server/templates/location.html @ 36:e5a03d63b3d9 default tip
Truncate, don’t round, temperatures displayed in HTML.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Fri, 02 Jul 2021 20:38:11 -0400 |
parents | 27217790dc04 |
children |
rev | line source |
---|---|
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
1 <!doctype html> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
2 <html> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
3 <head> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
4 <title>{{ location.name }}</title> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
5 <meta name="viewport" content="width=device-width, initial-scale=1"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
6 <link |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
7 rel="stylesheet" |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
8 href="{{ url_for('static', filename='style.css') }}"> |
20 | 9 <link |
10 rel="shortcut icon" | |
11 href="{{ url_for('static', filename='thermometer.png') }}"> | |
29 | 12 <link rel="manifest" href="/static/manifest.webmanifest"> |
13 </head> | |
26
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
23
diff
changeset
|
14 <body class="location plain"> |
7def5611895b
Add support for an index page displaying all locations.
Paul Fisher <paul@pfish.zone>
parents:
23
diff
changeset
|
15 <h1><span><a href="{{ url_for('home') }}">Weather</a>: {{ location.name }}</span></h1> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
16 {% if last_reading %} |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
17 <p class="important" id="temp"> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
18 <span class="key">Temperature</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
19 <span class="value"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
20 <span class="pad"> </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
21 <span class="n"> |
36
e5a03d63b3d9
Truncate, don’t round, temperatures displayed in HTML.
Paul Fisher <paul@pfish.zone>
parents:
29
diff
changeset
|
22 {{- last_reading.temp_f|int -}} |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
23 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
24 <span class="unit">°F</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
25 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
26 </p> |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
27 <p class="important" id="dewpoint"> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
28 <span class="key">Dew point</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
29 <span class="value"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
30 <span class="pad"> </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
31 <span class="n"> |
36
e5a03d63b3d9
Truncate, don’t round, temperatures displayed in HTML.
Paul Fisher <paul@pfish.zone>
parents:
29
diff
changeset
|
32 {{- last_reading.dew_point_f|int -}} |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
33 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
34 <span class="unit">°F</span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
35 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
36 </p> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
37 <p id="timestamp"> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
38 <span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
39 <span class="key">Reported</span> |
23
88249e451566
server: show date when last report was >12h ago.
Paul Fisher <paul@pfish.zone>
parents:
20
diff
changeset
|
40 <span class="value"> |
88249e451566
server: show date when last report was >12h ago.
Paul Fisher <paul@pfish.zone>
parents:
20
diff
changeset
|
41 {{- "{date:{fmt}}".format(date=date, fmt=date_format) -}} |
88249e451566
server: show date when last report was >12h ago.
Paul Fisher <paul@pfish.zone>
parents:
20
diff
changeset
|
42 </span> |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
43 </span> |
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
44 </p> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
45 {% else %} |
8
d54155a199d8
Improve template; add stylesheet.
Paul Fisher <paul@pfish.zone>
parents:
2
diff
changeset
|
46 <p id="big-question-mark">?</p> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
47 {% endif %} |
19
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
48 <script src="{{ url_for('static', filename='amd/mad.js') }}"></script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
49 <script>new MADRegistry().install(self);</script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
50 <script src="{{ url_for('static', filename='graph.js') }}"></script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
51 <script> |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
52 require('graph').setUp( |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
53 document.body, |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
54 document.getElementById('temp'), |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
55 document.getElementById('dewpoint')); |
47987502bf4c
Add graph, make it public, and bump the version.
Paul Fisher <paul@pfish.zone>
parents:
18
diff
changeset
|
56 </script> |
1
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
57 </body> |
f66df122f18d
get the skeleton of a webserver up?
Paul Fisher <paul@pfish.zone>
parents:
diff
changeset
|
58 </html> |