diff --git a/rowers/templates/workoutstats.html b/rowers/templates/workoutstats.html index ac867eff..e89d3a79 100644 --- a/rowers/templates/workoutstats.html +++ b/rowers/templates/workoutstats.html @@ -1,52 +1,22 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} {% block title %}Workout Statistics{% endblock %} -{% block content %} -
-

Workout Statistics for {{ workout.name }}

-

- This page lists a bunch of statistics for - your workout. The mean is of a metric is the mean with equal weight for - each stroke. The time weighted mean takes into account the stroke - duration. -

-
+{% block main %} +

Workout Statistics for {{ workout.name }}

+
    +
  • - Edit Workout + This page lists a bunch of statistics for + your workout. The mean is of a metric is the mean with equal weight for + each stroke. The time weighted mean takes into account the stroke + duration.

    -
-
-

- Workflow View -

- -
-
-

- Advanced -

-
-
-
- {% csrf_token %} - {% if workstrokesonly == True %} - - - {% else %} - - - {% endif %} -
- If your data source allows, this will show or hide strokes taken during rest intervals. -
-
- -
+ {% if otherstats %} -
+
  • Workout Metrics

    @@ -66,94 +36,134 @@ {% endfor %}
    -
  • -
    + +
  • rPower: Equivalent steady state power for the duration of the workout.

    Heart Rate Drift: Comparing heart rate normalized for average power for the first and second half of the workout

    TRIMP: TRaining IMPact. A way to combine duration and heart rate into a single number.

    rScore: Score based on rPower and workout duration to estimate training effect

    rScore (HR): Score based on heart rate, designed to give values comparable to rScore. Used instead of rScore for workouts without power data.

    -
  • - + {% endif %} -
    +
  • +
    +
    + {% csrf_token %} + {% if workstrokesonly == True %} + + + {% else %} + + + {% endif %} +
    + If your data source allows, this will show or hide strokes taken during rest intervals. +
    +
  • -
    - {% if stats %} -

    Statistics

    - - - - - - - - - - - - - - - - {% for key, value in stats.items %} - - - - - - - - - - - - {% endfor %} - -
    MetricMeanTime Weighted MeanMinimum25%Median75%MaximumStandard Deviation
    {{ value.verbosename }}{{ value.mean|floatformat:-2 }} {{ value.wmean|floatformat:-2 }}{{ value.min|floatformat:-2 }}{{ value.firstq|floatformat:-2 }}{{ value.median|floatformat:-2 }}{{ value.thirdq|floatformat:-2 }}{{ value.max|floatformat:-2 }}{{ value.std|floatformat:-2 }}
    - {% endif %} -
    - -
    - {% if cordict %} -

    Correlation matrix

    -

    This matrix indicates a positive (+) or negative (-) correlation between two parameters. The Spearman correlation coefficient has values between +1 and -1. Positive correlation between two metrics means that if one metric increases, the other value is also likely to increase. Negative is the opposite. The further from zero, the higher the likelyhood. -

    - - - - - {% for key,value in cordict.items %} - - {% endfor %} - - - - {% for key, thedict in cordict.items %} - - - {% for key2,value in thedict.items %} - - {% endfor %} - - {% endfor %} - -
     
    {{ key }}
    {{ key }} - {% if value > 0.5 %} -
    {{ value|floatformat:-1 }}
    - {% elif value > 0.1 %} -
    {{ value|floatformat:-1 }}
    - {% elif value < -0.5 %} -
    {{ value|floatformat:-1 }}
    - {% elif value < -0.1 %} -
    {{ value|floatformat:-1 }}
    - {% else %} -   - {% endif %} -
    + {% if stats %} +
  • +

    Statistics

    + + + + + + + + + + + + + + + + {% for key, value in stats.items %} + + {% if value.std > 2 %} + + + + + + + + + + {% elif value.std > 1 %} + + + + + + + + + + {% else %} + + + + + + + + + + {% endif %} + + {% endfor %} + +
    MetricMeanTime Weighted MeanMinimum25%Median75%MaximumStandard Deviation
    {{ value.verbosename }}{{ value.mean|floatformat:0 }} {{ value.wmean|floatformat:0 }}{{ value.min|floatformat:0 }}{{ value.firstq|floatformat:0 }}{{ value.median|floatformat:0 }}{{ value.thirdq|floatformat:0 }}{{ value.max|floatformat:0 }}{{ value.std|floatformat:0 }}{{ value.verbosename }}{{ value.mean|floatformat:-1 }} {{ value.wmean|floatformat:-1 }}{{ value.min|floatformat:-1 }}{{ value.firstq|floatformat:-1 }}{{ value.median|floatformat:-1 }}{{ value.thirdq|floatformat:-1 }}{{ value.max|floatformat:-1 }}{{ value.std|floatformat:-1 }}{{ value.verbosename }}{{ value.mean|floatformat:-2 }} {{ value.wmean|floatformat:-2 }}{{ value.min|floatformat:-2 }}{{ value.firstq|floatformat:-2 }}{{ value.median|floatformat:-2 }}{{ value.thirdq|floatformat:-2 }}{{ value.max|floatformat:-2 }}{{ value.std|floatformat:-2 }}
    +
  • {% endif %} -
    + + {% if cordict %} +
  • +

    Correlation matrix

    +

    This matrix indicates a positive (+) or negative (-) correlation between two parameters. The Spearman correlation coefficient has values between +1 and -1. Positive correlation between two metrics means that if one metric increases, the other value is also likely to increase. Negative is the opposite. The further from zero, the higher the likelyhood. +

    + + + + + {% for key,value in cordict.items %} + + {% endfor %} + + + + {% for key, thedict in cordict.items %} + + + {% for key2,value in thedict.items %} + + {% endfor %} + + {% endfor %} + +
     
    {{ key }}
    {{ key }} + {% if value > 0.5 %} +
    {{ value|floatformat:-1 }}
    + {% elif value > 0.1 %} +
    {{ value|floatformat:-1 }}
    + {% elif value < -0.5 %} +
    {{ value|floatformat:-1 }}
    + {% elif value < -0.1 %} +
    {{ value|floatformat:-1 }}
    + {% else %} +   + {% endif %} +
    +
  • + {% endif %} + {% endblock %} + +{% block sidebar %} +{% include 'menu_workout.html' %} +{% endblock %} diff --git a/rowers/views.py b/rowers/views.py index 4c3f69c2..156702e1 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -7706,6 +7706,22 @@ def workout_stats_view(request,id=0,message="",successmessage=""): r = getrower(request.user) w = get_workout(id) + breadcrumbs = [ + { + 'url':'/rowers/list-workouts', + 'name':'Workouts' + }, + { + 'url':get_workout_default_page(request,id), + 'name': str(w.id) + }, + { + 'url':reverse(workout_stats_view,kwargs={'id':id}), + 'name': 'Stats' + } + + ] + workstrokesonly = True if request.method == 'POST' and 'workstrokesonly' in request.POST: workstrokesonly = str2bool(request.POST['workstrokesonly']) @@ -7838,7 +7854,10 @@ def workout_stats_view(request,id=0,message="",successmessage=""): { 'stats':stats, 'teams':get_my_teams(request.user), - 'workout':row, + 'workout':w, + 'rower':r, + 'breadcrumbs':breadcrumbs, + 'active':'nav-workouts', 'workstrokesonly':workstrokesonly, 'cordict':cordict, 'otherstats':otherstats,