Private
Public Access
1
0

Merge branch 'develop' into feature/django2

This commit is contained in:
Sander Roosendaal
2019-04-05 19:44:16 +02:00
16 changed files with 687 additions and 207 deletions

View File

@@ -26,15 +26,24 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
if not promember:
return HttpResponseRedirect("/rowers/about/")
if request.method == 'POST' and 'workstrokesonly' in request.POST:
workstrokesonly = request.POST['workstrokesonly']
if workstrokesonly == 'True':
workstrokesonly = True
if request.method == 'POST':
form = ForceCurveOptionsForm(request.POST)
if form.is_valid():
includereststrokes = form.cleaned_data['includereststrokes']
plottype = form.cleaned_data['plottype']
workstrokesonly = not includereststrokes
else:
workstrokesonly = False
workstrokesonly = True
plottype = 'line'
else:
form = ForceCurveOptionsForm()
plottype = 'line'
script,div,js_resources,css_resources = interactive_forcecurve([row],
workstrokesonly=workstrokesonly)
script,div,js_resources,css_resources = interactive_forcecurve(
[row],
workstrokesonly=workstrokesonly,
plottype=plottype,
)
breadcrumbs = [
{
@@ -53,12 +62,13 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
]
r = getrower(request.user)
return render(request,
'forcecurve_single.html',
{
'the_script':script,
'rower':r,
'form':form,
'workout':row,
'breadcrumbs':breadcrumbs,
'active':'nav-workouts',
@@ -67,7 +77,6 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
'css_res':css_resources,
'id':id,
'mayedit':mayedit,
'workstrokesonly': not workstrokesonly,
'teams':get_my_teams(request.user),
})
@@ -102,7 +111,7 @@ def workout_histo_view(request,id=0):
if not promember:
return HttpResponseRedirect("/rowers/about/")
res = interactive_histoall([w])
res = interactive_histoall([w],'power',False)
script = res[0]
div = res[1]
@@ -4834,8 +4843,8 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
s = cd["intervalstring"]
try:
rowdata.updateinterval_string(s)
except (ParseException,err):
messages.error(request,'Parsing error in column '+str(err.col))
except:
messages.error(request,'Parsing error')
intervalstats = rowdata.allstats()
itime,idist,itype = rowdata.intervalstats_values()
nrintervals = len(idist)