instroke
This commit is contained in:
@@ -1 +0,0 @@
|
||||
E408191@CZ27LT9RCGN72.11300:1539016748
|
||||
@@ -1,80 +1,60 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends "newbase.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load rowerfilters %}
|
||||
|
||||
{% block title %}Advanced Features {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="workouts" class="grid_6 alpha">
|
||||
|
||||
{% if form.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ form.errors|pluralize }} below.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<h1>In Stroke Metrics</h1>
|
||||
{% if user.rower.rowerplan == 'basic' %}
|
||||
<p>This is a preview of the page with advanced functionality for Pro users. See <a href="/rowers/about">the About page</a> for more information and to sign up for Pro Membership</a>
|
||||
{% block main %}
|
||||
<h1>In Stroke Metrics</h1>
|
||||
<ul class="main-content">
|
||||
<li class="grid_4">
|
||||
{% if user.rower.rowerplan == 'basic' %}
|
||||
|
||||
<p>
|
||||
This is a preview of the page with advanced functionality for Pro users.
|
||||
See <a href="/rowers/about">the About page</a> for more information
|
||||
and to sign up for Pro Membership
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="grid_2 alpha">
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/edit">Edit Workout</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2">
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/advanced">Advanced Edit</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="grid_2 omega">
|
||||
<p>
|
||||
<a class="button gray small" href="/rowers/workout/{{ workout.id }}/export">Export</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<th>Date:</th><td>{{ workout.date }}</td>
|
||||
</tr><tr>
|
||||
<th>Time:</th><td>{{ workout.starttime }}</td>
|
||||
</tr><tr>
|
||||
<th>Distance:</th><td>{{ workout.distance }}m</td>
|
||||
</tr><tr>
|
||||
<th>Duration:</th><td>{{ workout.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||
</tr>
|
||||
<th>Public link to this workout</th>
|
||||
<td>
|
||||
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||
<td>
|
||||
</table>
|
||||
</div>
|
||||
</li>
|
||||
<li class="grid_2">
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<th>Date:</th><td>{{ workout.date }}</td>
|
||||
</tr><tr>
|
||||
<th>Time:</th><td>{{ workout.starttime }}</td>
|
||||
</tr><tr>
|
||||
<th>Distance:</th><td>{{ workout.distance }}m</td>
|
||||
</tr><tr>
|
||||
<th>Duration:</th><td>{{ workout.duration |durationprint:"%H:%M:%S.%f" }}</td>
|
||||
</tr>
|
||||
<th>Public link to this workout</th>
|
||||
<td>
|
||||
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
|
||||
<td>
|
||||
|
||||
</table>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
{% if instrokemetrics %}
|
||||
{% for metric in instrokemetrics %}
|
||||
{% if forloop.first %}
|
||||
<div class="grid_2 alpha">
|
||||
{% else %}
|
||||
<div class="grid_2">
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if instrokemetrics %}
|
||||
{% for metric in instrokemetrics %}
|
||||
<p>
|
||||
<a class="button blue small" href="/rowers/workout/{{ workout.id }}/instroke/{{ metric }}">{{ metric }}</a>
|
||||
</div>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>Unfortunately, this workout doesn't have any in stroke metrics</p>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="advancedplots" class="grid_6 omega">
|
||||
<p> </p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'menu_workout.html' %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -234,8 +234,8 @@ urlpatterns = [
|
||||
url(r'^workout/(?P<id>\d+)/csvtoadmin$',views.workout_csvtoadmin_view),
|
||||
url(r'^ergcpdatatoadmin/(?P<theuser>\d+)/(?P<startdatestring>\d+-\d+-\d+)/(?P<enddatestring>\w+.*)$',views.otecp_toadmin_view),
|
||||
url(r'^otwcpdatatoadmin/(?P<theuser>\d+)/(?P<startdatestring>\d+-\d+-\d+)/(?P<enddatestring>\w+.*)$',views.otwcp_toadmin_view),
|
||||
url(r'^workout/compare/(?P<id>\d+)/$',views.workout_comparison_list),
|
||||
url(r'^workout/compare2/(?P<id1>\d+)/(?P<id2>\d+)/(?P<xparam>\w+.*)/(?P<yparam>\w+.*)/$',views.workout_comparison_view),
|
||||
# url(r'^workout/compare/(?P<id>\d+)/$',views.workout_comparison_list),
|
||||
# url(r'^workout/compare2/(?P<id1>\d+)/(?P<id2>\d+)/(?P<xparam>\w+.*)/(?P<yparam>\w+.*)/$',views.workout_comparison_view),
|
||||
url(r'^workout/compare/(?P<id>\d+)/(?P<startdatestring>\d+-\d+-\d+)/(?P<enddatestring>\w+.*)$',views.workout_comparison_list),
|
||||
url(r'^workout/(?P<id>\d+)/edit$',views.workout_edit_view,
|
||||
name='workout_edit_view'),
|
||||
@@ -243,8 +243,8 @@ urlpatterns = [
|
||||
url(r'^workout/(?P<id>\d+)/setprivate$',views.workout_setprivate_view),
|
||||
url(r'^workout/(?P<id>\d+)/updatecp$',views.workout_update_cp_view),
|
||||
url(r'^workout/(?P<id>\d+)/makepublic$',views.workout_makepublic_view),
|
||||
url(r'^workout/(?P<id>\d+)/geeky$',views.workout_geeky_view),
|
||||
url(r'^workout/(?P<id>\d+)/advanced$',views.workout_advanced_view),
|
||||
# url(r'^workout/(?P<id>\d+)/geeky$',views.workout_geeky_view),
|
||||
# url(r'^workout/(?P<id>\d+)/advanced$',views.workout_advanced_view),
|
||||
url(r'^workout/(?P<id>\d+)/instroke/(?P<metric>\w+.*)$',views.instroke_chart),
|
||||
url(r'^workout/(?P<id>\d+)/instroke$',views.instroke_view),
|
||||
url(r'^workout/(?P<id>\d+)/stats$',views.workout_stats_view),
|
||||
|
||||
@@ -7233,13 +7233,29 @@ def workout_otwsetpower_view(request,id=0,message="",successmessage=""):
|
||||
|
||||
@login_required()
|
||||
def instroke_view(request,id=0):
|
||||
row = get_workout(id)
|
||||
w = get_workout(id)
|
||||
|
||||
breadcrumbs = [
|
||||
{
|
||||
'url':'/rowers/list-workouts',
|
||||
'name':'Workouts'
|
||||
},
|
||||
{
|
||||
'url':get_workout_default_page(request,id),
|
||||
'name': str(w.id)
|
||||
},
|
||||
{
|
||||
'url':reverse(instroke_view,kwargs={'id':id}),
|
||||
'name': 'In-Stroke Metrics'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
# form = WorkoutForm(instance=row)
|
||||
g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime")
|
||||
g = GraphImage.objects.filter(workout=w).order_by("-creationdatetime")
|
||||
# check if user is owner of this workout
|
||||
|
||||
if (checkworkoutuser(request.user,row)==False):
|
||||
if (checkworkoutuser(request.user,w)==False):
|
||||
message = "You are not allowed to edit this workout"
|
||||
messages.error(request,message)
|
||||
url = reverse(workouts_view)
|
||||
@@ -7247,7 +7263,7 @@ def instroke_view(request,id=0):
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
from metrics import nometrics
|
||||
rowdata = rrdata(csvfile=row.csvfilename)
|
||||
rowdata = rrdata(csvfile=w.csvfilename)
|
||||
try:
|
||||
instrokemetrics = rowdata.get_instroke_columns()
|
||||
instrokemetrics = [m for m in instrokemetrics if not m in nometrics]
|
||||
@@ -7257,7 +7273,10 @@ def instroke_view(request,id=0):
|
||||
|
||||
return render(request,
|
||||
'instroke.html',
|
||||
{'workout':row,
|
||||
{'workout':w,
|
||||
'rower':r,
|
||||
'active':'nav-workouts',
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'teams':get_my_teams(request.user),
|
||||
'instrokemetrics':instrokemetrics,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user