view weather_server/templates/location.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 88249e451566
children 27217790dc04
line wrap: on
line source

<!doctype html>
<html>
    <head>
        <title>{{ location.name }}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link
            rel="stylesheet"
            href="{{ url_for('static', filename='style.css') }}">
        <link
            rel="shortcut icon"
            href="{{ url_for('static', filename='thermometer.png') }}">
    </head>
    <body class="location plain">
        <h1><span><a href="{{ url_for('home') }}">Weather</a>: {{ location.name }}</span></h1>
        {% if last_reading %}
            <p class="important" id="temp">
                <span class="key">Temperature</span>
                <span class="value">
                    <span class="pad"> </span>
                    <span class="n">
                        {{- last_reading.temp_f|round|int -}}
                    </span>
                    <span class="unit">&deg;F</span>
                </span>
            </p>
            <p class="important" id="dewpoint">
                <span class="key">Dew point</span>
                <span class="value">
                    <span class="pad"> </span>
                    <span class="n">
                        {{- last_reading.dew_point_f|round|int -}}
                    </span>
                    <span class="unit">&deg;F</span>
                </span>
            </p>
            <p id="timestamp">
                <span>
                    <span class="key">Reported</span>
                    <span class="value">
                        {{- "{date:{fmt}}".format(date=date, fmt=date_format) -}}
                    </span>
                </span>
            </p>
        {% else %}
            <p id="big-question-mark">?</p>
        {% endif %}
        <script src="{{ url_for('static', filename='amd/mad.js') }}"></script>
        <script>new MADRegistry().install(self);</script>
        <script src="{{ url_for('static', filename='graph.js') }}"></script>
        <script>
            require('graph').setUp(
                document.body,
                document.getElementById('temp'),
                document.getElementById('dewpoint'));
        </script>
    </body>
</html>