diff --git a/app/routes.js b/app/routes.js index 378f7c5..ef859cb 100644 --- a/app/routes.js +++ b/app/routes.js @@ -230,7 +230,19 @@ const sanitizeOrganisedSlots = (slotData) => { .filter(slot => slot.key) } -router.post('/clinics-schedules/01-create-schedule', function (req, res) { +// Lets the "create a clinic" workflow pages also work when duplicated under z-older-versions/, +// keeping session-driven rendering (e.g. calendars) and redirects on the same copy of the pages. +const OLDER_VERSIONS_PREFIX = '/clinics-schedules/z-older-versions/' + +const isOlderVersionsRequest = (req) => req.path.startsWith(OLDER_VERSIONS_PREFIX) + +const clinicsScheduleView = (req, name) => + isOlderVersionsRequest(req) ? `clinics-schedules/z-older-versions/${name}` : `clinics-schedules/${name}` + +const clinicsScheduleRedirect = (req, name) => + isOlderVersionsRequest(req) ? `${OLDER_VERSIONS_PREFIX}${name}` : `/clinics-schedules/${name}` + +router.post(['/clinics-schedules/01-create-schedule', OLDER_VERSIONS_PREFIX + '01-create-schedule'], function (req, res) { const hasScheduleFields = req.body && (req.body.scheduleStartDate || req.body.scheduleEndDate) // Step 00 posts to this route and should move to step 01. @@ -240,7 +252,7 @@ router.post('/clinics-schedules/01-create-schedule', function (req, res) { req.session.data.unit = (req.body && req.body.unit) || '' req.session.data.location = (req.body && req.body.location) || '' - return res.redirect('/clinics-schedules/01-create-schedule') + return res.redirect(clinicsScheduleRedirect(req, '01-create-schedule')) } const scheduleStartDateObj = (req.body && req.body.scheduleStartDate) || {} @@ -261,17 +273,17 @@ router.post('/clinics-schedules/01-create-schedule', function (req, res) { req.session.data.calendars = [] } - res.redirect('/clinics-schedules/02-choose-session-options') + res.redirect(clinicsScheduleRedirect(req, '02-choose-session-options')) }) -router.post('/clinics-schedules/03-create-session', function (req, res) { +router.post(['/clinics-schedules/03-create-session', OLDER_VERSIONS_PREFIX + '03-create-session'], function (req, res) { const createSessionHints = (req.body && req.body.createSessionHints) || '' req.session.data.createSessionHints = createSessionHints - res.redirect('/clinics-schedules/03-create-session') + res.redirect(clinicsScheduleRedirect(req, '03-create-session')) }) -router.get('/clinics-schedules/06-apply-session', function (req, res) { +router.get(['/clinics-schedules/06-apply-session', OLDER_VERSIONS_PREFIX + '06-apply-session'], function (req, res) { const scheduleStartDateObj = (req.session.data && req.session.data.scheduleStartDate) || {} const scheduleEndDateObj = (req.session.data && req.session.data.scheduleEndDate) || {} @@ -329,7 +341,7 @@ router.get('/clinics-schedules/06-apply-session', function (req, res) { } } - res.render('clinics-schedules/06-apply-session') + res.render(clinicsScheduleView(req, '06-apply-session')) }) // ====== session setup handlers @@ -394,7 +406,7 @@ router.post('/sessions/01-set-timings', function (req, res) { res.redirect('/sessions/02-organise-slots') }) -router.post('/clinics-schedules/04-organise-slots', function (req, res) { +router.post(['/clinics-schedules/04-organise-slots', OLDER_VERSIONS_PREFIX + '04-organise-slots'], function (req, res) { const session = (req.body && req.body.newSession) || {} const sessionName = (req.body && req.body.sessionName && req.body.sessionName.trim()) || '' const startTime = session.startTime || {} @@ -451,18 +463,18 @@ router.post('/clinics-schedules/04-organise-slots', function (req, res) { req.session.data.sessionName = sessionName if (Object.keys(errors).length > 0) { - return res.render('clinics-schedules/03-create-session', { + return res.render(clinicsScheduleView(req, '03-create-session'), { errors }) } - res.redirect('/clinics-schedules/04-organise-slots') + res.redirect(clinicsScheduleRedirect(req, '04-organise-slots')) }) -router.get('/clinics-schedules/05-save-as-template', function (req, res) { - res.render('clinics-schedules/05-save-as-template') +router.get(['/clinics-schedules/05-save-as-template', OLDER_VERSIONS_PREFIX + '05-save-as-template'], function (req, res) { + res.render(clinicsScheduleView(req, '05-save-as-template')) }) -router.post('/clinics-schedules/05-save-as-template', function (req, res) { +router.post(['/clinics-schedules/05-save-as-template', OLDER_VERSIONS_PREFIX + '05-save-as-template'], function (req, res) { const saveSessionHints = req.body && req.body.saveSessionHints const slotsAvailableCount = req.body && req.body.slotsAvailableCount @@ -515,24 +527,24 @@ router.post('/clinics-schedules/05-save-as-template', function (req, res) { // Step 4 posts slot data here first; if no choice has been made yet, // send user to step 5 question page instead of skipping to step 6. if (!saveSessionHints) { - return res.redirect('/clinics-schedules/05-save-as-template') + return res.redirect(clinicsScheduleRedirect(req, '05-save-as-template')) } if (saveSessionHints === 'yes') { - return res.redirect('/clinics-schedules/05a-template-details') + return res.redirect(clinicsScheduleRedirect(req, '05a-template-details')) } - res.redirect('/clinics-schedules/06-apply-session') + res.redirect(clinicsScheduleRedirect(req, '06-apply-session')) }) -router.post('/clinics-schedules/06-apply-session', function (req, res) { +router.post(['/clinics-schedules/06-apply-session', OLDER_VERSIONS_PREFIX + '06-apply-session'], function (req, res) { req.session.data.templateName = (req.body && req.body.templateName) || '' req.session.data.templateDescription = (req.body && req.body.templateDescription) || '' - res.redirect('/clinics-schedules/06-apply-session') + res.redirect(clinicsScheduleRedirect(req, '06-apply-session')) }) -router.post('/clinics-schedules/07-schedule-details', function (req, res) { +router.post(['/clinics-schedules/07-schedule-details', OLDER_VERSIONS_PREFIX + '07-schedule-details'], function (req, res) { const selectedSessionDatesJson = req.body && req.body.selectedSessionDatesJson if (selectedSessionDatesJson) { @@ -548,7 +560,7 @@ router.post('/clinics-schedules/07-schedule-details', function (req, res) { req.session.data.selectedSessionDates = [] } - res.redirect('/clinics-schedules/07-schedule-details') + res.redirect(clinicsScheduleRedirect(req, '07-schedule-details')) }) router.get('/clinics-schedules/add-another-session', function (req, res) { @@ -587,7 +599,7 @@ router.get('/clinics-schedules/add-another-schedule', function (req, res) { res.redirect('/clinics-schedules/01-create-schedule') }) -router.get('/clinics-schedules/07-schedule-details', function (req, res) { +router.get(['/clinics-schedules/07-schedule-details', OLDER_VERSIONS_PREFIX + '07-schedule-details'], function (req, res) { const scheduleStartDateObj = (req.session.data && req.session.data.scheduleStartDate) || {} const scheduleEndDateObj = (req.session.data && req.session.data.scheduleEndDate) || {} @@ -640,14 +652,14 @@ router.get('/clinics-schedules/07-schedule-details', function (req, res) { req.session.data.scheduleSessions = scheduleSessions - res.render('clinics-schedules/07-schedule-details', { + res.render(clinicsScheduleView(req, '07-schedule-details'), { scheduleStartDateLabel, scheduleEndDateLabel, scheduleSessions }) }) -router.get('/clinics-schedules/08-publish-clinic', function (req, res) { +router.get(['/clinics-schedules/08-publish-clinic', OLDER_VERSIONS_PREFIX + '08-publish-clinic'], function (req, res) { const scheduleStartDateObj = (req.session.data && req.session.data.scheduleStartDate) || {} const scheduleEndDateObj = (req.session.data && req.session.data.scheduleEndDate) || {} @@ -687,7 +699,7 @@ router.get('/clinics-schedules/08-publish-clinic', function (req, res) { req.session.data.createdSchedules = createdSchedules - res.render('clinics-schedules/08-publish-clinic', { + res.render(clinicsScheduleView(req, '08-publish-clinic'), { clinicName: (req.session.data && req.session.data.clinicName) || '-', clinicId: (req.session.data && req.session.data.clinicId) || 'HWO-NNN-standard-20260501', unit: (req.session.data && req.session.data.unit) || '-', @@ -696,8 +708,8 @@ router.get('/clinics-schedules/08-publish-clinic', function (req, res) { }) }) -router.get('/clinics-schedules/09-prototype-end', function (req, res) { - res.render('clinics-schedules/09-prototype-end') +router.get(['/clinics-schedules/09-prototype-end', OLDER_VERSIONS_PREFIX + '09-prototype-end'], function (req, res) { + res.render(clinicsScheduleView(req, '09-prototype-end')) }) router.post('/sessions/02-organise-slots', function (req, res) { diff --git a/app/views/_includes/clinics/clinic-listing-table-clinic-added.html b/app/views/_includes/clinics/clinic-listing-table-clinic-added.html new file mode 100644 index 0000000..6926cc9 --- /dev/null +++ b/app/views/_includes/clinics/clinic-listing-table-clinic-added.html @@ -0,0 +1,61 @@ +{{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Clinic' + }, + { + text: 'Location' + }, + { + text: 'Unit' + }, + { + text: 'Current capacity' + } + ], + rows: [ + [ + { + html: 'Worthing - test day September 2026
HWO-NNN-standard-20260901' + }, + { + html: 'West Sussex Breast Care Centre
Worthing hospital' + }, + { + html: 'Alpha van
HWO-mobile-1 ' + }, + { + html: 'No slots created' + } + ], + [ + { + html: 'Chichester - standard slots May 2026
HWO-NNN-standard-20260501' + }, + { + html: 'Chichester
St Richard’s Hospital' + }, + { + html: 'Alpha van
HWO-mobile-1 ' + }, + { + html: '99%10 slots available of 1360' + } + ], + [ + { + html: 'Worthing - special slots May 2026
HWO-NNN-special-20260501' + }, + { + html: 'Worthing
Worthing Hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: '60%40 slots available of 100' + } + ] + ] +}) }} diff --git a/app/views/clinics-schedules/00-create-new-clinic-details.html b/app/views/clinics-schedules/00-create-new-clinic-details.html new file mode 100644 index 0000000..a7431e3 --- /dev/null +++ b/app/views/clinics-schedules/00-create-new-clinic-details.html @@ -0,0 +1,215 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Create day clinic" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+ +
+
+ + {% if errorState === "true" %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: "Clinic must be given a name", + href: "#" + }, + { + text: "A unit must be chosen", + href: "#" + }, + { + text: "A location must be chosen", + href: "#" + } + ] + }) }} + {% endif %} + +

Clinic details

+ +
+ +
+ +
+ A memorable name for this clinic. This is the name you’ll see everywhere for it, as titles and links. +
+ {% if errorState === "true" %} + + Error: Clinic must be given a name + + {% endif %} + +
+ +
+ + + +
+ +
+ +
+ +
+
+
+ + Unit + + {% if errorState === "true" %} + + Error: A unit must be chosen + + {% endif %} +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+
+
+ + Location + + {% if errorState === "true" %} + + Error: A location must be chosen + + {% endif %} +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ +
+ +
+ + +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/01-create-schedule.html b/app/views/clinics-schedules/01-create-schedule.html index 857245a..1633b78 100644 --- a/app/views/clinics-schedules/01-create-schedule.html +++ b/app/views/clinics-schedules/01-create-schedule.html @@ -20,65 +20,18 @@ {% endset %}
-
- -
- -
- -
-
+ +
{% if errorState === "true" %} {{ errorSummary({ titleText: "There is a problem", errorList: [ + { + text: "Schedule must be given a name", + href: "#" + }, { text: "Schedule start date must be given a day, month, and year", href: "#" @@ -101,7 +54,22 @@

Create schedule

-
+ + +
+ +
+ A memorable name for this schedule. +
+ {% if errorState === "true" %} + + Error: Schedule must be given a name + + {% endif %} + +
@@ -189,7 +157,7 @@

Create schedule

- +
diff --git a/app/views/clinics-schedules/0a-clinics-clinic-added-populated.html b/app/views/clinics-schedules/0a-clinics-clinic-added-populated.html new file mode 100644 index 0000000..d705558 --- /dev/null +++ b/app/views/clinics-schedules/0a-clinics-clinic-added-populated.html @@ -0,0 +1,122 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{{ breadcrumb({ + items: [ + { + href: "#", + text: "Home" + } + ] +}) }} + +{% endblock %} + +{% block content %} +
+

Clinics

+ + {{ button({ + text: "Create a new clinic", + href: "/clinics-schedules/00-create-new-clinic-details", + classes: "nhsuk-button--secondary" + }) }} +
+ +
+
+ + {{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Clinic' + }, + { + text: 'Location' + }, + { + text: 'Unit' + }, + { + text: 'Schedules added' + }, + { + text: 'Latest schedule' + } + ], + rows: [ + [ + { + html: 'Worthing - test day September 2026
HWO-NNN-standard-20260901' + }, + { + html: 'West Sussex Breast Care Centre
Worthing hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: '1' + }, + { + html: '6 weeks Aug - Oct 2026' + } + ], + [ + { + html: 'Chichester - standard slots May 2026
HWO-NNN-standard-20260501' + }, + { + html: 'Chichester
St Richard’s Hospital' + }, + { + html: 'Alpha van
HWO-mobile-1 ' + }, + { + html: '3' + }, + { + html: '6 weeks May - June 2026' + } + ], + [ + { + html: 'Worthing - special slots May 2026
HWO-NNN-special-20260501' + }, + { + html: 'Worthing
Worthing Hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: '1' + }, + { + html: '6 weeks May - June 2026 specials' + } + ] + ] +}) }} + +
+
+ +
+
+

Completed batches

+

+ View completed clinics +

+
+
+{% endblock %} diff --git a/app/views/clinics-schedules/0a-clinics-clinic-added.html b/app/views/clinics-schedules/0a-clinics-clinic-added.html new file mode 100644 index 0000000..9d4a906 --- /dev/null +++ b/app/views/clinics-schedules/0a-clinics-clinic-added.html @@ -0,0 +1,122 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{{ breadcrumb({ + items: [ + { + href: "#", + text: "Home" + } + ] +}) }} + +{% endblock %} + +{% block content %} +
+

Clinics

+ + {{ button({ + text: "Create a new clinic", + href: "/clinics-schedules/00-create-new-clinic-details", + classes: "nhsuk-button--secondary" + }) }} +
+ +
+
+ + {{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Clinic' + }, + { + text: 'Location' + }, + { + text: 'Unit' + }, + { + text: 'Schedules added' + }, + { + text: 'Latest schedule' + } + ], + rows: [ + [ + { + html: 'Worthing - test day September 2026
HWO-NNN-standard-20260901' + }, + { + html: 'West Sussex Breast Care Centre
Worthing hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: 'None' + }, + { + html: 'No schedules added' + } + ], + [ + { + html: 'Chichester - standard slots May 2026
HWO-NNN-standard-20260501' + }, + { + html: 'Chichester
St Richard’s Hospital' + }, + { + html: 'Alpha van
HWO-mobile-1 ' + }, + { + html: '3' + }, + { + html: '6 weeks May - June 2026' + } + ], + [ + { + html: 'Worthing - special slots May 2026
HWO-NNN-special-20260501' + }, + { + html: 'Worthing
Worthing Hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: '1' + }, + { + html: '6 weeks May - June 2026 specials' + } + ] + ] +}) }} + +
+
+ +
+
+

Completed batches

+

+ View completed clinics +

+
+
+{% endblock %} diff --git a/app/views/clinics-schedules/0b-clinic-detail-populated-schedule-added.html b/app/views/clinics-schedules/0b-clinic-detail-populated-schedule-added.html new file mode 100644 index 0000000..8144cba --- /dev/null +++ b/app/views/clinics-schedules/0b-clinic-detail-populated-schedule-added.html @@ -0,0 +1,107 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} +{{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Clinic + Worthing - test day September 2026 +

+

+ West Sussex Breast Screening Centre
+ Worthing hospital +

+
+ +
+ +
+ +
+
+
+

Schedules

+ {{ button({ + text: "Add a new schedule", + href: "01-create-schedule", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ + {{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Schedule name' + }, + { + text: 'Start date' + }, + { + text: 'End date' + }, + { + text: 'Sessions added' + }, + { + text: 'Current capacity' + } + ], + rows: [ + [ + { + html: '6 weeks Aug - Oct 2026
' + }, + { + html: '01 September 2026' + }, + { + html: '30 September 2026' + }, + { + html: '1' + }, + { + html: '60%40 slots available of 100' + } + ] + ] +}) }} + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/0b-clinic-detail-schedule-added-backup.html b/app/views/clinics-schedules/0b-clinic-detail-schedule-added-backup.html new file mode 100644 index 0000000..5f29108 --- /dev/null +++ b/app/views/clinics-schedules/0b-clinic-detail-schedule-added-backup.html @@ -0,0 +1,109 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Clinic + Worthing - test day September 2026 +

+

+ West Sussex Breast Screening Centre
+ Worthing hospital +

+
+ +
+ +
+ +
+
+
+

Schedules

+ {{ button({ + text: "Add a new schedule", + href: "01-create-schedule", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ +
+
+
+
+

Standard day schedule

+
+ +
+
+
+
+ Dates +
+
+ 31 August 2026 to 9 October 2026 +
+
+
+
+
+
+
+
+ Sessions added +
+
+ No sessions added +
+
+
+
+
+ + +
+
+ +
+
+ +{% endblock %} diff --git a/app/views/clinics-schedules/0b-clinic-detail-schedule-added.html b/app/views/clinics-schedules/0b-clinic-detail-schedule-added.html new file mode 100644 index 0000000..cbb5343 --- /dev/null +++ b/app/views/clinics-schedules/0b-clinic-detail-schedule-added.html @@ -0,0 +1,102 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Clinic + Worthing - test day September 2026 +

+

+ West Sussex Breast Screening Centre
+ Worthing hospital +

+
+ +
+ +
+ +
+
+
+

Schedules

+ {{ button({ + text: "Add a new schedule", + href: "01-create-schedule", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ + {{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Schedule name' + }, + { + text: 'Start date' + }, + { + text: 'End date' + }, + { + text: 'Current capacity' + } + ], + rows: [ + [ + { + html: '6 weeks Aug - Oct 2026
' + }, + { + html: '01 September 2026' + }, + { + html: '30 September 2026' + }, + { + html: 'No sessions added' + } + ] + ] +}) }} + + +
+
+ +{% endblock %} diff --git a/app/views/clinics-schedules/0b-clinic-detail.html b/app/views/clinics-schedules/0b-clinic-detail.html new file mode 100644 index 0000000..c63a607 --- /dev/null +++ b/app/views/clinics-schedules/0b-clinic-detail.html @@ -0,0 +1,69 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Clinic + Worthing - test day September 2026 +

+

+ West Sussex Breast Screening Centre
+ Worthing hospital +

+
+ +
+ +
+ +
+
+
+

Schedules

+ {{ button({ + text: "Add a new schedule", + href: "01-create-schedule", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ +

No schedules have been created.

+ +
+
+ +{% endblock %} diff --git a/app/views/clinics-schedules/0c-schedule-detail-session-added.html b/app/views/clinics-schedules/0c-schedule-detail-session-added.html new file mode 100644 index 0000000..7034413 --- /dev/null +++ b/app/views/clinics-schedules/0c-schedule-detail-session-added.html @@ -0,0 +1,320 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} +{{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Schedule + 6 weeks Aug - Oct 2026 +

+ +
+
+
+ Clinic +
+
+ Worthing - test day September 2026 +
+
+
+
+ Dates +
+
+ 31 August 2026 to 9 October 2026 +
+
+
+ +
+ +
+ +
+
+
+

Sessions

+ {{ button({ + text: "Add a new session", + href: "#", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ +
+
+
+
+

Standard day session

+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
August 2026
MTWTFSS
24252627282930
31No dataNo dataNo dataNo dataNo dataNo data
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
September 2026
MTWTFSS
No data123456
78910111213
14151617181920
21222324252627
282930No dataNo dataNo dataNo data
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
October 2026
MTWTFSS
No dataNo dataNo data1234
567No dataNo dataNo dataNo data
+
+
+
+
+
+ Total capacity +
+
+ 42 slots +
+
+
+
+ Time +
+
+ 09:00 to 17:00 +
+
+
+
+
+
+
+
+ Slot length +
+
+ 10 minutes +
+
+
+
+ Total held +
+
+ 8 slots +
+
+
+
+ Total cancelled +
+
+ 6 slots +
+
+
+
+
+ + +
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/0c-schedule-detail.html b/app/views/clinics-schedules/0c-schedule-detail.html new file mode 100644 index 0000000..21f4e94 --- /dev/null +++ b/app/views/clinics-schedules/0c-schedule-detail.html @@ -0,0 +1,80 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{% endblock %} + +{% block content %} + +
+
+

+ Schedule + 6 weeks Aug - Oct 2026 +

+ +
+
+
+ Clinic +
+
+ Worthing - test day September 2026 +
+
+
+
+ Dates +
+
+ 31 August 2026 to 9 October 2026 +
+
+
+ +
+ +
+ +
+
+
+

Sessions

+ {{ button({ + text: "Add a new session", + href: "0c-schedule-detail-session-added", + classes: "nhsuk-button--secondary" + }) }} +
+
+
+ +
+
+ +

No sessions have been added yet

+ +
+
+ +{% endblock %} diff --git a/app/views/clinics-schedules/index.html b/app/views/clinics-schedules/index.html index 2e7a2ee..eae468a 100644 --- a/app/views/clinics-schedules/index.html +++ b/app/views/clinics-schedules/index.html @@ -26,7 +26,7 @@

Clinics

{{ button({ text: "Create a new clinic", - href: "/clinics-schedules/00-clinic-details", + href: "/clinics-schedules/00-create-new-clinic-details", classes: "nhsuk-button--secondary" }) }}
@@ -34,7 +34,62 @@

Clinics

- {% include "_includes/clinics/clinic-listing-table.html"%} + {{ table({ + firstCellIsHeader: false, + head: [ + { + text: 'Clinic' + }, + { + text: 'Location' + }, + { + text: 'Unit' + }, + { + text: 'Schedules added' + }, + { + text: 'Latest schedule' + } + ], + rows: [ + [ + { + html: 'Chichester - standard slots May 2026
HWO-NNN-standard-20260501' + }, + { + html: 'Chichester
St Richard’s Hospital' + }, + { + html: 'Alpha van
HWO-mobile-1 ' + }, + { + html: '3' + }, + { + html: '6 weeks May - June 2026' + } + ], + [ + { + html: 'Worthing - special slots May 2026
HWO-NNN-special-20260501' + }, + { + html: 'Worthing
Worthing Hospital' + }, + { + html: 'Home base
HWO-static-1 ' + }, + { + html: '1' + }, + { + html: '6 weeks May - June 2026 specials' + } + ] + ] +}) }}
diff --git a/app/views/clinics-schedules/00-clinic-details.html b/app/views/clinics-schedules/z-older-versions/00-clinic-details.html similarity index 100% rename from app/views/clinics-schedules/00-clinic-details.html rename to app/views/clinics-schedules/z-older-versions/00-clinic-details.html diff --git a/app/views/clinics-schedules/z-older-versions/01-create-schedule.html b/app/views/clinics-schedules/z-older-versions/01-create-schedule.html new file mode 100644 index 0000000..948e1ef --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/01-create-schedule.html @@ -0,0 +1,200 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Create a schedule" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+
+ + {% if errorState === "true" %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: "Schedule start date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule start date must be in the future", + href: "#" + }, + { + text: "Schedule end date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule end date must be in the future", + href: "#" + } + ] + }) }} + {% endif %} + +

Create schedule

+ +
+ +
+
+ + Start date + +
+ For example, 18 6 2026 +
+ {% if errorState === "true" %} + + Error: Start date must be given a day, month, and year + + {% endif %} +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+ +
+
+ + End date + +
+ For example, 18 6 2026 +
+ {% if errorState === "true" %} + + Error: End date must be given a day, month, and year + + {% endif %} +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + + + +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/02-choose-session-options.html b/app/views/clinics-schedules/z-older-versions/02-choose-session-options.html new file mode 100644 index 0000000..3c70e00 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/02-choose-session-options.html @@ -0,0 +1,113 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Create a session" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +

+ Do you want to create a new session or use an existing template? +

+
+
+
+ + +
+
+ + +
+
+
+
+ + + + +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/03-create-session.html b/app/views/clinics-schedules/z-older-versions/03-create-session.html new file mode 100644 index 0000000..b402620 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/03-create-session.html @@ -0,0 +1,296 @@ +{% extends 'layout.html' %} + +{% set errorState = "true" if errors else "false" %} + +{% set pageName = "Create session: set timings" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+
+ + {% if errorState === "true" %} + {% set errorList = [] %} + {% if errors.sessionName %} + {% set errorList = errorList.concat([{ text: errors.sessionName, href: "#session-name" }]) %} + {% endif %} + {% if errors.startTime %} + {% set errorList = errorList.concat([{ text: errors.startTime, href: "#start-time-hour" }]) %} + {% endif %} + {% if errors.endTime %} + {% set errorList = errorList.concat([{ text: errors.endTime, href: "#end-time-hour" }]) %} + {% endif %} + {% if errors.duration %} + {% set errorList = errorList.concat([{ text: errors.duration, href: "#duration" }]) %} + {% endif %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: errorList + }) }} + {% endif %} + +

Create session

+ +
+ +
+ +
+ A memorable name for this session. This is the name you'll see everywhere for it, as titles and links. +
+ {% if errors and errors.sessionName %} + + Error: {{ errors.sessionName }} + + {% endif %} + +
+ +
+
+ + Session start time + +
+ Use 24 hour format, for example, 10:00 +
+ {% if errors and errors.startTime %} + + Error: {{ errors.startTime }} + + {% endif %} + +
+
+
+ + +
+
+ +
+
+ + +
+
+
+
+
+ +
+
+ + Session end time + +
+ Use 24 hour format, for example, 17:00 +
+ {% if errors and errors.endTime %} + + Error: {{ errors.endTime }} + + {% endif %} + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ +
+ + {% if errors and errors.duration %} + + Error: {{ errors.duration }} + + {% endif %} +
+ + +
+
+ +
+ Information: +

Capacity calculator

+

X total slots in the + session

+ +
+ + + +
+
+
+
+ +{% endblock %} + +{% block pageScripts %} + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/04-organise-slots.html b/app/views/clinics-schedules/z-older-versions/04-organise-slots.html new file mode 100644 index 0000000..91bf674 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/04-organise-slots.html @@ -0,0 +1,652 @@ +{% extends 'layout.html' %} + +{% set pageName = "Create session: organise slots" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + + + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+ +
+

Organise slots

+

+ Session time + {{ data.newSession.startTime.hour | zeroPad }}:{{ data.newSession.startTime.minute | zeroPad }} to {{ data.newSession.endTime.hour | zeroPad }}:{{ data.newSession.endTime.minute | zeroPad }} +

+
+ +
+ + + + + + + +

+ Click to select a slot. Hold shift and click to select a range. +

+ +
+
+
+
+
+
+

With selected:

+ +
+ +
+
+

+ {{ data.newSession.totalSlots }} slots available +

+

+ +

+
+
+ +
+
+
+ +{% endblock %} + +{% block pageScripts %} + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/05-save-as-template.html b/app/views/clinics-schedules/z-older-versions/05-save-as-template.html new file mode 100644 index 0000000..d3e97f0 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/05-save-as-template.html @@ -0,0 +1,113 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Save this session as a template" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+ +

+ Do you want to save this session as a template? +

+
+
+
+ + +
+
+ + +
+
+
+
+ + + + +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/05a-template-details.html b/app/views/clinics-schedules/z-older-versions/05a-template-details.html new file mode 100644 index 0000000..6f7d124 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/05a-template-details.html @@ -0,0 +1,141 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Template details" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+
+ + {% if errorState === "true" %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: "Schedule start date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule start date must be in the future", + href: "#" + }, + { + text: "Schedule end date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule end date must be in the future", + href: "#" + } + ] + }) }} + {% endif %} + +

Template details

+ +
+ +
+ +
+ A memorable name for this template. This is the name you’ll see everywhere for it, as titles and links. +
+ {% if errorState === "true" %} + + Error: Template must be given a name + + {% endif %} + +
+ +
+ + {% if errorState === "true" %} + + Error: Template must be given a description + + {% endif %} + +
+ + + +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/06-apply-session.html b/app/views/clinics-schedules/z-older-versions/06-apply-session.html new file mode 100644 index 0000000..b906b56 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/06-apply-session.html @@ -0,0 +1,297 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Apply session dates" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} +{{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+
+ +
+ +
+ +
+
+ +

+ Which dates do you want to apply this session to? +

+ +
+ + + + {% if data.calendars and data.calendars.length > 0 %} + {% for calendar in data.calendars %} + + + + + + + + + + + + + + + {% for week in calendar.weeks %} + + {% for dayItem in week %} + {% if dayItem %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + +
{{ calendar.monthName }} {{ calendar.year }}
MonTueWedThuFriSatSun
+ + {{ dayItem.date }} + + + No data +
+ {% endfor %} + {% else %} +

No date range has been configured for this schedule. Please return to create + schedule to set a date range.

+ {% endif %} + +
+ + + +
+ +
+ +
+
+
+

Session summary{{ data.sessionName if data.sessionName + else '' }}

+ +

+ Start time: + {% if data.newSession and data.newSession.startTime %} + {{ data.newSession.startTime.hour | zeroPad }}:{{ data.newSession.startTime.minute | zeroPad }} + {% else %} + - + {% endif %} +

+

+ End time: + {% if data.newSession and data.newSession.endTime %} + {{ data.newSession.endTime.hour | zeroPad }}:{{ data.newSession.endTime.minute | zeroPad }} + {% else %} + - + {% endif %} +

+

+ Slot length: + {% if data.newSession and data.newSession.duration %} + {{ data.newSession.duration }} minutes + {% else %} + - + {% endif %} +

+

+ Number of slots: + {% if data.newSession and data.newSession.totalSlots %} + {{ data.newSession.totalSlots }} + {% else %} + - + {% endif %} +

+ + {% if data.sessionSummaryRows and data.sessionSummaryRows.length > 0 %} +
+ {% for row in data.sessionSummaryRows %} +

{{ row.start }} - {{ row.end }}: {{ row.details }}

+ {% endfor %} +
+ {% else %} +

+ No slot configuration has been applied yet. +

+ {% endif %} +
+
+
+ +
+ + + +{% endblock %} + +{% block pageScripts %} + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/07-schedule-details.html b/app/views/clinics-schedules/z-older-versions/07-schedule-details.html new file mode 100644 index 0000000..e2469a5 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/07-schedule-details.html @@ -0,0 +1,144 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Schedule details" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+ +
+
+ + {% if errorState === "true" %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: "Schedule start date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule start date must be in the future", + href: "#" + }, + { + text: "Schedule end date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule end date must be in the future", + href: "#" + } + ] + }) }} + {% endif %} + +

Schedule details

+ +

Schedule summary

+
+
+
Schedule start date
+
{{ scheduleStartDateLabel }}
+
+
+
Schedule end date
+
{{ scheduleEndDateLabel }}
+
+
+ +

Sessions added

+ + {% if scheduleSessions and scheduleSessions.length > 0 %} + {% for session in scheduleSessions %} +
+
+

{{ session.sessionName }}

+

+ {{ session.startTime }} - {{ session.endTime }} + Slot length: {{ session.slotLength }} minutes + Capacity: {{ session.totalSlots }} +

+
+
+ {% endfor %} + {% else %} +

No sessions have been added yet.

+ {% endif %} + + Add another session +
+ Continue +
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/08-publish-clinic.html b/app/views/clinics-schedules/z-older-versions/08-publish-clinic.html new file mode 100644 index 0000000..133603e --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/08-publish-clinic.html @@ -0,0 +1,161 @@ +{% extends 'layout.html' %} + +{% set errorState = "false" %} + +{% set pageName = "Publish clinic" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} + +{% set tickSvg %} + +{% endset %} + +
+ +
+
+ + {% if errorState === "true" %} + {{ errorSummary({ + titleText: "There is a problem", + errorList: [ + { + text: "Schedule start date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule start date must be in the future", + href: "#" + }, + { + text: "Schedule end date must be given a day, month, and year", + href: "#" + }, + { + text: "Schedule end date must be in the future", + href: "#" + } + ] + }) }} + {% endif %} + +

Publish clinic

+ +

Clinic details

+
+
+
Clinic name
+
{{ clinicName }}
+
+
+
Clinic ID
+
{{ clinicId }}
+
+
+
BSO Unit
+
{{ unit }}
+
+
+
Location
+
{{ location }}
+
+
+ +

Schedules created so far

+ + {% if createdSchedules and createdSchedules.length > 0 %} + {% for schedule in createdSchedules %} +
+
+

Schedule {{ loop.index }}

+
+
+
Start date
+
{{ schedule.scheduleStartDateLabel }}
+
+
+
End date
+
{{ schedule.scheduleEndDateLabel }}
+
+
+
Sessions attached
+
{{ schedule.sessionCount }}
+
+
+
+
+ {% endfor %} + {% else %} +

No schedules have been created yet.

+ {% endif %} + + Add another schedule + +
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/views/clinics-schedules/z-older-versions/09-prototype-end.html b/app/views/clinics-schedules/z-older-versions/09-prototype-end.html new file mode 100644 index 0000000..871063a --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/09-prototype-end.html @@ -0,0 +1,33 @@ +{% extends 'layout.html' %} + +{% set pageName = "Prototype end" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %}{% endblock %} + +{% block content %} +
+
+ + {% set panelHtml %} + + {% endset %} + + {{ panel({ + titleText: "Prototype completed!", + html: panelHtml + }) }} +
+
+{% endblock %} diff --git a/app/views/clinics-schedules/z-older-versions/index.html b/app/views/clinics-schedules/z-older-versions/index.html new file mode 100644 index 0000000..12d3060 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/index.html @@ -0,0 +1,50 @@ +{% extends 'layout.html' %} + +{% set pageName = "Clinics" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName) }} +{% endblock %} + +{% block beforeContent %} + +{{ breadcrumb({ + items: [ + { + href: "#", + text: "Home" + } + ] +}) }} + +{% endblock %} + +{% block content %} +
+

Clinics

+ + {{ button({ + text: "Create a new clinic", + href: "/clinics-schedules/z-older-versions/00-clinic-details", + classes: "nhsuk-button--secondary" + }) }} +
+ +
+
+ + {% include "_includes/clinics/clinic-listing-table.html"%} + +
+
+ +
+
+

Completed batches

+

+ View completed clinics +

+
+
+{% endblock %} diff --git a/app/views/index.html b/app/views/index.html index e9f6254..aab2628 100755 --- a/app/views/index.html +++ b/app/views/index.html @@ -47,10 +47,10 @@

August 2026

Clinics with schedules ideation

  1. - Create a new clinic (containers) + Create a new clinic (containers)
  2. - Create a new clinic (transaction) + Create a new clinic (transaction)

Appointments and active clinics