6868 < td class ="nhsuk-table__cell " role ="cell ">
6969 < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Date time </ span > {{ session.date | nhsDate }}< br > {{ session.from | nhsTime }} to {{ session.until | nhsTime }}
7070 </ td >
71- < td class ="nhsuk-table__cell " role ="cell ">
72- < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Services </ span >
73- {% for serviceId in session.services %}
74- {{ data.services[serviceId].name }}{% if not loop.last %}< br > {% endif %}
75- {% endfor %}
76- </ td >
77- < td class ="nhsuk-table__cell " role ="cell ">
78- < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Bookings </ span >
71+ < td class ="nhsuk-table__cell " role ="cell " colspan ="2 ">
72+ < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Services and bookings </ span >
7973 {% set bookingCount = 0 %}
8074 {% for booking in bookings %}
8175 {% if booking.datetime | formatDate('yyyy-MM-dd') == session.date and booking.status == "scheduled" and booking.datetime | isTimeBetween(session.from, session.until) %}
8276 {% set bookingCount = bookingCount + 1 %}
8377 {% endif %}
8478 {% endfor %}
85- {{ bookingCount }}
79+ {% set displayBookings = 1 %}
80+ < ul class ="nhsuk-list ">
81+ {% for serviceId in session.services %}
82+ < li >
83+ {{ data.services[serviceId].name }}
84+ {{ displayBookings }}
85+ </ li >
86+ {% endfor %}
87+ {% if bookingCount > displayBookings %}{{ displayBookings - 1 }}{% endif %}
88+ </ ul >
8689 </ td >
8790 < td class ="nhsuk-table__cell " role ="cell ">
8891 < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Unbooked </ span >
99102</ table >
100103{% endmacro %}
101104
102- {% macro sessionsTable(sessions) %}
103- < table class ="nhsuk-table-responsive " role ="table ">
104- < caption class ="nhsuk-table__caption ">
105- Sessions details
106- </ caption >
107- < thead class ="nhsuk-table__head " role ="rowgroup ">
108- < tr class ="nhsuk-table__row " role ="row ">
109- < th scope ="col " class ="nhsuk-table__header nhsuk-u-width-one-quarter " role ="columnheader "> Date and time</ th >
110- < th scope ="col " class ="nhsuk-table__header nhsuk-u-width-one-quarter " role ="columnheader "> Services</ th >
111- </ tr >
112- </ thead >
113- < tbody class ="nhsuk-table__body ">
114- {% for session in sessions %}
115- < tr class ="nhsuk-table__row " role ="row ">
116- < td class ="nhsuk-table__cell " role ="cell ">
117- < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Date time </ span > {{ session.date | nhsDate }}< br > {{ session.from | nhsTime }} to {{ session.until | nhsTime }}
118- </ td >
119- < td class ="nhsuk-table__cell " role ="cell ">
120- < span class ="nhsuk-table-responsive__heading " aria-hidden ="true "> Services </ span >
121- {% for serviceId in session.services %}
122- {{ data.services[serviceId].name }}{% if not loop.last %}< br > {% endif %}
123- {% endfor %}
124- </ td >
125- </ tr >
126- {% endfor %}
127- </ tbody >
128- </ table >
129- {% endmacro %}
130-
131- {% set pageName = "You are about to cancel " ~affectedSessions|length~ " sessions"%}
105+ {% set pageName = "You are about to cancel " ~affectedSessions|length~ " "~ 'session' | plural(affectedSessions | length) %}
132106
133107{% block beforeContent %}
134108{{ backLink({
135109 href: '/site/' + site_id + '/cancel-availability/dates'
136110}) }}
137111{% endblock %}
138112
139- {% set secondParagraph = "Bookings you keep appear in your appointments list. We automatically move them into new sessions when you add matching availability." %}
140- {% if content == '2' %}
141- {% set secondParagraph = "By cancelling these sessions, these bookings will be unsupported by a session but they will still appear in your scheduled list of appointments." %}
142- {% endif %}
143- {% if content == '3' %}
144- {% set secondParagraph = "Any bookings you keep will appear in your scheduled list of appointments and these bookings will unsupported by a session unless a new session is created." %}
145- {% endif %}
146-
147113{% block content %}
148114< div class ="nhsuk-grid-row ">
149115 < div class ="nhsuk-grid-column-full ">
150116 < h1 class ="nhsuk-heading-l "> {{ pageName }}</ h1 >
151117 {% if affectedBookings|length > 0 %}
152- < p class ="nhsuk-u-width-two-thirds "> There are {{ affectedBookings | length }} bookings for these sessions.</ p >
153- < p class ="nhsuk-u-width-two-thirds "> {{ secondParagraph }}</ p >
154- {% if affectedSessions|length > 10 %}
155- {% call details({
156- summaryText: "View sessions and bookings",
157- classes: "nhsuk-expander"
158- }) %}
159- {{ sessionsAndBookings(affectedSessions, affectedBookings) }}
160- {% endcall %}
161- {% else %}
162- {{ sessionsAndBookings(affectedSessions, affectedBookings) }}
163- {% endif %}
118+ < p class ="nhsuk-u-width-two-thirds "> There are {{ affectedBookings | length }} bookings for these {{ 'session' | plural(affectedSessions | length) }}</ p >
119+
120+ {% call details({
121+ summaryText: "View sessions and bookings",
122+ classes: "nhsuk-expander"
123+ }) %}
124+ {{ sessionsAndBookings(affectedSessions, affectedBookings) }}
125+ {% endcall %}
164126
165127 < form method ="post " action ="/site/{{ site_id }}/cancel-availability/check-answers " class ="nhsuk-u-width-two-thirds ">
166128 < input type ="hidden " name ="[cancelAvailability][affectedSessions] " value ="{{ affectedSessions | length }} ">
@@ -178,12 +140,18 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
178140 {
179141 value: "keep",
180142 text: "Keep bookings",
181- checked: true if data.cancelAvailability.keepOrCancelBookings == 'keep'
143+ checked: true if data.cancelAvailability.keepOrCancelBookings == 'keep',
144+ hint: {
145+ text: "These will stay in your appointments list"
146+ }
182147 },
183148 {
184149 value: "cancel",
185150 text: "Cancel bookings",
186- checked: true if data.cancelAvailability.keepOrCancelBookings == 'cancel'
151+ checked: true if data.cancelAvailability.keepOrCancelBookings == 'cancel',
152+ hint: {
153+ text: "We will email or text them to confirm the cancellation"
154+ }
187155 }
188156 ]
189157 }) }}
@@ -193,17 +161,14 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>
193161 </ form >
194162
195163 {% else %}
164+
196165 < p > There are no bookings for these sessions.</ p >
197- {% if affectedSessions|length > 10 %}
198166 {% call details({
199167 summaryText: "View sessions",
200168 classes: "nhsuk-expander"
201169 }) %}
202- {{ sessionsTable (affectedSessions) }}
170+ {{ sessionsAndBookings (affectedSessions, affectedBookings ) }}
203171 {% endcall %}
204- {% else %}
205- {{ sessionsTable(affectedSessions) }}
206- {% endif %}
207172 {{
208173 button({
209174 text: "Continue",
0 commit comments