improved search forms
This commit is contained in:
@@ -5336,6 +5336,9 @@ def workouts_join_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -5358,6 +5361,7 @@ def workouts_join_select(request,
|
||||
return render(request, 'workout_join_select.html',
|
||||
{'workouts': workouts,
|
||||
'dateform':dateform,
|
||||
'searchform':searchform,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
'active':'nav-workouts',
|
||||
@@ -5510,6 +5514,9 @@ def team_comparison_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
if id:
|
||||
firstworkout = get_workout(id)
|
||||
@@ -5573,6 +5580,7 @@ def team_comparison_select(request,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
'team':theteam,
|
||||
'searchform':searchform,
|
||||
'form':form,
|
||||
'rower':r,
|
||||
'breadcrumbs':breadcrumbs,
|
||||
@@ -5921,6 +5929,9 @@ def user_multiflex_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -5975,6 +5986,7 @@ def user_multiflex_select(request,
|
||||
'rower':r,
|
||||
'form':form,
|
||||
'chartform':chartform,
|
||||
'searchform':searchform,
|
||||
'modalityform':modalityform,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
@@ -6551,6 +6563,9 @@ def user_boxplot_select(request,
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
@@ -6592,6 +6607,7 @@ def user_boxplot_select(request,
|
||||
'form':form,
|
||||
'active':'nav-analysis',
|
||||
'chartform':chartform,
|
||||
'searchform':searchform,
|
||||
'optionsform':optionsform,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
@@ -6834,10 +6850,14 @@ def courses_view(request):
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
return render(request,'list_courses.html',
|
||||
{'courses':courses,
|
||||
'active':'nav-racing',
|
||||
'searchform':searchform,
|
||||
'rower':r,
|
||||
})
|
||||
|
||||
@@ -7108,6 +7128,9 @@ def workout_comparison_list(request,id=0,message='',successmessage='',
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,15) # show 25 workouts per page
|
||||
page = request.GET.get('page')
|
||||
@@ -7130,6 +7153,7 @@ def workout_comparison_list(request,id=0,message='',successmessage='',
|
||||
'workouts': workouts,
|
||||
'last_name':u.last_name,
|
||||
'first_name':u.first_name,
|
||||
'searchform':searchform,
|
||||
'dateform':dateform,
|
||||
'startdate':startdate,
|
||||
'enddate':enddate,
|
||||
@@ -7189,7 +7213,10 @@ def workout_fusion_list(request,id=0,message='',successmessage='',
|
||||
(Q(name__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
paginator = Paginator(workouts,15) # show 25 workouts per page
|
||||
page = request.GET.get('page')
|
||||
@@ -7225,6 +7252,7 @@ def workout_fusion_list(request,id=0,message='',successmessage='',
|
||||
{'id':int(id),
|
||||
'workout':row,
|
||||
'rower':r,
|
||||
'searchform':searchform,
|
||||
'active':'nav-workouts',
|
||||
'breadcrumbs':breadcrumbs,
|
||||
'workouts': workouts,
|
||||
@@ -12067,6 +12095,9 @@ def graphs_view(request):
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
searchform = SearchForm(initial={'q':query})
|
||||
else:
|
||||
searchform = SearchForm()
|
||||
|
||||
g = GraphImage.objects.filter(workout__in=workouts).order_by("-creationdatetime")
|
||||
|
||||
@@ -12083,6 +12114,7 @@ def graphs_view(request):
|
||||
|
||||
return render(request, 'list_graphs.html',
|
||||
{'graphs': g,
|
||||
'searchform':searchform,
|
||||
'active':'nav-workouts',
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user