diff --git a/orp/core/forms.py b/orp/core/forms.py index c91253f..f84f8b4 100644 --- a/orp/core/forms.py +++ b/orp/core/forms.py @@ -47,12 +47,32 @@ class RegulationSearchForm(forms.Form): ("guidance", "Guidance"), ("standard", "British Standard"), ], - widget=forms.CheckboxSelectMultiple( - attrs={ - "class": "govuk-checkboxes__input", - "data-module": "govuk-checkboxes", - } - ), - label="Select document types", - help_text="You can select multiple document types.", + # widget=forms.CheckboxSelectMultiple( + # attrs={ + # "class": "govuk-checkboxes__input", + # "data-module": "govuk-checkboxes", + # } + # ), + # label="Select document types", + # help_text="You can select multiple document types.", + ) + + publisher = forms.MultipleChoiceField( + required=False, + choices=[ + ("healthandsafetyexecutive", "Health and Safety Executive"), + ("civilaviationauthority", "Civil Aviation Authority"), + ("environmentagency", "Environment Agency"), + ("defra", "Defra"), + ( + "officeofgasandelectricitymarkets", + "Office of Gas and Electricity Markets", + ), + ("officeofrailandroad", "Office of Rail and Road"), + ("naturalengland", "Natural England"), + ("historicengland", "Historic England"), + ("nationalhighways", "National Highways"), + ("homesengland", "Homes England"), + ("departmentfortransport", "Department for Transport"), + ], ) diff --git a/orp/orp_search/public_gateway.py b/orp/orp_search/public_gateway.py index 7c82a94..9128804 100644 --- a/orp/orp_search/public_gateway.py +++ b/orp/orp_search/public_gateway.py @@ -87,6 +87,7 @@ def finalise_results( context["paginator"] = paginator context["is_paginated"] = paginator.num_pages > 1 context["results"] = paginated_documents + context["results_count"] = len(paginated_documents) context["results_total_count"] = paginator.count context["results_page_total"] = paginator.num_pages context["current_page"] = config.offset diff --git a/orp/orp_search/templates/orp.html b/orp/orp_search/templates/orp.html index 20c90e8..f736a87 100644 --- a/orp/orp_search/templates/orp.html +++ b/orp/orp_search/templates/orp.html @@ -61,21 +61,21 @@

+ value="legislation" {% if 'legislation' in form.document_type.value %}checked{% endif %}>
+ value="guidance" {% if 'guidance' in form.document_type.value %}checked{% endif %}>
+ value="standard" {% if 'standard' in form.document_type.value %}checked{% endif %}> @@ -94,89 +94,91 @@

-
-
-
+ + +
+ value="healthandsafetyexecutive" {% if 'healthandsafetyexecutive' in form.publisher.value %}checked{% endif %}>
+ value="civilaviationauthority" {% if 'civilaviationauthority' in form.publisher.value %}checked{% endif %}>
+ value="environmentagency" {% if 'environmentagency' in form.publisher.value %}checked{% endif %}>
- +
+ value="officeofgasandelectricitymarkets" {% if 'officeofgasandelectricitymarkets' in form.publisher.value %}checked{% endif %}>
+ value="officeofrailandroad" {% if 'officeofrailandroad' in form.publisher.value %}checked{% endif %}>
+ value="naturalengland" {% if 'naturalengland' in form.publisher.value %}checked{% endif %}>
+ value="historicengland" {% if 'historicengland' in form.publisher.value %}checked{% endif %}>
+ value="nationalhighways" {% if 'nationalhighways' in form.publisher.value %}checked{% endif %}>
+ value="homesengland" {% if 'homesengland' in form.publisher.value %}checked{% endif %}>
+ value="departmentfortransport" {% if 'departmentfortransport' in form.publisher.value %}checked{% endif %}> @@ -201,7 +203,7 @@