adding cp chart to workout menu
This commit is contained in:
@@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<p>
|
<p>
|
||||||
Plot a histogram chart of one metric for all your strokes over a date range.
|
Plot a histogram chart of one metric for all your strokes over a date range.
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="rounder">
|
<li class="rounder">
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<img src="/static/img/boxplot.png" alt="Box Chart">
|
<img src="/static/img/boxplot.png" alt="Box Chart">
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
BETA: Box Chart Statistics of stroke metrics over a date range
|
BETA: Box Chart Statistics of stroke metrics over a date range
|
||||||
</p>
|
</p>
|
||||||
@@ -109,26 +109,14 @@
|
|||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="rounder">
|
<li class="rounder">
|
||||||
<h2>OTW Critical Power</h2>
|
<h2>Critical Power</h2>
|
||||||
<a href="/rowers/otw-bests/">
|
<a href="/rowers/user-analysis-select/cp/">
|
||||||
<div class="vignet">
|
<div class="vignet">
|
||||||
<img src="/static/img/otwcp.png" alt="OTW Critical Power">
|
<img src="/static/img/otwcp.png" alt="Critical Power">
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<p>
|
<p>
|
||||||
Analyse power vs piece duration to make predictions. For On-The-Water rowing.
|
Analyse power vs piece duration to make predictions.
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li class="rounder">
|
|
||||||
<h2>OTE Critical Power</h2>
|
|
||||||
<a href="/rowers/ote-ranking/">
|
|
||||||
<div class="vignet">
|
|
||||||
<img src="/static/img/otecp.png" alt="OTE Critical Power">
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Analyse power vs piece duration to make predictions, for erg pieces.
|
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="rounder">
|
<li class="rounder">
|
||||||
@@ -140,7 +128,7 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Need to monitor a metric? Set up automatic alerting and see the reports for your workouts.
|
Need to monitor a metric? Set up automatic alerting and see the reports for your workouts.
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -48,13 +48,8 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="fitness-otecp">
|
<li id="fitness-otecp">
|
||||||
<a href="/rowers/ote-ranking/">
|
<a href="/rowers/user-analysis-select/cp/">
|
||||||
<i class="fas fa-user-chart fa-fw"></i> CP Chart OTE
|
<i class="fas fa-user-chart fa-fw"></i> CP Chart
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li id="fitness-otwcp">
|
|
||||||
<a href="/rowers/otw-bests/">
|
|
||||||
<i class="far fa-user-chart fa-fw"></i> CP Chart OTW
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -45,6 +45,11 @@
|
|||||||
<i class="fas fa-balance-scale fa-fw"></i> Compare
|
<i class="fas fa-balance-scale fa-fw"></i> Compare
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li id="cp">
|
||||||
|
<a href="/rowers/user-analysis-select/cp/workout/{{ workout.id|encode }}/">
|
||||||
|
<i class="fas fa-user-chart fa-fw"></i> CP Chart
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li id="video-analysis">
|
<li id="video-analysis">
|
||||||
<a href="/rowers/workout/{{ workout.id|encode }}/video/">
|
<a href="/rowers/workout/{{ workout.id|encode }}/video/">
|
||||||
<i class="fas fa-video-plus fa-fw"></i> Video Analysis
|
<i class="fas fa-video-plus fa-fw"></i> Video Analysis
|
||||||
|
|||||||
@@ -326,6 +326,7 @@ urlpatterns = [
|
|||||||
re_path(r'^user-boxplot-select/$',views.user_boxplot_select,name='user_boxplot_select'),
|
re_path(r'^user-boxplot-select/$',views.user_boxplot_select,name='user_boxplot_select'),
|
||||||
re_path(r'^user-analysis-select/(?P<function>\w.*)/user/(?P<userid>\d+)/$',views.analysis_new,name='analysis_new'),
|
re_path(r'^user-analysis-select/(?P<function>\w.*)/user/(?P<userid>\d+)/$',views.analysis_new,name='analysis_new'),
|
||||||
re_path(r'^user-analysis-select/(?P<function>\w.*)/team/(?P<teamid>\d+)/$',views.analysis_new,name='analysis_new'),
|
re_path(r'^user-analysis-select/(?P<function>\w.*)/team/(?P<teamid>\d+)/$',views.analysis_new,name='analysis_new'),
|
||||||
|
re_path(r'^user-analysis-select/(?P<function>\w.*)/workout/(?P<id>\b[0-9A-Fa-f]+\b)/$',views.analysis_new,name='analysis_new'),
|
||||||
re_path(r'^user-analysis-select/user/(?P<userid>\d+)/$',views.analysis_new,name='analysis_new'),
|
re_path(r'^user-analysis-select/user/(?P<userid>\d+)/$',views.analysis_new,name='analysis_new'),
|
||||||
re_path(r'^user-analysis-select/team/(?P<teamid>\d+)/$',views.analysis_new,name='analysis_new'),
|
re_path(r'^user-analysis-select/team/(?P<teamid>\d+)/$',views.analysis_new,name='analysis_new'),
|
||||||
re_path(r'^user-analysis-select/(?P<function>\w.*)/$',views.analysis_new,name='analysis_new'),
|
re_path(r'^user-analysis-select/(?P<function>\w.*)/$',views.analysis_new,name='analysis_new'),
|
||||||
|
|||||||
@@ -34,11 +34,19 @@ defaultoptions = {
|
|||||||
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",
|
||||||
redirect_field_name=None)
|
redirect_field_name=None)
|
||||||
@permission_required('rower.is_coach',fn=get_user_by_userid,raise_exception=True)
|
@permission_required('rower.is_coach',fn=get_user_by_userid,raise_exception=True)
|
||||||
def analysis_new(request,userid=0,function='boxplot',teamid=0):
|
def analysis_new(request,userid=0,function='boxplot',teamid=0,id=0):
|
||||||
r = getrequestrower(request, userid=userid)
|
r = getrequestrower(request, userid=userid)
|
||||||
user = r.user
|
user = r.user
|
||||||
userid = user.id
|
userid = user.id
|
||||||
|
|
||||||
|
if id:
|
||||||
|
firstworkout = get_workout(id)
|
||||||
|
if not is_workout_team(request.user,firstworkout):
|
||||||
|
raise PermissionDenied("You are not allowed to use this workout")
|
||||||
|
firstworkoutquery = Workout.objects.filter(id=encoder.decode_hex(id))
|
||||||
|
else:
|
||||||
|
firtworkout = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
theteam = Team.objects.get(id=teamid)
|
theteam = Team.objects.get(id=teamid)
|
||||||
except Team.DoesNotExist:
|
except Team.DoesNotExist:
|
||||||
@@ -188,7 +196,8 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0):
|
|||||||
startdatetime__lte=enddate,
|
startdatetime__lte=enddate,
|
||||||
workouttype__in=modalities,
|
workouttype__in=modalities,
|
||||||
)
|
)
|
||||||
|
if firstworkout:
|
||||||
|
workouts = firstworkoutquery | workouts
|
||||||
workouts = workouts.order_by(
|
workouts = workouts.order_by(
|
||||||
"-date", "-starttime"
|
"-date", "-starttime"
|
||||||
).exclude(boattype__in=negtypes)
|
).exclude(boattype__in=negtypes)
|
||||||
@@ -212,6 +221,8 @@ def analysis_new(request,userid=0,function='boxplot',teamid=0):
|
|||||||
|
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
form = WorkoutMultipleCompareForm()
|
form = WorkoutMultipleCompareForm()
|
||||||
|
if id:
|
||||||
|
form.fields["workouts"].initial = [firstworkout]
|
||||||
chartform = AnalysisChoiceForm(initial={'function':function})
|
chartform = AnalysisChoiceForm(initial={'function':function})
|
||||||
selectedworkouts = Workout.objects.none()
|
selectedworkouts = Workout.objects.none()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user