Private
Public Access
1
0

otw-rankings line 205 urls.py

This commit is contained in:
Sander Roosendaal
2018-10-04 22:09:12 +02:00
parent f29e986dc1
commit 8522afee96
6 changed files with 443 additions and 576 deletions

View File

@@ -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,

View File

@@ -1,10 +1,10 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
{% block title %}Rowsandall Fitness Progress {% endblock %}
{% block content %}
{% block main %}
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(function() {
@@ -70,56 +70,34 @@
};
window.addEventListener('load', plot_resize_setup);
</script>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
{% if rower.user %}
<h1>{{ rower.user.first_name }} Power Estimates</h1>
{% else %}
<h1>{{ user.first_name }} Power Estimates</h1>
{% endif %}
<div id="title" class="grid_12 alpha">
<div class="grid_6 suffix_6 alpha">
<form enctype="multipart/form-data" method="post">
<ul class="main-content">
<li class="grid_4">
{{ the_div|safe }}
</li>
<li class="grid_2">
<form enctype="multipart/form-data" action="/rowers/fitness-progress/user/{{ rower.user.id }}" method="post">
<table>
{{ form.as_table }}
</table>
{% csrf_token %}
<div class="grid_2 prefix_4 alpha">
<input name='daterange' class="button green" type="submit" value="Submit">
</div>
<input name='daterange' class="button green" type="submit" value="Submit">
</form>
</div>
<div class="grid_10 alpha">
{% if therower.user %}
<h3>{{ therower.user.first_name }} Power Estimates</h3>
{% else %}
<h3>{{ user.first_name }} Power Estimates</h3>
{% endif %}
</div>
<div class="grid_2 omega">
{% if user.is_authenticated and user|is_manager %}
<div class="grid_2 alpha dropdown">
<button class="grid_2 alpha button green small dropbtn">
{{ therower.user.first_name }} {{ therower.user.last_name }}
</button>
<div class="dropdown-content">
{% for member in user|team_members %}
<a class="button green small"
href="/rowers/fitness-progress/rower/{{ member.id }}/{{ mode }}">{{ member.first_name }} {{ member.last_name }}</a>
{% endfor %}
</div>
{% else %}
&nbsp;
</div>
{% endif %}
</div>
</li>
</ul>
</div>
<div id="graph" class="grid_12 alpha">
{{ the_div|safe }}
</div>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -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 %}
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
{{ interactiveplot |safe }}
<script>
// Set things up to resize the plot on a window resize. You can play with
// the arguments of resize_width_height() to change the plot's behavior.
var plot_resize_setup = function () {
var plotid = Object.keys(Bokeh.index)[0]; // assume we have just one plot
var plot = Bokeh.index[plotid];
var plotresizer = function() {
// arguments: use width, use height, maintain aspect ratio
plot.resize_width_height(true, true, false);
};
window.addEventListener('resize', plotresizer);
plotresizer();
};
window.addEventListener('load', plot_resize_setup);
</script>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
{{ interactiveplot |safe }}
<div id="title" class="grid_12 alpha">
<div class="grid_10 alpha">
{% if theuser %}
<h3>{{ theuser.first_name }}'s Ranking Pieces</h3>
{% else %}
<h3>{{ user.first_name }}'s Ranking Pieces</h3>
{% endif %}
</div>
<div class="grid_2 omega">
{% if user.is_authenticated and user|is_manager %}
<div class="grid_2 alpha dropdown">
<button class="grid_2 alpha button green small dropbtn">
{{ theuser.first_name }} {{ theuser.last_name }}
</button>
<div class="dropdown-content">
{% for member in user|team_members %}
{% if workouttype == 'water' %}
<a class="button green small" href="/rowers/{{ member.id }}/otw-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
{% else %}
<a class="button green small" href="/rowers/{{ member.id }}/ote-ranking/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
{% endif %}
{% endfor %}
</div>
{% else %}
&nbsp;
{% endif %}
</div>
</div>
{% if theuser %}
<h1>{{ theuser.first_name }}'s Ranking Pieces</h1>
{% else %}
<h1>{{ user.first_name }}'s Ranking Pieces</h1>
{% endif %}
<div id="summary" class="grid_6 alpha">
<p>Summary for {{ theuser.first_name }} {{ theuser.last_name }}
between {{ startdate|date }} and {{ enddate|date }}</p>
<ul class="main-content">
<p>Direct link for other users:
{% if workouttype == 'water' %}
<a href="/rowers/{{ id }}/otw-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/otw-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
{% else %}
<a href="/rowers/{{ id }}/ote-ranking/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/ote-ranking/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
{% endif %}
</p>
<li class="grid_2">
<p>Summary for {{ theuser.first_name }} {{ theuser.last_name }}
between {{ startdate|date }} and {{ enddate|date }}</p>
<p>The table gives the efforts you marked as Ranking Piece.
The graph shows the best segments from those pieces, plotted as
average power (over the segment) vs the duration of the segment/
In other words: How long you can hold that power.
</p>
<p>The table gives the efforts you marked as Ranking Piece.
The graph shows the best segments from those pieces, plotted as
average power (over the segment) vs the duration of the segment/
In other words: How long you can hold that power.
</p>
<p>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.</p>
<p>At the bottom of the page, you will find predictions derived from the model.</p>
</div>
<div id="form" class="grid_6 omega">
<p>Use this form to select a different date range:</p>
<p>
Select start and end date for a date range:
<div class="grid_4 alpha">
<p>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.</p>
<p>At the bottom of the page, you will find predictions derived from the model.</p>
</li>
<li class="grid_2">
<p>Use this form to select a different date range:</p>
<p>
Select start and end date for a date range:
<form enctype="multipart/form-data" action="" method="post">
<form enctype="multipart/form-data" action="" method="post">
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
</div>
<div class="grid_4 alpha">
<form enctype="multipart/form-data" action="" method="post">
Or use the last {{ deltaform }} days.
</div>
<div class="grid_2 omega">
{% csrf_token %}
<input name='datedelta' class="button green" type="submit" value="Submit">
</form>
</div>
</div>
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
<input name='daterange' class="button green" type="submit" value="Submit">
</form>
</li>
<li class="grid_4">
<div id="theplot" class="grid_12 alpha">
<h2>Critical Power Plot</h2>
<h2>Critical Power Plot</h2>
{{ the_div|safe }}
</div>
</li>
<div class="grid_12 alpha">
<li class="grid_2">
<h2>Ranking Piece Results</h2>
<h2>Ranking Piece Results</h2>
{% if rankingworkouts %}
{% if rankingworkouts %}
<table width="70%" class="listtable">
<thead>
<table width="100%" class="listtable">
<thead>
<tr>
<th> Distance</th>
<th> Duration</th>
<th> Avg Power</th>
<th> Date</th>
<th> Avg HR </th>
<th> Max HR </th>
<th> Edit</th>
<th> Distance</th>
<th> Duration</th>
<th> Avg Power</th>
<th> Date</th>
<th> Avg HR </th>
<th> Max HR </th>
<th> Edit</th>
<tr>
</thead>
<tbody>
</thead>
<tbody>
{% for workout in rankingworkouts %}
<tr>
<td> {{ workout.distance }} m</td>
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ avgpower|lookup:workout.id }} W</td>
<td> {{ workout.date }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
<td>
<a href="/rowers/workout/{{ workout.id }}/edit">{{ workout.name }}</a> </td>
<tr>
<td> {{ workout.distance }} m</td>
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ avgpower|lookup:workout.id }} W</td>
<td> {{ workout.date }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
<td>
<a href="/rowers/workout/{{ workout.id }}/edit">{{ workout.name }}</a> </td>
</tr>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p> No ranking workouts found </p>
{% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<p> No ranking workouts found </p>
{% endif %}
</div>
</li>
<div id="predictions" class="grid_12 alpha">
<h2>Pace predictions for Ranking Pieces</h2>
<li class="grid_2">
<h2>Pace predictions for Ranking Pieces</h2>
<p>Add non-ranking piece using the form. The piece will be added in the prediction tables below. </p>
<p>Add non-ranking piece using the form. The piece will be added in the prediction tables below. </p>
<div id="cpmodel" class="grid_6 alpha">
<table width="70%" class="listtable">
<table width="100%" class="listtable">
<thead>
<tr>
<th> Duration</th>
@@ -200,25 +136,24 @@
</tbody>
</table>
</div>
</li>
<div class="grid_3">
<li class="grid_2">
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{{ form.value }} {{ form.pieceunit }}
{% csrf_token %}
</div>
<div class="grid_1">
minutes
</div>
<div class="grid_2 omega">
<input name="piece" class="button green"
action=""
type="submit" value="Add">
</form>
</div>
minutes
<input name="piece" class="button green"
action=""
type="submit" value="Add">
</form>
</li>
</ul>
</div>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "newbase.html" %}
{% load staticfiles %}
{% load rowerfilters %}
@@ -11,378 +11,320 @@
{% endblock %}
{% block content %}
{% block main %}
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
<script type="text/javascript" src="/static/js/bokeh-0.12.3.min.js"></script>
<script async="true" type="text/javascript">
Bokeh.set_log_level("info");
</script>
{{ interactiveplot |safe }}
<script>
// Set things up to resize the plot on a window resize. You can play with
// the arguments of resize_width_height() to change the plot's behavior.
var plot_resize_setup = function () {
var plotid = Object.keys(Bokeh.index)[0]; // assume we have just one plot
var plot = Bokeh.index[plotid];
var plotresizer = function() {
// arguments: use width, use height, maintain aspect ratio
plot.resize_width_height(true, true, false);
};
window.addEventListener('resize', plotresizer);
plotresizer();
};
window.addEventListener('load', plot_resize_setup);
</script>
<style>
/* Need this to get the page in "desktop mode"; not having an infinite height.*/
html, body {height: 100%; margin:5px;}
</style>
{{ interactiveplot |safe }}
<div id="title" class="grid_12 alpha">
<div class="grid_10 alpha">
{% if theuser %}
<h3>{{ theuser.first_name }}'s Ranking Pieces</h3>
{% else %}
<h3>{{ user.first_name }}'s Ranking Pieces</h3>
{% endif %}
</div>
<div class="grid_2 omega">
{% if user.is_authenticated and user|is_manager %}
<div class="grid_2 alpha dropdown">
<button class="grid_2 alpha button green small dropbtn">
{{ theuser.first_name }} {{ theuser.last_name }}
</button>
<div class="dropdown-content">
{% for member in user|team_members %}
<a class="button green small" href="/rowers/{{ member.id }}/ote-bests2/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">{{ member.first_name }} {{ member.last_name }}</a>
{% endfor %}
</div>
{% else %}
&nbsp;
{% endif %}
</div>
</div>
{% if theuser %}
<h1>{{ theuser.first_name }}'s Ranking Pieces</h1>
{% else %}
<h1>{{ user.first_name }}'s Ranking Pieces</h1>
{% endif %}
<div id="summary" class="grid_6 alpha">
<p>Summary for {{ theuser.first_name }} {{ theuser.last_name }}
between {{ startdate|date }} and {{ enddate|date }}</p>
<ul class="main-content">
<li class="grid_4">
<p>Direct link for other users:
<a href="/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}">https://rowsandall.com/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}</a>
</p>
<p>The table gives the best efforts achieved on the
<a href="https://log.concept2.com/rankings">official Concept2 ranking pieces</a> in the selected date range. Also the percentile scores on the
chart are based on the Concept2 rankings.</p>
</div>
<div id="form" class="grid_6 omega">
<p>Use this form to select a different date range:</p>
<p>
Select start and end date for a date range:
<div class="grid_4 alpha">
<form enctype="multipart/form-data" action="" method="post">
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
</div>
<div class="grid_2 omega">
<input name='daterange' class="button green" type="submit" value="Submit"> </form>
</div>
<div class="grid_4 alpha">
<form enctype="multipart/form-data" action="" method="post">
Or use the last {{ deltaform }} days.
</div>
<div class="grid_2 omega">
{% csrf_token %}
<input name='datedelta' class="button green" type="submit" value="Submit">
</form>
</div>
</div>
<div class="grid_12 alpha">
<h2>Ranking Piece Results</h2>
{% if rankingworkouts %}
<table width="70%" class="listtable">
<thead>
<tr>
<th> Distance</th>
<th> Duration</th>
<th> Date</th>
<th> Avg HR </th>
<th> Max HR </th>
<th> Edit</th>
<tr>
</thead>
<tbody>
{% for workout in rankingworkouts %}
<tr>
<td> {{ workout.distance }} </td>
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ workout.date }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
<td>
<a href="/rowers/workout/{{ workout.id }}/edit">{{ workout.name }}</a> </td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p> No ranking workouts found </p>
{% endif %}
<p>Missing your best pieces? Upload stroke data of any Concept2
ranking piece and they will be automatically added to this page.</p>
<p> Don't have stroke data for official Concept2 ranking pieces?
The <a href="/rowers/promembership">PRO membership</a> ranking piece functionality
allows you to include your best non ranking pieces and even use
parts of workouts for improved calculation accuracy.
</p>
<p>Want to add race results but you don't have stroke data?
<a href="/rowers/addmanual">Click here.</a></p>
<p>Scroll down for the chart and pace predictions for ranking pieces.</p>
</div>
<div id="theplot" class="grid_12 alpha">
<h2>Critical Power Plot</h2>
<h2>Critical Power Plot</h2>
{{ the_div|safe }}
{% if age %}
<p>The dashed lines are based on the
<a href="https://log.concept2.com/rankings">Concept2</a>
rankings for your age, gender
and weight category. World class means within 5% of
<a href="http://www.concept2.com/indoor-rowers/racing/records/world">
World Record</a> 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.
</p>
{% endif %}
</div>
{% if age %}
<p>The dashed lines are based on the
<a href="https://log.concept2.com/rankings">Concept2</a>
rankings for your age, gender
and weight category. World class means within 5% of
<a href="http://www.concept2.com/indoor-rowers/racing/records/world">
World Record</a> 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.
</p>
{% endif %}
</li>
<li class="grid_4">
<h2>Ranking Piece Results</h2>
<div id="predictions" class="grid_12 alpha">
<h2>Pace predictions for Ranking Pieces</h2>
{% if rankingworkouts %}
<p>Add non-ranking piece using the form. The piece will be added in the prediction tables below. </p>
<div class="grid_4 alpha">
<table width="100%" class="listtable">
<thead>
<tr>
<th> Distance</th>
<th> Duration</th>
<th> Date</th>
<th> Avg HR </th>
<th> Max HR </th>
<th> Edit</th>
<tr>
</thead>
<tbody>
{% for workout in rankingworkouts %}
<tr>
<td> {{ workout.distance }} </td>
<td> {{ workout.duration |durationprint:"%H:%M:%S.%f" }} </td>
<td> {{ workout.date }} </td>
<td> {{ workout.averagehr }} </td>
<td> {{ workout.maxhr }} </td>
<td>
<a href="/rowers/workout/{{ workout.id }}/edit">
{{ workout.name }}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p> No ranking workouts found </p>
{% endif %}
<p>Missing your best pieces? Upload stroke data of any Concept2
ranking piece and they will be automatically added to this page.</p>
<p> Don't have stroke data for official Concept2 ranking pieces?
The <a href="/rowers/promembership">PRO membership</a> ranking piece functionality
allows you to include your best non ranking pieces and even use
parts of workouts for improved calculation accuracy.
</p>
<p>Want to add race results but you don't have stroke data?
<a href="/rowers/addmanual">Click here.</a></p>
<p>Scroll down for the chart and pace predictions for ranking pieces.</p>
</li>
<li class="grid_2">
<h2>Pace predictions for Ranking Pieces</h2>
<p>Add non-ranking piece using the form. The piece will be added in the prediction tables below. </p>
<form enctype="multipart/form-data" action="{{ formloc }}" method="post">
{{ form.value }} {{ form.pieceunit }}
{{ form.value }} {{ form.pieceunit }}
{% csrf_token %}
</div>
<div class="grid_2 suffix_6 omega">
<input name="piece" class="button green"
formaction="/rowers/{{ id }}/ote-bests/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
type="submit" value="Add">
{% csrf_token %}
<input name="piece" class="button green"
formaction="/rowers/ote-bests/user/{{ id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}"
type="submit" value="Add">
</form>
</div>
</li>/
<div id="paul" class="grid_6 alpha">
<h3>Paul's Law</h3>
{% if nrdata >= 1 %}
<table width="70%" class="listtable">
<thead>
<tr>
<th> Duration</th>
<th> Distance</th>
<th> Power </th>
<th> Pace </th>
<tr>
</thead>
<tbody>
{% for pred in predictions %}
<tr>
{% for key, value in pred.items %}
{% if key == "distance" %}
<td> {{ value }} m </td>
{% endif %}
{% if key == "pace" %}
<td> {{ value |paceprint }} </td>
{% endif %}
{% if key == "power" %}
<td> {{ value }} W </td>
{% endif %}
{% if key == "duration" %}
<td> {{ value |deltatimeprint }} </td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
<li class="grid_2">
<h2>Paul's Law</h2>
{% if nrdata >= 1 %}
<table width="70%" class="listtable">
<thead>
<tr>
<th> Duration</th>
<th> Distance</th>
<th> Power </th>
<th> Pace </th>
<tr>
</thead>
<tbody>
{% for pred in predictions %}
<tr>
{% for key, value in pred.items %}
{% if key == "distance" %}
<td> {{ value }} m </td>
{% endif %}
{% if key == "pace" %}
<td> {{ value |paceprint }} </td>
{% endif %}
{% if key == "power" %}
<td> {{ value }} W </td>
{% endif %}
{% if key == "duration" %}
<td> {{ value |deltatimeprint }} </td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Insufficient data to make predictions</p>
{% endif %}
</div>
<div id="cpmodel" class="grid_6 omega">
<h3>CP Model</h3>
{% if nrdata >= 4 %}
<table width="70%" class="listtable">
<thead>
<tr>
<th> Duration</th>
<th> Distance</th>
<th> Power </th>
<th> Pace </th>
<tr>
</thead>
<tbody>
{% for pred in cpredictions %}
<tr>
{% for key, value in pred.items %}
{% if key == "distance" %}
<td> {{ value }} m </td>
{% endif %}
{% if key == "pace" %}
<td> {{ value |paceprint }} </td>
{% endif %}
{% if key == "power" %}
<td> {{ value }} W </td>
{% endif %}
{% if key == "duration" %}
<td> {{ value |deltatimeprint }} </td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Insufficient data to make predictions</p>
{% endif %}
</div>
<div class="grid_6 alpha">
{% if age and sex != 'not specified' %}
<h1>World Records</h1>
<table width = "70%" class="listtable">
<tbody>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/100m">100m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/500m">500m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/1000m">1000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/2000m">2000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/5000m">5000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/6000m">6000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/10000m">10000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/21097m">Half Marathon
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/42195m">Full Marathon
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/1min">1 minute
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/4min">4 minutes
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/30min">30 minutes
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/60min">1 hour
</a>
</td>
</tr>
</tbody>
</table>
{% 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
<a href="/rowers/me/edit">here</a>.
{% endif %}
</div>
</div>
<p>Insufficient data to make predictions</p>
{% endif %}
</li>
<li class="grid_2">
<h2>CP Model</h2>
{% if nrdata >= 4 %}
<table width="70%" class="listtable">
<thead>
<tr>
<th> Duration</th>
<th> Distance</th>
<th> Power </th>
<th> Pace </th>
<tr>
</thead>
<tbody>
{% for pred in cpredictions %}
<tr>
{% for key, value in pred.items %}
{% if key == "distance" %}
<td> {{ value }} m </td>
{% endif %}
{% if key == "pace" %}
<td> {{ value |paceprint }} </td>
{% endif %}
{% if key == "power" %}
<td> {{ value }} W </td>
{% endif %}
{% if key == "duration" %}
<td> {{ value |deltatimeprint }} </td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Insufficient data to make predictions</p>
{% endif %}
</li>
{% if age and sex != 'not specified' %}
<li>
<h2>World Records</h2>
<table width = "100%" class="listtable">
<tbody>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/100m">100m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/500m">500m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/1000m">1000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/2000m">2000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/5000m">5000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/6000m">6000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/10000m">10000m
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/21097m">Half Marathon
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/42195m">Full Marathon
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/1min">1 minute
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/4min">4 minutes
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/30min">30 minutes
</a>
</td>
</tr>
<tr>
<td>
<a
href="/rowers/agegrouprecords/{{ sex }}/{{ weightcategory }}/60min">1 hour
</a>
</td>
</tr>
</tbody>
</table>
</li>
{% endif %}
<li class="grid_2">
<p>Use this form to select a different date range:</p>
<p>
Select start and end date for a date range:
<form enctype="multipart/form-data" action="" method="post">
<table>
{{ dateform.as_table }}
</table>
{% csrf_token %}
<input name='daterange' class="button green" type="submit" value="Submit">
</form>
</li>
<li class="grid_2">
<p>Summary for {{ theuser.first_name }} {{ theuser.last_name }}
between {{ startdate|date }} and {{ enddate|date }}</p>
<p>The table gives the best efforts achieved on the
<a href="https://log.concept2.com/rankings">official Concept2 ranking pieces</a> in the selected date range. Also the percentile scores on the
chart are based on the Concept2 rankings.</p>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'menu_analytics.html' %}
{% endblock %}

View File

@@ -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<id>\d+)$',views.fitnessmetric_view),
url(r'^fitness-progress/rower/(?P<id>\d+)/(?P<mode>\w+.*)$',views.fitnessmetric_view),
url(r'^(?P<theuser>\d+)/ote-bests/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.rankings_view),
url(r'^(?P<theuser>\d+)/ote-bests/(?P<deltadays>\d+)$',views.rankings_view),
url(r'^fitness-progress/user/(?P<id>\d+)$',views.fitnessmetric_view),
url(r'^fitness-progress/user/(?P<id>\d+)/(?P<mode>\w+.*)$',views.fitnessmetric_view),
url(r'^ote-bests/user/(?P<theuser>\d+)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.rankings_view),
url(r'^ote-bests/user/(?P<theuser>\d+)/(?P<deltadays>\d+)$',views.rankings_view),
url(r'^ote-bests/user/(?P<theuser>\d+)$',views.rankings_view),
url(r'^ote-bests/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.rankings_view),
url(r'^ote-bests/(?P<deltadays>\d+)$',views.rankings_view),
url(r'^ote-bests/$',views.rankings_view),
url(r'^(?P<theuser>\d+)/ote-bests/$',views.rankings_view),
url(r'^(?P<theuser>\d+)/ote-bests2/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.rankings_view2),
url(r'^(?P<theuser>\d+)/ote-bests2/(?P<deltadays>\d+)$',views.rankings_view2),
url(r'^ote-bests2/user/(?P<theuser>\d+)/(?P<deltadays>\d+)$',views.rankings_view2),
url(r'^ote-bests2/user/(?P<theuser>\d+)$',views.rankings_view2),
url(r'^ote-bests2/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.rankings_view2),
url(r'^ote-bests2/(?P<deltadays>\d+)$',views.rankings_view2),
url(r'^ote-bests2/$',views.rankings_view2),
url(r'^(?P<theuser>\d+)/ote-bests2/$',views.rankings_view2),
url(r'^(?P<theuser>\d+)/otw-bests/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.otwrankings_view),
url(r'^(?P<theuser>\d+)/otw-bests/(?P<deltadays>\d+)$',views.otwrankings_view),
url(r'^otw-bests/user/(?P<theuser>\d+)/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.otwrankings_view),
url(r'^otw-bests/user/(?P<theuser>\d+)/(?P<deltadays>\d+)$',views.otwrankings_view),
url(r'^otw-bests/(?P<startdatestring>\w+.*)/(?P<enddatestring>\w+.*)$',views.otwrankings_view),
url(r'^otw-bests/(?P<deltadays>\d+)$',views.otwrankings_view),
url(r'^otw-bests/$',views.otwrankings_view),

View File

@@ -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,