diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 3bd2fb0e..d16e0c20 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -749,9 +749,10 @@ def fitnessmetric_chart(fitnessmetrics,user,workoutmode='rower'): ) plot.xaxis.major_label_orientation = pi/4 + plot.sizing_mode = 'scale_width' plot.y_range = Range1d(0,1.5*max(power4min)) - plot.title.text = 'Power levels from workouts '+user.first_name + plot.title.text = 'Power levels ('+workoutmode+') from workouts '+user.first_name hover = plot.select(dict(type=HoverTool)) @@ -1579,6 +1580,7 @@ def interactive_otwcpchart(powerdf,promember=0,rowername=""): # add watermark plot.extra_y_ranges = {"watermark": watermarkrange} + plot.sizing_mode = 'scale_width' plot.image_url([watermarkurl],1.8*max(thesecs),watermarky, watermarkw,watermarkh, @@ -1867,6 +1869,7 @@ def interactive_cpchart(rower,thedistances,thesecs,theavpower, # add watermark plot.extra_y_ranges = {"watermark": watermarkrange} + plot.sizing_mode = 'scale_width' plot.image_url([watermarkurl],1.8*max(thesecs),watermarky, watermarkw,watermarkh, diff --git a/rowers/templates/fitnessmetric.html b/rowers/templates/fitnessmetric.html index cba71c9b..fd8d5d03 100644 --- a/rowers/templates/fitnessmetric.html +++ b/rowers/templates/fitnessmetric.html @@ -1,10 +1,10 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} {% block title %}Rowsandall Fitness Progress {% endblock %} -{% block content %} +{% block main %} - +{% if rower.user %} +

{{ rower.user.first_name }} Power Estimates

+{% else %} +

{{ user.first_name }} Power Estimates

+{% endif %} + -
-
-
+
    +
  • + {{ the_div|safe }} +
  • +
  • + {{ form.as_table }}
    {% csrf_token %} -
    - -
    +
  • -
-
- {% if therower.user %} -

{{ therower.user.first_name }} Power Estimates

- {% else %} -

{{ user.first_name }} Power Estimates

- {% endif %} -
-
- {% if user.is_authenticated and user|is_manager %} - - {% endif %} -
- - -
-
- - {{ the_div|safe }} - -
+ + + + +{% endblock %} + +{% block sidebar %} +{% include 'menu_analytics.html' %} {% endblock %} diff --git a/rowers/templates/otwrankings.html b/rowers/templates/otwrankings.html index 140c007b..dd56f3c4 100644 --- a/rowers/templates/otwrankings.html +++ b/rowers/templates/otwrankings.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} @@ -8,175 +8,111 @@ {% block title %}Workouts{% endblock %} -{% block content %} +{% block main %} - - + + - {{ interactiveplot |safe }} - - - +{{ interactiveplot |safe }} -
-
- {% if theuser %} -

{{ theuser.first_name }}'s Ranking Pieces

- {% else %} -

{{ user.first_name }}'s Ranking Pieces

- {% endif %} -
-
- {% if user.is_authenticated and user|is_manager %} - -
+{% if theuser %} +

{{ theuser.first_name }}'s Ranking Pieces

+{% else %} +

{{ user.first_name }}'s Ranking Pieces

+{% endif %} -
-

Summary for {{ theuser.first_name }} {{ theuser.last_name }} - between {{ startdate|date }} and {{ enddate|date }}

+
-
-

Use this form to select a different date range:

-

- Select start and end date for a date range: -

+

When you change the date range, the algorithm calculates new + parameters in a background process. You may have to reload the + page to get an updated prediction.

+

At the bottom of the page, you will find predictions derived from the model.

+ +
  • +

    Use this form to select a different date range:

    +

    + Select start and end date for a date range: +

    - - - - {{ dateform.as_table }} -
    - {% csrf_token %} -
  • -
    - -
    -
    -
    - Or use the last {{ deltaform }} days. -
    -
    - {% csrf_token %} - - -
    -
    + + {{ dateform.as_table }} +
    + {% csrf_token %} + + + +
  • -
    - -

    Critical Power Plot

    - +

    Critical Power Plot

    + {{ the_div|safe }} -
    +
  • -
    +
  • -

    Ranking Piece Results

    +

    Ranking Piece Results

    - {% if rankingworkouts %} - - - + {% if rankingworkouts %} + +
    + - - - - - - - + + + + + + + - - + + {% for workout in rankingworkouts %} - - - - - - - - - - + + + + + + + + + + - {% endfor %} - -
    Distance Duration Avg Power Date Avg HR Max HR Edit Distance Duration Avg Power Date Avg HR Max HR Edit
    {{ workout.distance }} m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ avgpower|lookup:workout.id }} W {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} - {{ workout.name }}
    {{ workout.distance }} m {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ avgpower|lookup:workout.id }} W {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} + {{ workout.name }}
    - {% else %} -

    No ranking workouts found

    - {% endif %} + {% endfor %} + + + {% else %} +

    No ranking workouts found

    + {% endif %} + +
  • -
    +
  • +

    Pace predictions for Ranking Pieces

    -
    -

    Pace predictions for Ranking Pieces

    +

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    + + -

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    - - - -
    - +
    @@ -200,25 +136,24 @@
    Duration
    -
    - -
    +
  • + +
  • {{ form.value }} {{ form.pieceunit }} {% csrf_token %} -
  • -
    - minutes -
    -
    - - -
    + minutes + + + + - - +{% endblock %} + +{% block sidebar %} +{% include 'menu_analytics.html' %} {% endblock %} diff --git a/rowers/templates/rankings.html b/rowers/templates/rankings.html index 00146e88..0a533016 100644 --- a/rowers/templates/rankings.html +++ b/rowers/templates/rankings.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} @@ -11,378 +11,320 @@ {% endblock %} -{% block content %} +{% block main %} - - + + - {{ interactiveplot |safe }} - - - +{{ interactiveplot |safe }} -
    -
    - {% if theuser %} -

    {{ theuser.first_name }}'s Ranking Pieces

    - {% else %} -

    {{ user.first_name }}'s Ranking Pieces

    - {% endif %} -
    -
    - {% if user.is_authenticated and user|is_manager %} - -
    +{% if theuser %} +

    {{ theuser.first_name }}'s Ranking Pieces

    +{% else %} +

    {{ user.first_name }}'s Ranking Pieces

    +{% endif %} -
    -

    Summary for {{ theuser.first_name }} {{ theuser.last_name }} - between {{ startdate|date }} and {{ enddate|date }}

    +
    -
    -

    Use this form to select a different date range:

    -

    - Select start and end date for a date range: -

    - -
    - - - {{ dateform.as_table }} -
    - {% csrf_token %} -
    -
    - -
    -
    -
    - Or use the last {{ deltaform }} days. -
    -
    - {% csrf_token %} - - -
    -
    - -
    - -

    Ranking Piece Results

    - - {% if rankingworkouts %} - - - - - - - - - - - - - - {% for workout in rankingworkouts %} - - - - - - - - - - - {% endfor %} - -
    Distance Duration Date Avg HR Max HR Edit
    {{ workout.distance }} {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} - {{ workout.name }}
    - {% else %} -

    No ranking workouts found

    - {% endif %} - -

    Missing your best pieces? Upload stroke data of any Concept2 - ranking piece and they will be automatically added to this page.

    -

    Don't have stroke data for official Concept2 ranking pieces? - The PRO membership ranking piece functionality - allows you to include your best non ranking pieces and even use - parts of workouts for improved calculation accuracy. -

    - -

    Want to add race results but you don't have stroke data? - Click here.

    - -

    Scroll down for the chart and pace predictions for ranking pieces.

    - -
    - - -
    - -

    Critical Power Plot

    +

    Critical Power Plot

    {{ the_div|safe }} - -{% if age %} -

    The dashed lines are based on the - Concept2 - rankings for your age, gender - and weight category. World class means within 5% of - - World Record in terms - of power. - The percentile lines are estimates of where the percentiles - of the Concept2 rankings historically are for those of exactly - your age, gender and weight class. -

    -{% endif %} -
    - -
    -

    Pace predictions for Ranking Pieces

    - -

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    -
    -
    - {{ form.value }} {{ form.pieceunit }} + + {% if age %} +

    The dashed lines are based on the + Concept2 + rankings for your age, gender + and weight category. World class means within 5% of + + World Record in terms + of power. + The percentile lines are estimates of where the percentiles + of the Concept2 rankings historically are for those of exactly + your age, gender and weight class. +

    + {% endif %} + +
  • +

    Ranking Piece Results

    + + {% if rankingworkouts %} + + + + + + + + + + + + + + {% for workout in rankingworkouts %} + + + + + + + + + - {% csrf_token %} - -
    - + {% endfor %} +
    +
    Distance Duration Date Avg HR Max HR Edit
    {{ workout.distance }} {{ workout.duration |durationprint:"%H:%M:%S.%f" }} {{ workout.date }} {{ workout.averagehr }} {{ workout.maxhr }} + + {{ workout.name }} + +
    + {% else %} +

    No ranking workouts found

    + {% endif %} + +

    Missing your best pieces? Upload stroke data of any Concept2 + ranking piece and they will be automatically added to this page.

    +

    Don't have stroke data for official Concept2 ranking pieces? + The PRO membership ranking piece functionality + allows you to include your best non ranking pieces and even use + parts of workouts for improved calculation accuracy. +

    + +

    Want to add race results but you don't have stroke data? + Click here.

    + +

    Scroll down for the chart and pace predictions for ranking pieces.

    + +
  • + + + +
  • +

    Pace predictions for Ranking Pieces

    + +

    Add non-ranking piece using the form. The piece will be added in the prediction tables below.

    + + {{ form.value }} {{ form.pieceunit }} + + {% csrf_token %} + +
  • -
    + / -
    -

    Paul's Law

    -{% if nrdata >= 1 %} - - - - - - - - - - - {% for pred in predictions %} - - {% for key, value in pred.items %} - {% if key == "distance" %} - - {% endif %} - {% if key == "pace" %} - - {% endif %} - {% if key == "power" %} - - {% endif %} - {% if key == "duration" %} - - {% endif %} - {% endfor %} - - {% endfor %} - -
    Duration Distance Power Pace
    {{ value }} m {{ value |paceprint }} {{ value }} W {{ value |deltatimeprint }}
    - -{% else %} -

    Insufficient data to make predictions

    - -{% endif %} -
    -
    -

    CP Model

    -{% if nrdata >= 4 %} - - - - - - - - - - - {% for pred in cpredictions %} - - {% for key, value in pred.items %} - {% if key == "distance" %} - - {% endif %} - {% if key == "pace" %} - - {% endif %} - {% if key == "power" %} - - {% endif %} - {% if key == "duration" %} - - {% endif %} - {% endfor %} - - {% endfor %} - -
    Duration Distance Power Pace
    {{ value }} m {{ value |paceprint }} {{ value }} W {{ value |deltatimeprint }}
    - -{% else %} -

    Insufficient data to make predictions

    - -{% endif %} -
    - -
    - {% if age and sex != 'not specified' %} -

    World Records

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - 100m - -
    - 500m - -
    - 1000m - -
    - 2000m - -
    - 5000m - -
    - 6000m - -
    - 10000m - -
    - Half Marathon - -
    - Full Marathon - -
    - 1 minute - -
    - 4 minutes - -
    - 30 minutes - -
    - 1 hour - -
    +
  • +

    Paul's Law

    + {% if nrdata >= 1 %} + + + + + + + + + + + {% for pred in predictions %} + + {% for key, value in pred.items %} + {% if key == "distance" %} + + {% endif %} + {% if key == "pace" %} + + {% endif %} + {% if key == "power" %} + + {% endif %} + {% if key == "duration" %} + + {% endif %} + {% endfor %} + + {% endfor %} + +
    Duration Distance Power Pace
    {{ value }} m {{ value |paceprint }} {{ value }} W {{ value |deltatimeprint }}
    + {% else %} - If you fill in your birth date and gender, you will see World Records for - your age group and gender at this place. You can edit your settings - here. -{% endif %} -
  • -
    +

    Insufficient data to make predictions

    + + {% endif %} + +
  • +

    CP Model

    + {% if nrdata >= 4 %} + + + + + + + + + + + {% for pred in cpredictions %} + + {% for key, value in pred.items %} + {% if key == "distance" %} + + {% endif %} + {% if key == "pace" %} + + {% endif %} + {% if key == "power" %} + + {% endif %} + {% if key == "duration" %} + + {% endif %} + {% endfor %} + + {% endfor %} + +
    Duration Distance Power Pace
    {{ value }} m {{ value |paceprint }} {{ value }} W {{ value |deltatimeprint }}
    + + {% else %} +

    Insufficient data to make predictions

    + + {% endif %} +
  • + {% if age and sex != 'not specified' %} +
  • +

    World Records

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + 100m + +
    + 500m + +
    + 1000m + +
    + 2000m + +
    + 5000m + +
    + 6000m + +
    + 10000m + +
    + Half Marathon + +
    + Full Marathon + +
    + 1 minute + +
    + 4 minutes + +
    + 30 minutes + +
    + 1 hour + +
    +
  • + {% endif %} +
  • +

    Use this form to select a different date range:

    +

    + Select start and end date for a date range: + +

    + + + {{ dateform.as_table }} +
    + {% csrf_token %} + +
    +
  • +
  • +

    Summary for {{ theuser.first_name }} {{ theuser.last_name }} + between {{ startdate|date }} and {{ enddate|date }}

    + +

    The table gives the best efforts achieved on the + official Concept2 ranking pieces in the selected date range. Also the percentile scores on the + chart are based on the Concept2 rankings.

    +
  • + {% endblock %} + +{% block sidebar %} +{% include 'menu_analytics.html' %} +{% endblock %} diff --git a/rowers/urls.py b/rowers/urls.py index 7c58bb91..d7664a8f 100644 --- a/rowers/urls.py +++ b/rowers/urls.py @@ -182,22 +182,23 @@ urlpatterns = [ url(r'^record-progress$',views.post_progress), url(r'^list-graphs/$',views.graphs_view), url(r'^fitness-progress/$',views.fitnessmetric_view), - url(r'^fitness-progress/rower/(?P\d+)$',views.fitnessmetric_view), - url(r'^fitness-progress/rower/(?P\d+)/(?P\w+.*)$',views.fitnessmetric_view), - url(r'^(?P\d+)/ote-bests/(?P\w+.*)/(?P\w+.*)$',views.rankings_view), - url(r'^(?P\d+)/ote-bests/(?P\d+)$',views.rankings_view), + url(r'^fitness-progress/user/(?P\d+)$',views.fitnessmetric_view), + url(r'^fitness-progress/user/(?P\d+)/(?P\w+.*)$',views.fitnessmetric_view), + url(r'^ote-bests/user/(?P\d+)/(?P\w+.*)/(?P\w+.*)$',views.rankings_view), + url(r'^ote-bests/user/(?P\d+)/(?P\d+)$',views.rankings_view), + url(r'^ote-bests/user/(?P\d+)$',views.rankings_view), url(r'^ote-bests/(?P\w+.*)/(?P\w+.*)$',views.rankings_view), url(r'^ote-bests/(?P\d+)$',views.rankings_view), url(r'^ote-bests/$',views.rankings_view), url(r'^(?P\d+)/ote-bests/$',views.rankings_view), url(r'^(?P\d+)/ote-bests2/(?P\w+.*)/(?P\w+.*)$',views.rankings_view2), - url(r'^(?P\d+)/ote-bests2/(?P\d+)$',views.rankings_view2), + url(r'^ote-bests2/user/(?P\d+)/(?P\d+)$',views.rankings_view2), + url(r'^ote-bests2/user/(?P\d+)$',views.rankings_view2), url(r'^ote-bests2/(?P\w+.*)/(?P\w+.*)$',views.rankings_view2), url(r'^ote-bests2/(?P\d+)$',views.rankings_view2), url(r'^ote-bests2/$',views.rankings_view2), - url(r'^(?P\d+)/ote-bests2/$',views.rankings_view2), - url(r'^(?P\d+)/otw-bests/(?P\w+.*)/(?P\w+.*)$',views.otwrankings_view), - url(r'^(?P\d+)/otw-bests/(?P\d+)$',views.otwrankings_view), + url(r'^otw-bests/user/(?P\d+)/(?P\w+.*)/(?P\w+.*)$',views.otwrankings_view), + url(r'^otw-bests/user/(?P\d+)/(?P\d+)$',views.otwrankings_view), url(r'^otw-bests/(?P\w+.*)/(?P\w+.*)$',views.otwrankings_view), url(r'^otw-bests/(?P\d+)$',views.otwrankings_view), url(r'^otw-bests/$',views.otwrankings_view), diff --git a/rowers/views.py b/rowers/views.py index 7d103e7b..a6cea7b6 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -2793,6 +2793,7 @@ def fitnessmetric_view(request,id=0,mode='rower', startdate=timezone.now()-timezone.timedelta(days=365), enddate=timezone.now()): + therower = getrequestrower(request,userid=id) theuser = therower.user @@ -2818,7 +2819,8 @@ def fitnessmetric_view(request,id=0,mode='rower', return render(request,'fitnessmetric.html', { - 'therower':therower, + 'rower':therower, + 'active':'nav-analysis', 'chartscript':script, 'the_div':thediv, 'mode':mode, @@ -3532,6 +3534,8 @@ def rankings_view(request,theuser=0, 'cpredictions':cpredictions, 'nrdata':len(thedistances), 'form':form, + 'rower':r, + 'active':'nav-analysis', 'dateform':dateform, 'deltaform':deltaform, 'worldclasspower':worldclasspower, @@ -3975,6 +3979,8 @@ def rankings_view2(request,theuser=0, 'deltaform':deltaform, 'id': theuser, 'theuser':uu, + 'rower':r, + 'active':'nav-analysis', 'age':age, 'sex':r.sex, 'recalc':recalc, @@ -4281,6 +4287,8 @@ def otwrankings_view(request,theuser=0, 'interactiveplot':script, 'the_div':div, 'cpredictions':cpredictions, + 'rower':r, + 'active':'nav-analysis', 'avgpower':avgpower, 'form':form, 'dateform':dateform,