Convert SearchFields to GovukSearchFields

Changes those fields in the following forms:
- SearchByNameForm
- SearchUsersByEmailForm
- SearchUsersForm
- SearchNotificationsForm

Includes changes to templates that use this form
and associated tests.
This commit is contained in:
Tom Byers
2020-08-07 10:16:24 +01:00
parent f95d57cfde
commit d21b9475ba
11 changed files with 37 additions and 44 deletions

View File

@@ -19,11 +19,9 @@
class='govuk-grid-row'
) %}
<div class="govuk-grid-column-three-quarters">
{{ textbox(
form.search,
width='1-1',
label='Find services by name, or by partial name'
) }}
{{ form.search(param_extensions={
"label": {"text": "Find services by name, or by partial name"}
}) }}
</div>
<div class="govuk-grid-column-one-quarter">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">

View File

@@ -19,11 +19,9 @@
class='govuk-grid-row'
) %}
<div class="govuk-grid-column-three-quarters">
{{ textbox(
form.search,
width='1-1',
label='Find users by email, or by partial email'
) }}
{{ form.search(param_extensions={
"label": {"text": "Find users by email, or by partial email"}
}) }}
</div>
<div class="govuk-grid-column-one-quarter">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">

View File

@@ -41,17 +41,17 @@
class="govuk-grid-row"
) %}
<div class="govuk-grid-column-three-quarters {% if message_type == 'sms' %}extra-tracking{% endif %}">
{{ textbox(
search_form.to,
width='1-1',
label=things_you_can_search_by|formatted_list(
conjunction='or',
before_each='',
after_each='',
prefix='Search by',
prefix_plural='Search by'
)
) }}
{{ search_form.to(param_extensions={
"label": {
"text": things_you_can_search_by|formatted_list(
conjunction='or',
before_each='',
after_each='',
prefix='Search by',
prefix_plural='Search by'
)
}
}) }}
</div>
<div class="govuk-grid-column-one-quarter">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
@@ -63,7 +63,7 @@
{% endcall %}
{% call form_wrapper(id="search-form") %}
<input type="hidden" name="to" value="{{ search_form.to.data }}">
<input type="hidden" name="to" {% if search_form.to.data %}value="{{ search_form.to.data }}{% endif %}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% endcall %}

View File

@@ -35,7 +35,7 @@
{% else %}
{{ live_search(target_selector='#template-list .govuk-grid-column-full', show=True, form=search_form) }}
{{ live_search(target_selector='#template-list .template-list-item', show=True, form=search_form) }}
<nav id="template-list">
{% for item in templates_and_folders %}