v1 of workflow.html - need speed up chart generation
This commit is contained in:
@@ -5846,7 +5846,59 @@ def workout_comparison_view2(request,id1=0,id2=0,xparam='distance',
|
||||
'promember':promember,
|
||||
})
|
||||
|
||||
|
||||
|
||||
# Flex thumbnails
|
||||
@login_required()
|
||||
def workout_workflow_view(request,id):
|
||||
try:
|
||||
row = Workout.objects.get(id=id)
|
||||
except Workout.DoesNotExist:
|
||||
raise Http404("Workout doesn't exist")
|
||||
|
||||
r = getrower(request.user)
|
||||
result = request.user.is_authenticated() and ispromember(request.user)
|
||||
if result:
|
||||
promember=1
|
||||
if request.user == row.user.user:
|
||||
mayedit=1
|
||||
|
||||
workouttype = 'ote'
|
||||
if row.workouttype in ('water','coastal'):
|
||||
workouttype = 'otw'
|
||||
|
||||
try:
|
||||
favorites = FavoriteChart.objects.filter(user=r,
|
||||
workouttype__in=[workouttype,'both']).order_by("id")
|
||||
maxfav = len(favorites)-1
|
||||
except:
|
||||
favorites = None
|
||||
maxfav = 0
|
||||
|
||||
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})
|
||||
|
||||
|
||||
return render(request,
|
||||
'workflow.html',
|
||||
{
|
||||
'charts':charts,
|
||||
'workout':row,
|
||||
})
|
||||
|
||||
# The famous flex chart
|
||||
def workout_flexchart3_view(request,*args,**kwargs):
|
||||
|
||||
@@ -5978,12 +6030,6 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
||||
css_resources = ""
|
||||
|
||||
|
||||
# script = res[0]
|
||||
# div = res[1]
|
||||
# js_resources = res[2]
|
||||
# css_resources = res[3]
|
||||
|
||||
|
||||
axchoicesbasic = {ax[0]:ax[1] for ax in axes if ax[4]=='basic'}
|
||||
axchoicespro = {ax[0]:ax[1] for ax in axes if ax[4]=='pro'}
|
||||
noylist = ["time","distance"]
|
||||
|
||||
Reference in New Issue
Block a user