use strftime js library
[chrisu/seepark.git] / web / templates / seepark_web.html
1 <!DOCTYPE html>
2 <html lang="de">
3         <head>
4                 <!-- mobile first, yeah -->
5                 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
7                 <!-- don't cache; refresh -->
8                 <meta http-equiv="Pragma" content="no-cache" />
9                 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
10                 <meta http-equiv="Expires" content="0" />
11                 <meta http-equiv="Refresh" content="300" />
12
13                 <!-- Load c3.css -->
14                 <link href="{{url_for('static', filename='c3.min.css')}}" rel="stylesheet">
15
16                 <!-- Load own css -->
17                 <link href="{{url_for('static', filename='seepark_web.css')}}" rel="stylesheet">
18
19                 <!-- Load d3.js and c3.js, and strftime.js -->
20                 <script src="{{url_for('static', filename='d3.min.js')}}" charset="utf-8"></script>
21                 <script src="{{url_for('static', filename='c3.min.js')}}"></script>
22                 <script src="{{url_for('static', filename='strftime-min.js')}}"></script>
23
24                 <title>Seepark Obsteig</title>
25         </head>
26         <body>
27                 <h1>Daten zum Seepark Obsteig</h1>
28                 <h2>Aktuelle Werte</h2>
29                 <div id="current">
30                 <p id="currentair">
31                         {% if airvalue is none %}
32                         <strong>Luft: N/A</strong>
33                         {% else %}
34                         <strong>Luft: {{ airvalue|round(1) }}°C</strong><br />
35                         <small>({{ airtime.strftime('%Y-%m-%d %H:%M') }})</small>
36                         {% endif %}
37                 </p>
38                 <p id="currentwater">
39                         <strong>Wasser: {{ watervalue|round(1) }}°C</strong><br />
40                         <small>({{ watertime.strftime('%Y-%m-%d %H:%M') }})</small>
41                 </p>
42                 </div>
43
44                 <h2>Der See</h2>
45                 <div id="chart_water_1"></div>
46                 <div id="chart_water_7"></div>
47                 <div id="chart_water_31"></div>
48                 <div id="chart_water_365"></div>
49
50                 <h2>Die Luft</h2>
51                 <div id="chart_air_1"></div>
52                 <div id="chart_air_7"></div>
53                 <div id="chart_air_31"></div>
54                 <div id="chart_air_365"></div>
55
56                 <!-- openweathermap widget -->
57                 <div id="openweathermap-widget-15"></div>
58                 <script>
59                 window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];
60                 window.myWidgetParam.push({
61                         id: 15,
62                         cityid: '3319578',
63                         appid: '{{ apikey }}',
64                         units: 'metric',
65                         containerid: 'openweathermap-widget-15',
66                         lang: 'de',
67                 });
68                 (function() {
69                         var script = document.createElement('script');
70                         script.async = true;
71                         script.charset = "utf-8";
72                         script.src = "//openweathermap.org/themes/openweathermap/assets/vendor/owm/js/weather-widget-generator.js";
73                         var s = document.getElementsByTagName('script')[0];
74                         s.parentNode.insertBefore(script, s);
75                 })();
76                 </script>
77
78                 <hr />
79                 <p><small><a href="https://git.toastfreeware.priv.at/chrisu/seepark.git">Source code</a></small></p>
80                 
81                 <!-- Load own javascript code -->
82                 <script src="{{url_for('static', filename='seepark_web.js')}}"></script>
83
84         </body>
85 </html>