]> ToastFreeware Gitweb - chrisu/seepark.git/commitdiff
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 471d716e33aab759599ead8d89427b7adbfd8863..c6ceffb8614b6f049317983f6372bcc217e12048 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 8524a74ac144b42c972f523ccbbe3d20e63495fd..974068ca45828bd9ac47ea517a2cd06cccab7778 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>