+
+
+
+{% 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 %}
+
+
+
+
+
+ {% 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..2e7a2ee
--- /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/00-clinic-details",
+ classes: "nhsuk-button--secondary"
+ }) }}
+
+
+
+
+
+ {% include "_includes/clinics/clinic-listing-table.html"%}
+
+
+
+
+
+{% endblock %}
From 8e1e6f88ffd46d7decd46aa7fb349f6bae8b77a7 Mon Sep 17 00:00:00 2001
From: danjohnstonUX <21033686+danjohnstonUX@users.noreply.github.com>
Date: Thu, 27 Aug 2026 12:17:27 +0100
Subject: [PATCH 2/3] WIP changes to containerised schedules
---
app/routes.js | 64 ++--
.../clinic-listing-table-clinic-added.html | 61 ++++
...html => 00-create-new-clinic-details.html} | 59 +---
.../clinics-schedules/01-create-schedule.html | 78 ++---
.../0a-clinics-clinic-added-populated.html | 122 +++++++
.../0a-clinics-clinic-added.html | 122 +++++++
...linic-detail-populated-schedule-added.html | 107 ++++++
...b-clinic-detail-schedule-added-backup.html | 109 ++++++
.../0b-clinic-detail-schedule-added.html | 102 ++++++
.../clinics-schedules/0b-clinic-detail.html | 69 ++++
.../0c-schedule-detail-session-added.html | 320 ++++++++++++++++++
.../clinics-schedules/0c-schedule-detail.html | 80 +++++
app/views/clinics-schedules/index.html | 59 +++-
.../z-older-versions/01-create-schedule.html | 2 +-
.../z-older-versions/05-save-as-template.html | 2 +-
.../z-older-versions/06-apply-session.html | 2 +-
.../z-older-versions/index.html | 2 +-
app/views/index.html | 2 +-
18 files changed, 1218 insertions(+), 144 deletions(-)
create mode 100644 app/views/_includes/clinics/clinic-listing-table-clinic-added.html
rename app/views/clinics-schedules/{00-clinic-details.html => 00-create-new-clinic-details.html} (79%)
create mode 100644 app/views/clinics-schedules/0a-clinics-clinic-added-populated.html
create mode 100644 app/views/clinics-schedules/0a-clinics-clinic-added.html
create mode 100644 app/views/clinics-schedules/0b-clinic-detail-populated-schedule-added.html
create mode 100644 app/views/clinics-schedules/0b-clinic-detail-schedule-added-backup.html
create mode 100644 app/views/clinics-schedules/0b-clinic-detail-schedule-added.html
create mode 100644 app/views/clinics-schedules/0b-clinic-detail.html
create mode 100644 app/views/clinics-schedules/0c-schedule-detail-session-added.html
create mode 100644 app/views/clinics-schedules/0c-schedule-detail.html
diff --git a/app/routes.js b/app/routes.js
index c580e8d..ce015e4 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'))
})
router.get('/september-iteration-2/clickthru/04a-example-search-result', function (req, res) {
@@ -446,7 +458,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 || {}
@@ -503,18 +515,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
@@ -567,24 +579,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) {
@@ -600,7 +612,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) {
@@ -639,7 +651,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) || {}
@@ -692,14 +704,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) || {}
@@ -739,7 +751,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) || '-',
@@ -748,8 +760,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.get('/action/stage/:participantId', 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