added workflow view
This commit is contained in:
@@ -5850,6 +5850,8 @@ def workout_comparison_view2(request,id1=0,id2=0,xparam='distance',
|
||||
# Flex thumbnails
|
||||
@login_required()
|
||||
def workout_workflow_view(request,id):
|
||||
request.session['referer'] = absolute(request)['PATH']
|
||||
request.session[translation.LANGUAGE_SESSION_KEY] = USER_LANGUAGE
|
||||
try:
|
||||
row = Workout.objects.get(id=id)
|
||||
except Workout.DoesNotExist:
|
||||
@@ -5876,28 +5878,28 @@ def workout_workflow_view(request,id):
|
||||
|
||||
charts = []
|
||||
|
||||
if favorites:
|
||||
for f in favorites:
|
||||
workstrokesonly = not f.reststrokes
|
||||
script,div = thumbnail_flex_chart(id=id,promember=promember,
|
||||
xparam=f.xparam,
|
||||
yparam1=f.yparam1,
|
||||
yparam2=f.yparam2,
|
||||
plottype=f.plottype,
|
||||
workstrokesonly=workstrokesonly)
|
||||
|
||||
charts.append({
|
||||
'script':script,
|
||||
'div':div,
|
||||
'notes':f.notes})
|
||||
if favorites:
|
||||
charts = thumbnails_set(r,id,favorites)
|
||||
|
||||
statcharts = GraphImage.objects.filter(workout=row)
|
||||
|
||||
# This will be user configurable in the future
|
||||
middleTemplates = ['panel_statcharts.html','flexthumbnails.html',
|
||||
'panel_summary.html']
|
||||
leftTemplates = [
|
||||
'panel_editbuttons.html','panel_staticchart.html',
|
||||
'panel_stats.html'
|
||||
]
|
||||
|
||||
return render(request,
|
||||
'workflow.html',
|
||||
{
|
||||
'middleTemplates':middleTemplates,
|
||||
'leftTemplates':leftTemplates,
|
||||
'charts':charts,
|
||||
'workout':row,
|
||||
})
|
||||
'statcharts':statcharts,
|
||||
})
|
||||
|
||||
# The famous flex chart
|
||||
def workout_flexchart3_view(request,*args,**kwargs):
|
||||
@@ -6810,7 +6812,10 @@ def workout_add_chart_view(request,id,plotnr=1):
|
||||
imagename=imagename)
|
||||
|
||||
|
||||
url = "/rowers/workout/"+str(w.id)+"/edit"
|
||||
try:
|
||||
url = request.session['referer']
|
||||
except KeyError:
|
||||
url = "/rowers/workout/"+str(w.id)+"/edit"
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user