|
17 | 17 | <div class="nhsuk-grid-row"> |
18 | 18 | <div class="nhsuk-grid-column-two-thirds"> |
19 | 19 |
|
| 20 | + {% if (errors | length) > 0 %} |
| 21 | + {{ errorSummary({ |
| 22 | + titleText: "There is a problem", |
| 23 | + errorList: errors |
| 24 | + }) }} |
| 25 | + {% endif %} |
| 26 | + |
20 | 27 | <h1 class="nhsuk-heading-l">{{ pageName }}</h1> |
21 | 28 |
|
22 | 29 | <p>You can sign up if you are a community pharmacy offering NHS vaccinations.</p> |
23 | 30 |
|
24 | 31 | <p>If you need to sign up for more than 1 pharmacy, you can use this form multiple times or <a href="/contact">contact us</a>.</li> |
25 | 32 | </p> |
26 | 33 |
|
27 | | - <form action="/apply/check-pharmacy" method="post"> |
28 | | - |
29 | | - |
30 | | - <div class="nhsuk-form-group"> |
31 | | - <h2 class="nhsuk-label-wrapper"> |
32 | | - <label class="nhsuk-label nhsuk-label--m nhsuk-u-margin-bottom-1" for="organisationCode"> |
33 | | - Find your pharmacy |
34 | | - </label> |
35 | | - </h2> |
36 | | - <div class="nhsuk-hint" id="organisationName-hint"> |
37 | | - Search by name or ODS code |
38 | | - </div> |
39 | | - <select class="nhsuk-select" id="organisationCode" name="organisationCode" |
40 | | - data-module="autocomplete" data-autoselect="" data-display-menu="" data-min-length="" data-show-all-values="" data-show-no-options-found=""> |
41 | | - <option selected value=""></option> |
42 | | - |
43 | | - {% set options = [] %} |
44 | | - |
45 | | - {% for organisation in data.organisations %} |
46 | | - {% if organisation.type == "Community Pharmacy" %} |
47 | | - {% set options = (options.push({ |
48 | | - label: organisation.name + ", " + organisation.address.line1 + ", " + (organisation.address.postcode | upper) + " (" + organisation.id + ")", |
49 | | - value: organisation.id |
50 | | - }), options) %} |
51 | | - {% endif %} |
52 | | - {% endfor %} |
53 | | - |
54 | | - {% for option in (options | sort(false, true, "label")) %} |
55 | | - <option value="{{ option.value }}">{{ option.label }}</option> |
56 | | - {% endfor %} |
57 | | - </select> |
58 | | - </div> |
| 34 | + <form action="/apply/answer-pharmacy" method="post"> |
| 35 | + |
| 36 | + {% set options = [] %} |
| 37 | + {% set items = [{ text: "", value: ""}] %} |
| 38 | + |
| 39 | + {% for organisation in data.organisations %} |
| 40 | + {% if organisation.type == "Community Pharmacy" %} |
| 41 | + {% set items = (items.push({ |
| 42 | + text: organisation.name + ", " + organisation.address.line1 + ", " + (organisation.address.postcode | upper) + " (" + organisation.id + ")", |
| 43 | + value: organisation.id, |
| 44 | + selected: (organisation.id === data.organisationCode) |
| 45 | + }), items) %} |
| 46 | + {% endif %} |
| 47 | + {% endfor %} |
| 48 | + |
| 49 | + {{ select({ |
| 50 | + id: "organisation-code", |
| 51 | + name: "organisationCode", |
| 52 | + label: { |
| 53 | + text: "Find your pharmacy", |
| 54 | + classes: "nhsuk-label--m nhsuk-u-margin-bottom-1" |
| 55 | + }, |
| 56 | + hint: { |
| 57 | + text: "Search by name or ODS code" |
| 58 | + }, |
| 59 | + items: items, |
| 60 | + errorMessage: { |
| 61 | + text: (errors | first).text |
| 62 | + } if (errors | length), |
| 63 | + attributes: { |
| 64 | + "data-module": "autocomplete" |
| 65 | + } |
| 66 | + }) }} |
59 | 67 |
|
60 | 68 | {{ button({ |
61 | 69 | "text": "Continue" |
|
0 commit comments