Skip to content

Commit b8c55cb

Browse files
Fix: show other vaccinator name in Check answers (#170)
1 parent 418d002 commit b8c55cb

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

app/views/vaccinate/check.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h2 class="nhsuk-heading-m">Vaccination</h2>
177177
text: "Vaccinator"
178178
},
179179
value: {
180-
html: data.vaccinator
180+
html: (data.otherVaccinator if data.vaccinator == "Someone else" else data.vaccinator)
181181
},
182182
actions: {
183183
items: [

app/views/vaccinate/vaccinator.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,31 @@
2828

2929
<form action="/vaccinate/answer-vaccinator" method="post" novalidate>
3030

31+
{% set otherVaccinators = [
32+
{name: "James Bloggs", email: "[email protected]" },
33+
{name: "James Smith", email: "[email protected]" },
34+
{name: "Joan Jacobs", email: "[email protected]" }
35+
] %}
36+
3137
{% set otherVaccinatorHtml %}
3238
<div class="nhsuk-form-group">
3339
<h1 class="nhsuk-label-wrapper">
34-
<label class="nhsuk-label nhsuk-label--s nhsuk-u-margin-bottom-1" for="organisationCode">
40+
<label class="nhsuk-label nhsuk-label--s nhsuk-u-margin-bottom-1" for="otherVaccinator">
3541
Vaccinator
3642
</label>
3743
</h1>
3844
<div class="nhsuk-hint" id="organisationName-hint">
3945
Search by name
4046
</div>
41-
<select class="nhsuk-select" id="siteCode" name="siteCode"
47+
48+
<select class="nhsuk-select" id="otherVaccinator" name="otherVaccinator"
4249
data-module="autocomplete" data-autoselect="" data-display-menu="" data-min-length="" data-show-all-values="" data-show-no-options-found="">
43-
<option selected value=""></option>
50+
<option {{ "selected" if data.otherVaccinator == "" }} value=""></option>
4451

45-
<option value="James Bloggs">James Bloggs ([email protected])</option>
46-
<option value="James Smith">James Smith ([email protected])</option>
47-
<option value="Joan Jacobs">Joan Jacobs ([email protected])</option>
52+
{% for otherVaccinator in otherVaccinators %}
53+
<option {{ "selected" if data.otherVaccinator == otherVaccinator.name }}
54+
value="{{ otherVaccinator.name }}">{{ otherVaccinator.name }} ({{ otherVaccinator.email}})</option>
55+
{% endfor %}
4856
</select>
4957
</div>
5058
{% endset %}
@@ -77,7 +85,7 @@ <h1 class="nhsuk-label-wrapper">
7785
divider: "or"
7886
},
7987
{
80-
value: "no",
88+
value: "Someone else",
8189
text: "Someone else",
8290
checked: (data.vaccinator === "Someone else"),
8391
conditional: {

0 commit comments

Comments
 (0)