diff --git a/dmapp/dmweb/dm.py b/dmapp/dmweb/dm.py index c592e19..a9a614b 100644 --- a/dmapp/dmweb/dm.py +++ b/dmapp/dmweb/dm.py @@ -35,7 +35,7 @@ def index(task=None): print(rows) - return render_template("main.html", rows=rows, current_task_path=current_task_path, current_task_time=current_task_time) + return render_template("main.html", rows=rows, current_task_path=current_task_path, current_task_time=current_task_time, auto_refresh=True) @dmbp.route("/day//") @@ -57,7 +57,7 @@ def oneday( rows = get_period_totals(start, end) - return render_template("pages.html", rows=rows) + return render_template("pages.html", rows=rows, auto_refresh=True) @dmbp.route("/period//") @@ -72,7 +72,7 @@ def period(start, end): rows = get_period_totals(start, end) - return render_template("pages.html", rows=rows) + return render_template("pages.html", rows=rows, auto_refresh=True) @dmbp.route("/work") @@ -86,7 +86,7 @@ def work(): rows = get_work_period_totals(start, end) print(rows) - return render_template("main.html", rows=rows) + return render_template("main.html", rows=rows, auto_refresh=False) @dmbp.route("/totals") @@ -104,4 +104,4 @@ def totals(task=None): rows = get_period_totals(start, end) - return render_template("pages.html", rows=rows) + return render_template("pages.html", rows=rows, auto_refresh=True) diff --git a/dmapp/dmweb/dmcal.py b/dmapp/dmweb/dmcal.py index bbc0654..cb38cf5 100644 --- a/dmapp/dmweb/dmcal.py +++ b/dmapp/dmweb/dmcal.py @@ -148,7 +148,7 @@ def workmonth(month=None, year=None): cal.setcalmonth(usemonth) cal.setcalyear(useyear) - return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth)) + return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth), auto_refresh=False) @dmbp.route("/month") @@ -174,4 +174,4 @@ def month(month=None, year=None, task=None): cal.setcalmonth(usemonth) cal.setcalyear(useyear) - return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth)) + return render_template("calendar.html", content=cal.formatmonth(useyear, usemonth), auto_refresh=True) diff --git a/dmapp/dmweb/templates/layout.html b/dmapp/dmweb/templates/layout.html index 1af2ff9..cc82ec6 100644 --- a/dmapp/dmweb/templates/layout.html +++ b/dmapp/dmweb/templates/layout.html @@ -1,10 +1,14 @@ - +{% if auto_refresh %} + +{% endif %} + {% block head %} {% endblock %} diff --git a/dmapp/dmweb/templates/main.html b/dmapp/dmweb/templates/main.html index aeba2b2..4f297a3 100644 --- a/dmapp/dmweb/templates/main.html +++ b/dmapp/dmweb/templates/main.html @@ -1,6 +1,9 @@ + {% if auto_refresh %} + + {% endif %} {% block head %} {% endblock %}