diff --git a/backend/dissemination/forms.py b/backend/dissemination/forms.py index bc3e41673e..5db043b3ea 100644 --- a/backend/dissemination/forms.py +++ b/backend/dissemination/forms.py @@ -6,6 +6,7 @@ class SearchForm(forms.Form): (x, str(x)) for x in range(2016, 2024) ) # ((2016, "2016"), (2017, "2017"), ..., (2023, "2023")) + # Query params entity_name = forms.CharField(required=False) uei_or_ein = forms.CharField(required=False) aln = forms.CharField(required=False) @@ -14,3 +15,7 @@ class SearchForm(forms.Form): cog_or_oversight = forms.CharField(required=False) agency_name = forms.CharField(required=False) audit_year = forms.MultipleChoiceField(choices=AY_choices, required=False) + + # Display params + limit = forms.CharField(required=False) + page = forms.CharField(required=False) diff --git a/backend/dissemination/search.py b/backend/dissemination/search.py index a0a63a4bbe..2d264fe268 100644 --- a/backend/dissemination/search.py +++ b/backend/dissemination/search.py @@ -49,6 +49,6 @@ def search_general( fiscal_year_match = Q(audit_year__in=audit_years) query.add(fiscal_year_match, Q.AND) - results = General.objects.filter(query) + results = General.objects.filter(query).order_by("-fac_accepted_date") return results diff --git a/backend/dissemination/templates/search.html b/backend/dissemination/templates/search.html index e0308a37c6..0017b70ddf 100644 --- a/backend/dissemination/templates/search.html +++ b/backend/dissemination/templates/search.html @@ -42,14 +42,14 @@
+ Use the arrows at the top of each column to sort results. Sorting only applies to the results shown per page. +
+Acc Date | AY | Cog or Over | -View | -View | +||
---|---|---|---|---|---|---|
{{ result.auditee_name }} | {{ result.auditee_uei }} | -{{ result.fac_accepted_date }} | + {% comment %} Sorts ascending/descending by the numeric date string (i.e. 20231231) {% endcomment %} +{{ result.fac_accepted_date }} + | {{ result.audit_year }} |
{% if result.oversight_agency %}
@@ -168,11 +186,13 @@ Search single audit reports |
-
+
@@ -183,70 +203,53 @@ Search single audit reports |
- Enter your filters and select Search to begin -
+ {% if results.has_previous %} ++ Enter your filters and select Search to begin +
+