Flex buttons on workouts list
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage
|
from rowers.models import Workout, User, Rower, WorkoutForm,RowerForm,GraphImage
|
||||||
from rowingdata import rower as rrower
|
from rowingdata import rower as rrower
|
||||||
from rowingdata import main as rmain
|
from rowingdata import main as rmain
|
||||||
|
|||||||
@@ -59,6 +59,8 @@
|
|||||||
<td> {{ workout.maxhr }} </td>
|
<td> {{ workout.maxhr }} </td>
|
||||||
<td> <a class="button red small" href="/rowers/workout/{{ workout.id }}/deleteconfirm">Delete</td>
|
<td> <a class="button red small" href="/rowers/workout/{{ workout.id }}/deleteconfirm">Delete</td>
|
||||||
<td> <a class="button blue small" href="/rowers/workout/{{ workout.id }}/export">Export</a> </td>
|
<td> <a class="button blue small" href="/rowers/workout/{{ workout.id }}/export">Export</a> </td>
|
||||||
|
<td> <a class="button blue small" href="/rowers/workout/{{ workout.id }}/flexchart">Flex</a> </td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -96,7 +98,7 @@
|
|||||||
<a class="wh" href="?page={{ workouts.next_page_number }}">></a>
|
<a class="wh" href="?page={{ workouts.next_page_number }}">></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -2688,10 +2688,20 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
|||||||
workstrokesonly = False
|
workstrokesonly = False
|
||||||
|
|
||||||
# create interactive plot
|
# create interactive plot
|
||||||
|
try:
|
||||||
script,div,js_resources,css_resources = interactive_flex_chart2(id,xparam=xparam,yparam1=yparam1,
|
script,div,js_resources,css_resources = interactive_flex_chart2(id,xparam=xparam,yparam1=yparam1,
|
||||||
yparam2=yparam2,
|
yparam2=yparam2,
|
||||||
promember=promember,plottype=plottype,
|
promember=promember,plottype=plottype,
|
||||||
workstrokesonly=workstrokesonly)
|
workstrokesonly=workstrokesonly)
|
||||||
|
except ValueError:
|
||||||
|
script,div = interactive_flex_chart2(id,xparam=xparam,yparam1=yparam1,
|
||||||
|
yparam2=yparam2,
|
||||||
|
promember=promember,plottype=plottype,
|
||||||
|
workstrokesonly=workstrokesonly)
|
||||||
|
js_resources = ""
|
||||||
|
css_resources = ""
|
||||||
|
|
||||||
|
|
||||||
# script = res[0]
|
# script = res[0]
|
||||||
# div = res[1]
|
# div = res[1]
|
||||||
# js_resources = res[2]
|
# js_resources = res[2]
|
||||||
@@ -3730,7 +3740,6 @@ def workout_upload_view(request,message=""):
|
|||||||
|
|
||||||
f = row.df['TimeStamp (sec)'].diff().mean()
|
f = row.df['TimeStamp (sec)'].diff().mean()
|
||||||
windowsize = 2*(int(10./(f)))+1
|
windowsize = 2*(int(10./(f)))+1
|
||||||
|
|
||||||
if not 'originalvelo' in row.df:
|
if not 'originalvelo' in row.df:
|
||||||
row.df['originalvelo'] = velo
|
row.df['originalvelo'] = velo
|
||||||
|
|
||||||
@@ -3755,7 +3764,6 @@ def workout_upload_view(request,message=""):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# recalculate power data
|
# recalculate power data
|
||||||
if workouttype == 'rower' or workouttype == 'dynamic' or workouttype == 'slides':
|
if workouttype == 'rower' or workouttype == 'dynamic' or workouttype == 'slides':
|
||||||
try:
|
try:
|
||||||
@@ -3777,7 +3785,6 @@ def workout_upload_view(request,message=""):
|
|||||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||||
|
|
||||||
|
|
||||||
hours = int(totaltime/3600.)
|
hours = int(totaltime/3600.)
|
||||||
minutes = int((totaltime - 3600.*hours)/60.)
|
minutes = int((totaltime - 3600.*hours)/60.)
|
||||||
seconds = int(totaltime - 3600.*hours - 60.*minutes)
|
seconds = int(totaltime - 3600.*hours - 60.*minutes)
|
||||||
@@ -3798,7 +3805,6 @@ def workout_upload_view(request,message=""):
|
|||||||
if (len(ws) != 0):
|
if (len(ws) != 0):
|
||||||
message = "Warning: This workout probably already exists in the database"
|
message = "Warning: This workout probably already exists in the database"
|
||||||
|
|
||||||
|
|
||||||
w = Workout(user=r,name=t,date=workoutdate,
|
w = Workout(user=r,name=t,date=workoutdate,
|
||||||
workouttype=workouttype,
|
workouttype=workouttype,
|
||||||
duration=duration,distance=totaldist,
|
duration=duration,distance=totaldist,
|
||||||
|
|||||||
Reference in New Issue
Block a user