Skip to content
Snippets Groups Projects
Commit 76c9cf68 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Change default search to superevent

The 'search' and 'latest' pages will now default to superevents
rather than events.
parent f2d67f74
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ class MainSearchForm(forms.Form):
query = forms.CharField(required=False, widget=forms.TextInput(
attrs={'size': 60}))
query_type = forms.ChoiceField(required=True,
choices=QUERY_TYPE_CHOICES, label="Search for", initial='E')
choices=QUERY_TYPE_CHOICES, label="Search for", initial='S')
get_neighbors = forms.BooleanField(required=False,
help_text="(Events only)")
results_format = forms.ChoiceField(required=False, initial='S',
......
......@@ -72,6 +72,7 @@ def search(request):
context['query_type'] = query_type
context['get_neighbors'] = get_neighbors
else:
# Initial page with no query
form = MainSearchForm()
# Update context
......@@ -89,7 +90,7 @@ def latest(request):
if "query" in request.GET:
form = MainSearchForm(request.GET)
else:
form = MainSearchForm({'query': "", 'query_type': 'E'})
form = MainSearchForm({'query': "", 'query_type': 'S'})
# Hide get_neighbors widget
form.fields['get_neighbors'].widget = forms.HiddenInput()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment