Private
Public Access
1
0

toggle rest stroke buttons

This commit is contained in:
Sander Roosendaal
2017-01-04 11:05:32 +01:00
parent f7d26a9e11
commit 467471437e
5 changed files with 187 additions and 150 deletions

View File

@@ -1463,7 +1463,7 @@ def cum_flex(request,theuser=0,
})
@user_passes_test(promember,login_url="/",redirect_field_name=None)
def workout_forcecurve_view(request,id=0):
def workout_forcecurve_view(request,id=0,workstrokesonly=False):
row = Workout.objects.get(id=id)
promember=0
mayedit=0
@@ -1478,7 +1478,15 @@ def workout_forcecurve_view(request,id=0):
if not promember:
return HttpResponseRedirect("/rowers/about/")
script,div,js_resources,css_resources = interactive_forcecurve([row])
if request.method == 'POST' and 'workstrokesonly' in request.POST:
workstrokesonly = request.POST['workstrokesonly']
if workstrokesonly == 'True':
workstrokesonly = True
else:
workstrokesonly = False
script,div,js_resources,css_resources = interactive_forcecurve([row],
workstrokesonly=workstrokesonly)
return render(request,
'forcecurve_single.html',
@@ -1489,6 +1497,7 @@ def workout_forcecurve_view(request,id=0):
'css_res':css_resources,
'id':id,
'mayedit':mayedit,
'workstrokesonly': not workstrokesonly,
})
@login_required()