|
|
@@ -8,13 +8,36 @@ from flask import render_template, request
|
|
|
from flask_login import login_required
|
|
|
from jinja2 import TemplateNotFound
|
|
|
|
|
|
+from apps.home.modules.utils import *
|
|
|
+from apps.home.modules.mountainbikel import *
|
|
|
|
|
|
@blueprint.route('/index')
|
|
|
-@login_required
|
|
|
+#@login_required
|
|
|
def index():
|
|
|
-
|
|
|
- return render_template('home/index.html', segment='index')
|
|
|
-
|
|
|
+ # return render_template('home/index.html', segment='index')
|
|
|
+ if is_running_in_docker():
|
|
|
+ sys.stderr.write("Running in a Docker container\n")
|
|
|
+ csv_file = '/root/HealthData/garmin_bike.csv'
|
|
|
+ else:
|
|
|
+ sys.stderr.write("NOT Running in a Docker container\n" + os.getcwd() + "\n")
|
|
|
+ csv_file = './HealthData/garmin_bike.csv'
|
|
|
+ return render_template(
|
|
|
+ 'home/mountainbikel_index.html',
|
|
|
+ segment='index',
|
|
|
+ **homepage_data(csv_file),
|
|
|
+ mosum=json.dumps(
|
|
|
+ monthly_sum_barchart_concurrent2(csv_file, 'elevationGain', 1,
|
|
|
+ 'Höhenmeter pro Monat', '(m)', 'Jahr', 'Jahr'),
|
|
|
+ cls=plotly.utils.PlotlyJSONEncoder), # ** überführt die dict-Werte in named arguments
|
|
|
+ distsum=json.dumps(
|
|
|
+ monthly_sum_barchart_concurrent2(csv_file, 'distance', 1,
|
|
|
+ 'Entfernung pro Monat', '(km)', 'Jahr', 'Jahr'),
|
|
|
+ cls=plotly.utils.PlotlyJSONEncoder), # ** überführt die dict-Werte in named arguments
|
|
|
+ timesum=json.dumps(
|
|
|
+ monthly_sum_barchart_concurrent2(csv_file, 'movingDuration', 1,
|
|
|
+ 'Stunden pro Monat', '(h)', 'Jahr', 'Jahr'),
|
|
|
+ cls=plotly.utils.PlotlyJSONEncoder), # ** überführt die dict-Werte in named arguments
|
|
|
+ )
|
|
|
|
|
|
@blueprint.route('/<template>')
|
|
|
@login_required
|