Skip to content

Commit 4781525

Browse files
Add survey to reports page (#360)
This adds our feedback survey to the Reports feature. It would show up when the user has downloaded their 5th report (after the reports get changed slightly): <img width="1014" alt="Screenshot 2025-06-18 at 18 39 09" src="https://github.com/user-attachments/assets/ba443fa1-98e9-4973-bf3b-0a26186d32a2" /> When selecting an answer, an optional free text field gets revealed: <img width="1006" alt="Screenshot 2025-06-18 at 18 39 19" src="https://github.com/user-attachments/assets/6b8a3489-f211-4a9c-a0c8-19a15020bd9b" />
1 parent 42f667c commit 4781525

File tree

2 files changed

+97
-8
lines changed

2 files changed

+97
-8
lines changed

app/views/reports/_feedback.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
{% block head %}
3+
<script src="/js/feedback-panel.js"></script>
4+
{% endblock %}
5+
6+
{% from 'checkboxes/macro.njk' import checkboxes %}
7+
<div class="app-feedback-panel" data-module="feedback-panel">
8+
<div data-module="feedback-panel__initial-question">
9+
<h2 class="app-feedback-panel__title">You’ve just created your 5th report since 10 June 2025</h2>
10+
11+
12+
<fieldset class="nhsuk-fieldset">
13+
<legend class="nhsuk-fieldset__legend nhsuk-u-margin-bottom-4">How was your experience creating reports?</legend>
14+
15+
<div class="app-button-group nhsuk-u-margin-bottom-0">
16+
17+
{{ button({
18+
text: "Very easy",
19+
classes: "nhsuk-button--secondary app-button--small app-button--min-width",
20+
attributes: {
21+
"data-thanks": "Thank you. Do you want to tell us more?"
22+
}
23+
}) }}
24+
25+
{{ button({
26+
text: "Easy",
27+
classes: "nhsuk-button--secondary app-button--small app-button--min-width",
28+
attributes: {
29+
"data-thanks": "Thank you. Do you want to tell us more?"
30+
}
31+
}) }}
32+
33+
{{ button({
34+
text: "Ok",
35+
classes: "nhsuk-button--secondary app-button--small app-button--min-width",
36+
attributes: {
37+
"data-thanks": "Thank you. Do you want to tell us more?"
38+
}
39+
}) }}
40+
41+
{{ button({
42+
text: "Difficult",
43+
classes: "nhsuk-button--secondary app-button--small app-button--min-width",
44+
attributes: {
45+
"data-thanks": "Thank you. Do you want to tell us more?"
46+
}
47+
}) }}
48+
49+
{{ button({
50+
text: "Very difficult",
51+
classes: "nhsuk-button--secondary app-button--small app-button--min-width",
52+
attributes: {
53+
"data-thanks": "Thank you. Do you want to tell us more?"
54+
}
55+
}) }}
56+
</div>
57+
</fieldset>
58+
</div>
59+
60+
<div class="app-feedback-panel__comments" data-module="feedback-panel__comments" hidden>
61+
62+
<h2 class="app-feedback-panel__title">Thank you.</h2>
63+
{{ textarea({
64+
name: "example",
65+
id: "example",
66+
rows: 3,
67+
label: {
68+
text: "Feedback (optional)"
69+
}
70+
}) }}
71+
72+
{{ checkboxes({
73+
items: [
74+
{
75+
value: "contactable",
76+
text: "I’m happy to be contacted about my feedback"
77+
}
78+
]
79+
})}}
80+
81+
82+
<div class="app-button-group nhsuk-u-margin-bottom-0">
83+
{{ button({
84+
text: "Send feedback",
85+
classes: "nhsuk-button--secondary"
86+
}) }}
87+
88+
<a href="#" class="nhsuk-link nhsuk-link--no-visited-state" data-module="feedback-panel__close">Close</a>
89+
</div>
90+
91+
</div>
92+
</div>

app/views/reports/download.html

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,13 @@
55
{% set currentSection = "reports" %}
66

77

8-
{% block beforeContent %}
9-
{{ backLink({
10-
href: "/reports/check",
11-
text: "Back"
12-
}) }}
13-
{% endblock %}
14-
158
{% block content %}
169
<div class="nhsuk-grid-row">
1710
<div class="nhsuk-grid-column-two-thirds">
1811

19-
<h1 class="nhsuk-heading-xl">Report is ready</h1>
12+
{% include "reports/_feedback.html" %}
13+
14+
<h1 class="nhsuk-heading-l">Report is ready</h1>
2015

2116
<p class="nhsuk-body-l">You have created a report from 16 July to 30 July 2024 for COVID-19 and Flu at Verrington (RH635)</p>
2217

@@ -25,6 +20,8 @@ <h1 class="nhsuk-heading-xl">Report is ready</h1>
2520
"href": "/reports"
2621
}) }}
2722

23+
<p><a href="/reports">Create a new report</a></p>
24+
2825

2926
</div>
3027
</div>

0 commit comments

Comments
 (0)