From 31176cb31f91e72c4d8ad826442605bbc294cb9b Mon Sep 17 00:00:00 2001 From: danjohnstonUX <21033686+danjohnstonUX@users.noreply.github.com> Date: Tue, 25 Aug 2026 11:20:23 +0100 Subject: [PATCH 1/3] archived previous work --- .../z-older-versions/00-clinic-details.html | 268 +++++++ .../z-older-versions/01-create-schedule.html | 200 ++++++ .../02-choose-session-options.html | 113 +++ .../z-older-versions/03-create-session.html | 296 ++++++++ .../z-older-versions/04-organise-slots.html | 652 ++++++++++++++++++ .../z-older-versions/05-save-as-template.html | 113 +++ .../05a-template-details.html | 141 ++++ .../z-older-versions/06-apply-session.html | 297 ++++++++ .../z-older-versions/07-schedule-details.html | 144 ++++ .../z-older-versions/08-publish-clinic.html | 161 +++++ .../z-older-versions/09-prototype-end.html | 33 + .../z-older-versions/index.html | 50 ++ 12 files changed, 2468 insertions(+) create mode 100644 app/views/clinics-schedules/z-older-versions/00-clinic-details.html create mode 100644 app/views/clinics-schedules/z-older-versions/01-create-schedule.html create mode 100644 app/views/clinics-schedules/z-older-versions/02-choose-session-options.html create mode 100644 app/views/clinics-schedules/z-older-versions/03-create-session.html create mode 100644 app/views/clinics-schedules/z-older-versions/04-organise-slots.html create mode 100644 app/views/clinics-schedules/z-older-versions/05-save-as-template.html create mode 100644 app/views/clinics-schedules/z-older-versions/05a-template-details.html create mode 100644 app/views/clinics-schedules/z-older-versions/06-apply-session.html create mode 100644 app/views/clinics-schedules/z-older-versions/07-schedule-details.html create mode 100644 app/views/clinics-schedules/z-older-versions/08-publish-clinic.html create mode 100644 app/views/clinics-schedules/z-older-versions/09-prototype-end.html create mode 100644 app/views/clinics-schedules/z-older-versions/index.html diff --git a/app/views/clinics-schedules/z-older-versions/00-clinic-details.html b/app/views/clinics-schedules/z-older-versions/00-clinic-details.html new file mode 100644 index 0000000..3109d32 --- /dev/null +++ b/app/views/clinics-schedules/z-older-versions/00-clinic-details.html @@ -0,0 +1,268 @@ +{% 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/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..857245a --- /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..9e1e8a2 --- /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..cdf9b7c --- /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..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"%} + +
+
+ +
+
+

Completed batches

+

+ View completed clinics +

+
+
+{% 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
' + } + ], + [ + { + 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-clinic-details.html b/app/views/clinics-schedules/00-create-new-clinic-details.html similarity index 79% rename from app/views/clinics-schedules/00-clinic-details.html rename to app/views/clinics-schedules/00-create-new-clinic-details.html index 3109d32..a7431e3 100644 --- a/app/views/clinics-schedules/00-clinic-details.html +++ b/app/views/clinics-schedules/00-create-new-clinic-details.html @@ -20,61 +20,8 @@ {% endset %}
-
- -
- -
- -
-
+ +
{% if errorState === "true" %} @@ -99,7 +46,7 @@

Clinic details

-
+