Add link to current and previous month's report.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 26 Feb 2019 22:26:59 +0000 (23:26 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 26 Feb 2019 22:26:59 +0000 (23:26 +0100)
web/seepark_web.py
web/templates/seepark_web.html

index 471d716..c6ceffb 100644 (file)
@@ -467,6 +467,8 @@ def report(year, month):
 def index():
     airvalue, airtime     = currentairtemperature(cityid)
     watervalue, watertime = currentwatertemperature(mainsensor)
+    this_month = first_of_month(datetime.date.today(), 0)
+    last_month = first_of_month(this_month, -1)
 
     return render_template(
         'seepark_web.html',
@@ -475,4 +477,6 @@ def index():
         watertime=watertime,
         airvalue=airvalue,
         airtime=airtime,
+        this_month=this_month,
+        last_month=last_month
     )
index 8524a74..974068c 100644 (file)
@@ -75,7 +75,7 @@
                </div>
 
                <hr />
-               <p><small><a href="https://git.toastfreeware.priv.at/chrisu/seepark.git">Source code</a>, <a href="{{url_for('static', filename='doc/index.html')}}">API documentation</a></small></p>
+               <p><small><a href="https://git.toastfreeware.priv.at/chrisu/seepark.git">Source code</a>, <a href="{{url_for('static', filename='doc/index.html')}}">API documentation</a>, Report for <a href="{{url_for('report', year=last_month.year, month=last_month.month)}}">previous month</a>/<a href="{{url_for('report', year=this_month.year, month=this_month.month)}}">current month</a></small></p>
 
                <!-- Load own javascript code -->
                <script src="{{url_for('static', filename='seepark_web.js')}}"></script>