diff --git a/app.py b/app.py index a97301c..277baf7 100644 --- a/app.py +++ b/app.py @@ -485,6 +485,8 @@ def generate_user_data(user, workouts=[]): 'calendar_month': generate_calendar_monthly_view(workouts, datetime.now().date()), 'attributes': [('workout_count', 'Workout count'), ('duration_seconds', 'Duration (sec)'), ('duration_minutes', 'Duration (min)'), ('average_rpm', 'Average RPM'), ('max_rpm', 'Max RPM'), ('average_bpm', 'Average BPM'), ('max_bpm', 'Max BPM'), ('distance', 'Distance'), ('calories', 'Calories')], 'periods': [('day', 'Day'), ('week', 'Week'), ('month', 'Month')], + # (period: str, attributes: [str]) + 'graphs': [('month', ['duration_minutes']), ('week', ['average_rpm', 'average_bpm']), ('week', ['workout_count'])], 'first_workout_date': workouts[-1]['start_time_date'] if workouts else None, 'last_workout_date': workouts[0]['start_time_date'] if workouts else None, } @@ -636,8 +638,7 @@ def generate_calendar_monthly_view(workouts, selected_date): start_date, end_date = get_month_bounds(selected_date) # Build a lookup dictionary for faster access - workout_lookup = {w['start_time_date'] - : w for w in workouts if start_date <= w['start_time_date'] <= end_date} + workout_lookup = {w['start_time_date'] : w for w in workouts if start_date <= w['start_time_date'] <= end_date} current_date = datetime.now().date() days_of_month = [ diff --git a/templates/partials/user_workouts_graphs.html b/templates/partials/user_workouts_graphs.html index c9f21fd..4d4b1c5 100644 --- a/templates/partials/user_workouts_graphs.html +++ b/templates/partials/user_workouts_graphs.html @@ -89,10 +89,8 @@