diff --git a/app/assets/javascript/calendar-table-actions.js b/app/assets/javascript/calendar-table-actions.js index f8d8b672..16255008 100644 --- a/app/assets/javascript/calendar-table-actions.js +++ b/app/assets/javascript/calendar-table-actions.js @@ -1,6 +1,3 @@ - var lastSelectedCell = null; - var selectableCells = Array.from(document.querySelectorAll('.calendar-table td:not(.calendar-table-no-data)')); - function clearSelectedDays() { document.querySelectorAll('.calendar-table td.--date-selected').forEach(function (cell) { cell.classList.remove('--date-selected'); @@ -59,7 +56,6 @@ clickedScheduleName.textContent = isAlreadySelected ? 'Select schedule' : 'Deselect schedule'; } - lastSelectedCell = clickedStartCell; return; } @@ -71,25 +67,27 @@ return; } - if (event.shiftKey && lastSelectedCell) { - var startIndex = selectableCells.indexOf(lastSelectedCell); - var endIndex = selectableCells.indexOf(cell); - - if (startIndex !== -1 && endIndex !== -1) { - var rangeStart = Math.min(startIndex, endIndex); - var rangeEnd = Math.max(startIndex, endIndex); - - for (var index = rangeStart; index <= rangeEnd; index++) { - selectableCells[index].classList.add('--date-selected'); - } - } - } else { - cell.classList.toggle('--date-selected'); - } - - lastSelectedCell = cell; + cell.classList.toggle('--date-selected'); }); table.classList.add('--js-enabled'); }); + + var selectDaysForm = document.getElementById('select-days-form'); + + if (selectDaysForm) { + selectDaysForm.addEventListener('submit', function () { + selectDaysForm.querySelectorAll('input[name="selectedDays"]').forEach(function (input) { + input.remove(); + }); + + document.querySelectorAll('.calendar-table td.--date-selected[data-date]').forEach(function (cell) { + var input = document.createElement('input'); + input.type = 'hidden'; + input.name = 'selectedDays'; + input.value = cell.getAttribute('data-date'); + selectDaysForm.appendChild(input); + }); + }); + } \ No newline at end of file diff --git a/app/assets/sass/components/_calendar-table.scss b/app/assets/sass/components/_calendar-table.scss index ce5422d0..4858c63d 100644 --- a/app/assets/sass/components/_calendar-table.scss +++ b/app/assets/sass/components/_calendar-table.scss @@ -82,6 +82,7 @@ text-wrap: nowrap; } } + .--schedule-end { position: relative; border-right-color: nhsuk-colour("grey-2"); @@ -109,6 +110,12 @@ margin-bottom: nhsuk-spacing(2); } +.--template-name { + display: block; + padding: nhsuk-spacing(1); + margin-top: nhsuk-spacing(2); +} + /// /// /// diff --git a/app/assets/sass/components/_clinic-capacity-summary.scss b/app/assets/sass/components/_clinic-capacity-summary.scss new file mode 100644 index 00000000..8a473091 --- /dev/null +++ b/app/assets/sass/components/_clinic-capacity-summary.scss @@ -0,0 +1,18 @@ +@use "nhsuk-frontend/dist/nhsuk/core" as *; + +.app-clinic-capacity-summary { + @include nhsuk-responsive-margin(4, "bottom"); + + .nhsuk-table__body { + display: flex; + } + .nhsuk-table__header:not(:last-child) { + @include nhsuk-responsive-padding(1, "right"); + border: 0; + } + .nhsuk-table__cell { + @include nhsuk-responsive-padding(5, "right"); + border: 0; + } + +} \ No newline at end of file diff --git a/app/assets/sass/components/_progress-bar.scss b/app/assets/sass/components/_progress-bar.scss index e3ac3c90..e6b7780e 100644 --- a/app/assets/sass/components/_progress-bar.scss +++ b/app/assets/sass/components/_progress-bar.scss @@ -55,34 +55,44 @@ min-width: 0; } } -.app-progress-bar::-webkit-progress-bar { +::-webkit-progress-bar { background: #fff; } .app-progress-bar::-moz-progress-bar { background: #fff; } -.app-progress-bar.--generic::-webkit-progress-value, +.app-progress-bar.--generic::-webkit-progress-value { + background: var(--generic-chart-hatch); +} .app-progress-bar.--generic::-moz-progress-bar { background: var(--generic-chart-hatch); } -.app-progress-bar.--standard::-webkit-progress-value, +.app-progress-bar.--standard::-webkit-progress-value { + background: var(--standard-chart-hatch); +} .app-progress-bar.--standard::-moz-progress-bar { background: var(--standard-chart-hatch); } -.app-progress-bar.--special::-webkit-progress-value, +.app-progress-bar.--special::-webkit-progress-value { + background: var(--special-chart-hatch); +} .app-progress-bar.--special::-moz-progress-bar { background: var(--special-chart-hatch); } -.app-progress-bar.--ceased::-webkit-progress-value, +.app-progress-bar.--ceased::-webkit-progress-value { + background: var(--ceased-chart-hatch); +} .app-progress-bar.--ceased::-moz-progress-bar { background: var(--ceased-chart-hatch); } -.app-progress-bar.--vhr::-webkit-progress-value, +.app-progress-bar.--vhr::-webkit-progress-value { + background: var(--vhr-chart-hatch); +} .app-progress-bar.--vhr::-moz-progress-bar { background: var(--vhr-chart-hatch); -} \ No newline at end of file +} diff --git a/app/assets/sass/main.scss b/app/assets/sass/main.scss index b57d3ddb..dff61b53 100755 --- a/app/assets/sass/main.scss +++ b/app/assets/sass/main.scss @@ -21,6 +21,7 @@ // https://github.com/NHSDigital/manage-breast-screening-prototype @forward "components/calendar-table"; +@forward "components/clinic-capacity-summary"; @forward "components/clinic-level-breadcrumbs"; @forward "components/grid-extensions"; @forward "components/inline-detailed-search"; @@ -42,6 +43,24 @@ a { @extend .nhsuk-link--no-visited-state; } +// Makes a
+
+ 42 slots
0 booked
8 held
+ Select schedule 20 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
21 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
22 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
23 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -413,40 +417,40 @@ 26 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
27 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
28 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
29 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
30 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -504,40 +508,40 @@ 2 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
3 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
4 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
5 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
6 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -552,40 +556,40 @@ 9 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
10 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
11 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
12 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
13 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -600,40 +604,40 @@ 16 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
17 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
18 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
19 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
20 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -648,40 +652,40 @@ 23 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
24 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
25 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
26 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
27 {{ padlockSvg | safe }} - -
+
+ 42 slots
0 booked
8 held
@@ -723,10 +727,11 @@

With selected days:

diff --git a/app/views/create-capacity-from-zero/clinic-summary.html b/app/views/create-capacity-from-zero/clinic-summary.html new file mode 100644 index 00000000..d4b945e0 --- /dev/null +++ b/app/views/create-capacity-from-zero/clinic-summary.html @@ -0,0 +1,114 @@ +{% extends 'layout.html' %} + +{% set pageName = "" %} + +{% from "_includes/primary-navigation.html" import primaryNavigation %} +{% block header %} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} +{% endblock %} + +{% block beforeContent %} + + Back to clinic listing + +{% endblock %} + +{% block content %} + + {% set padlockSvg %} +
+ + Locked +
+ {% endset %} + + {% include "create-capacity-from-zero/_local-includes/clinic-summary.html" %} + + {% if data.createCapacityFromZero.schedules.length > 0 %} +
+
+ {% for calendar in calendars %} + + + + + + + + + + + + + + + {% for week in calendar.weeks %} + + {% for dayItem in week %} + {% if dayItem %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + +
+ {{ calendar.monthName }} {{ calendar.year }} +
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
+ {{ dayItem.date }} + {% if dayItem.templateName %} + {{ padlockSvg | safe }} +
+ {{ dayItem.totalSlots }} slots
+ 0 booked
+ {{ dayItem.heldSlots }} held
+ {% endif %} + {% if dayItem.isScheduleStart %} + Select schedule + {% endif %} +
+ No data +
+ {% endfor %} +
+ +
+
+

With selected days:

+
+ +
+
+
+
+ {% endif %} + +
+
+ {% if data.createCapacityFromZero.schedules.length === 0 %} +

This clinic contains no schedules

+ {% endif %} + Add a new schedule +
+
+ + {% include "create-capacity-from-zero/_local-includes/template-preview.html" %} + +{% endblock %} + +{% block pageScripts %} + +{% endblock %} diff --git a/app/views/create-capacity-from-zero/create-clinic.html b/app/views/create-capacity-from-zero/create-clinic.html index ce37220c..39b7cc0d 100644 --- a/app/views/create-capacity-from-zero/create-clinic.html +++ b/app/views/create-capacity-from-zero/create-clinic.html @@ -1,211 +1,146 @@ {% extends 'layout.html' %} -{% set errorState = "false" %} +{% set errorState = "true" if errors else "false" %} {% set pageName = "" %} {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} -{% block beforeContent %}{% endblock %} +{% block beforeContent %} + + Back to clinic listing + +{% 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

- -
- -
-
{% endblock %} \ No newline at end of file diff --git a/app/views/create-capacity-from-zero/index.html b/app/views/create-capacity-from-zero/index.html index 1f15b48a..03ec45e1 100644 --- a/app/views/create-capacity-from-zero/index.html +++ b/app/views/create-capacity-from-zero/index.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} @@ -14,9 +14,9 @@ {% set secondaryNavItems = [] %} {% for item in [ - { href: '/clinics/', label: 'Active clinics', selected: 'true' }, + { href: '/create-capacity-from-zero/', label: 'Active clinics', selected: 'true' }, { href: '#', label: 'Archived clinics' }, - { href: '/sessions/templating-01-listing', label: 'Manage session templates' } + { href: '#', label: 'Manage session templates' } ] %} {% set secondaryNavItems = secondaryNavItems | push({ text: item.label | safe, @@ -66,12 +66,12 @@

Active clinics

- Chichester - St Richards
- HWO-NNN-standard-20260501 + Existing clinic user defined name
+ NNN-NNN-systemid-20260501 - Alpha van
- St Richard’s Hospital, Chichester + Unit label
+ Location short name 31 August 2026 to 9 October 2026 @@ -81,24 +81,6 @@

Active clinics

of which 150 held - - - - Chichester - St Richards
- HWO-NNN-standard-20260501 - - - Alpha van
- St Richard’s Hospital, Chichester - - - No active schedules - - - 1500 slots available
- of which 150 held - - diff --git a/app/views/create-capacity-from-zero/new-schedule-empty.html b/app/views/create-capacity-from-zero/new-schedule-empty.html index 3e2d23aa..076707e3 100644 --- a/app/views/create-capacity-from-zero/new-schedule-empty.html +++ b/app/views/create-capacity-from-zero/new-schedule-empty.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/create-capacity-from-zero/new-schedule-ready.html b/app/views/create-capacity-from-zero/new-schedule-ready.html index 539e36c6..c4669278 100644 --- a/app/views/create-capacity-from-zero/new-schedule-ready.html +++ b/app/views/create-capacity-from-zero/new-schedule-ready.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/create-capacity-from-zero/select-session-template-full-preview.html b/app/views/create-capacity-from-zero/select-session-template-full-preview.html index f81c9078..751a6783 100644 --- a/app/views/create-capacity-from-zero/select-session-template-full-preview.html +++ b/app/views/create-capacity-from-zero/select-session-template-full-preview.html @@ -76,7 +76,10 @@
-

Session template name

+

+ Template details + Standard +

Session time 09:00 to 17:00 diff --git a/app/views/create-capacity-from-zero/select-session-template.html b/app/views/create-capacity-from-zero/select-session-template.html index 91f28b8d..a419a9a5 100644 --- a/app/views/create-capacity-from-zero/select-session-template.html +++ b/app/views/create-capacity-from-zero/select-session-template.html @@ -4,10 +4,14 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} -{% block beforeContent %}{% endblock %} +{% block beforeContent %} + + Back to clinic: {{ data.createCapacityFromZero.clinicName }} + +{% endblock %} {% block content %}
@@ -18,11 +22,14 @@

Choose session template

- Standard day + Standard

- - Select this template - +
+ + +
@@ -85,11 +92,14 @@

- Special appointments day + Special appointments

- - Select this template - +
+ + +
@@ -152,11 +162,14 @@

- Default session template + Rubie default

- - Select this template - +
+ + +
diff --git a/app/views/index.html b/app/views/index.html index 96e9174d..8ffa432e 100755 --- a/app/views/index.html +++ b/app/views/index.html @@ -47,7 +47,10 @@

August – September 2026

Clinics with schedules ideation

  1. - Create a new clinic (containers) + Create a new clinic (containers) + + ready to test +
  2. Create a new clinic (transaction) diff --git a/app/views/sessions/01-set-timings.html b/app/views/sessions/01-set-timings.html index a4bcebcc..2341d90f 100644 --- a/app/views/sessions/01-set-timings.html +++ b/app/views/sessions/01-set-timings.html @@ -7,7 +7,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/sessions/02-organise-slots.html b/app/views/sessions/02-organise-slots.html index b90868a1..d1dbb4db 100644 --- a/app/views/sessions/02-organise-slots.html +++ b/app/views/sessions/02-organise-slots.html @@ -6,7 +6,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/sessions/03-prototype-end.html b/app/views/sessions/03-prototype-end.html index 5eeecc51..36a6e2d1 100644 --- a/app/views/sessions/03-prototype-end.html +++ b/app/views/sessions/03-prototype-end.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/sessions/day-slot-view.html b/app/views/sessions/day-slot-view.html index 316129e1..5375dd93 100644 --- a/app/views/sessions/day-slot-view.html +++ b/app/views/sessions/day-slot-view.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %} diff --git a/app/views/sessions/templating-01-listing.html b/app/views/sessions/templating-01-listing.html index f9d6ae87..8edc6baf 100644 --- a/app/views/sessions/templating-01-listing.html +++ b/app/views/sessions/templating-01-listing.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/sessions/templating-03-name-and-description.html b/app/views/sessions/templating-03-name-and-description.html index 0eba11ba..61ae2021 100644 --- a/app/views/sessions/templating-03-name-and-description.html +++ b/app/views/sessions/templating-03-name-and-description.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %} diff --git a/app/views/sessions/templating-04-check-answers.html b/app/views/sessions/templating-04-check-answers.html index ae91bca6..62e0df7a 100644 --- a/app/views/sessions/templating-04-check-answers.html +++ b/app/views/sessions/templating-04-check-answers.html @@ -4,7 +4,7 @@ {% from "_includes/primary-navigation.html" import primaryNavigation %} {% block header %} - {{ primaryNavigation("Clinics", serviceName) }} + {{ primaryNavigation("Clinics", serviceName, bsoName) }} {% endblock %} {% block beforeContent %}{% endblock %}