diff --git a/rowers/views.py b/rowers/views.py index a025f86e..67715fb1 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -3692,13 +3692,27 @@ def workout_comment_view(request,id=0): return HttpResponseRedirect(url) form = WorkoutCommentForm() - - return render(request, - 'workout_comments.html', - {'workout':w, - 'comments':comments, - 'form':form, - }) + + g = GraphImage.objects.filter(workout=row).order_by("-creationdatetime") + + if (len(g)<=3): + return render(request, + 'workout_comments.html', + {'workout':w, + 'graphs1':g[0:3], + 'comments':comments, + 'form':form, + }) + else: + return render(request, + 'workout_comments.html', + {'workout':w, + 'graphs1':g[0:3], + 'graphs1':g[3:6], + 'comments':comments, + 'form':form, + }) + # The basic edit page @login_required()