diff --git a/orp/core/forms.py b/orp/core/forms.py index f84f8b4..f01a66c 100644 --- a/orp/core/forms.py +++ b/orp/core/forms.py @@ -25,15 +25,15 @@ class RegulationSearchForm(forms.Form): for regulations by name or description. """ - query = forms.CharField( + search = forms.CharField( required=False, label="Search", help_text="", widget=forms.TextInput( attrs={ "class": "govuk-input", - "id": "query", - "name": "query", + "id": "search", + "name": "search", "type": "search", "placeholder": "", } diff --git a/orp/core/templatetags/url_replace_tags.py b/orp/core/templatetags/url_replace_tags.py new file mode 100644 index 0000000..24a4758 --- /dev/null +++ b/orp/core/templatetags/url_replace_tags.py @@ -0,0 +1,10 @@ +from django import template + +register = template.Library() + + +@register.simple_tag(takes_context=False) +def url_replace(request, field, value): + dict_ = request.GET.copy() + dict_[field] = value + return dict_.urlencode() diff --git a/orp/orp_search/templates/document.html b/orp/orp_search/templates/document.html index c7a9865..d9a6e6b 100644 --- a/orp/orp_search/templates/document.html +++ b/orp/orp_search/templates/document.html @@ -70,18 +70,21 @@