diff --git a/app/assets/sass/components/_calendar-table.scss b/app/assets/sass/components/_calendar-table.scss index 0e1be73..518fbf1 100644 --- a/app/assets/sass/components/_calendar-table.scss +++ b/app/assets/sass/components/_calendar-table.scss @@ -1,59 +1,109 @@ // Import NHS.UK frontend library @use "nhsuk-frontend/dist/nhsuk/core" as *; -.app-full-viewport-width { - width: 100vw; - margin-left: calc(50% - 50vw); - margin-right: calc(50% - 50vw); - border: solid #d8dde0; - border-width: 2px 0; - padding: 1.5rem 0 0 0; -} -.app-full-viewport-width .calendar-table { - width: calc(100% - 4rem); - margin: 0 auto 2rem auto; -} - .calendar-table { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid #d8dde0; + + &.--js-enabled { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + th, + td { + @include nhsuk-font(16); + width: 14.2857%; + padding: 0.75rem; + vertical-align: top; + border-width: 1px; + } + + td { + height: 124px; + background-color: nhsuk-tint(nhsuk-colour("grey-5"), 50%); + } + + .calendar-table-no-data { + background-color: transparent; + } + .--session-assigned { + background-color: nhsuk-colour("white"); + } + .--date-selected { + background-color: nhsuk-colour("pale-yellow"); + } + + // the number that is the date + .calendar-table-date { + display: flex; + align-items: center; + justify-content: center; + width: 2rem; + height: 2rem; + border-radius: 50%; + background-color: nhsuk-colour("grey-5"); + margin-bottom: nhsuk-spacing(3); + } + + .--date-selected .calendar-table-date { + background-color: $nhsuk-focus-colour; + } + + .--schedule-start { + position: relative; + border-left-color: nhsuk-colour("grey-2"); + border-left-width: 2px; + + // Triangle marking the top-left corner + &::before { + content: ""; + position: absolute; + top: -1px; + left: -1px; + width: 12px; + height: 12px; + background-color: nhsuk-colour("grey-2"); + clip-path: polygon(0 0, 100% 0, 0 100%); + } + } + .--schedule-end { + position: relative; + border-right-color: nhsuk-colour("grey-2"); + border-right-width: 2px; + + // Triangle marking the top-right corner + &::before { + content: ""; + position: absolute; + top: -1px; + right: -1px; + width: 12px; + height: 12px; + background-color: nhsuk-colour("grey-2"); + clip-path: polygon(0 0, 100% 0, 100% 100%); + } + } } -.calendar-table th, -.calendar-table td { - @include nhsuk-font(16); - width: 14.2857%; - padding: 0.75rem; - vertical-align: top; - border-width: 1px; -} -.calendar-table td { - background-color: #fff; -} -.calendar-table td.calendar-table-capacity { - background-color: #fff; - background-image: - linear-gradient(to top, rgba(255,255,255,0.85), rgba(255,255,255,0.85)), - var(--generic-chart-hatch); - background-size: - 100% 100%, - 100% calc(var(--percentage, 0%)); - background-position: - left top, - left bottom; - background-repeat: - no-repeat, - no-repeat; -} -.calendar-table td.calendar-table-no-data { - background-color: transparent; + +.--session-locked { + display: flex; + align-items: center; + @include nhsuk-font-size(14); + color: nhsuk-colour("grey-2"); + margin-bottom: nhsuk-spacing(2); } -// .calendar-table-date { -// font-weight: bold; -// display: block; -// } + +/// +/// +/// +/// +/// +/// .calendar-table--apply-session { width: min(100%, 42rem); @@ -90,87 +140,3 @@ .calendar-table--apply-session td.calendar-table-cell--selected .calendar-table-date { color: #fff; } - - - -/// -/// - -.calendar-table { - - .--schedule-start { - position: relative; - border-left: 4px solid nhsuk-colour("grey-2"); - padding-bottom: 2em; - - // Chevron pointing into the cell from the left border - &::before { - content: ""; - position: absolute; - top: 50%; - left: -1px; - width: 8px; - height: 16px; - background-color: nhsuk-colour("grey-2"); - clip-path: polygon(0 0, 100% 50%, 0 100%); - transform: translateY(-50%); - } - } - .--schedule-end { - position: relative; - border-right: 4px solid nhsuk-colour("grey-2"); - - // Chevron pointing into the cell from the right border - &::before { - content: ""; - position: absolute; - top: 50%; - right: -1px; - width: 8px; - height: 16px; - background-color: nhsuk-colour("grey-2"); - clip-path: polygon(100% 0, 0 50%, 100% 100%); - transform: translateY(-50%); - } - } - - // .calendar-table-schedule-name { - // position: absolute; - // bottom: 0; - // left: 0; - // height: 1.75em; - // width: 100%; - // box-sizing: border-box; - // background-color: nhsuk-colour("grey-2"); - // color: #fff; - // } -} - -.calendar-table.--sketch { - td:not(.calendar-table-no-data) { - height: 124px; - background-color: nhsuk-tint(nhsuk-colour("grey-5"), 50%); - &.--session-assigned { - background-color: nhsuk-colour("white"); - } - } - .calendar-table-date { - display: block; - } - - td.calendar-table-capacity { - background-color: #fff; - background-image: - linear-gradient(to top, rgba(255,255,255,0.85), rgba(255,255,255,0.85)), - var(--generic-chart-hatch); - background-size: - 100% 100%, - 100% calc(var(--percentage, 0%)); - background-position: - left top, - left bottom; - background-repeat: - no-repeat, - no-repeat; - } -} \ No newline at end of file diff --git a/app/assets/sass/components/_grid-extensions.scss b/app/assets/sass/components/_grid-extensions.scss new file mode 100644 index 0000000..3e3b16a --- /dev/null +++ b/app/assets/sass/components/_grid-extensions.scss @@ -0,0 +1,9 @@ +@use "nhsuk-frontend/dist/nhsuk/core" as *; + +.nhsuk-grid-column-four-fifths { + @include nhsuk-grid-column(four-fifths); +} + +.nhsuk-grid-column-one-fifth { + @include nhsuk-grid-column(one-fifth); +} diff --git a/app/assets/sass/main.scss b/app/assets/sass/main.scss index a7c9bb6..b57d3dd 100755 --- a/app/assets/sass/main.scss +++ b/app/assets/sass/main.scss @@ -1,8 +1,20 @@ // Import NHS.UK frontend library +@use "sass:math"; + @forward "nhsuk-frontend/dist/nhsuk/nhsuk" with ( - $nhsuk-page-width: 1280px + $nhsuk-page-width: 1280px, + $nhsuk-grid-widths: ( + one-quarter: math.percentage(math.div(1, 4)), + one-third: math.percentage(math.div(1, 3)), + one-half: math.percentage(math.div(1, 2)), + two-thirds: math.percentage(math.div(2, 3)), + three-quarters: math.percentage(math.div(3, 4)), + one-fifth: math.percentage(math.div(1, 5)), + four-fifths: math.percentage(math.div(4, 5)), + full: 100% + ) ); -//@forward "nhsuk-frontend/dist/nhsuk/nhsuk"; + @use "nhsuk-frontend/dist/nhsuk/core" as *; // Stolen Manage prototype components :P @@ -10,6 +22,7 @@ @forward "components/calendar-table"; @forward "components/clinic-level-breadcrumbs"; +@forward "components/grid-extensions"; @forward "components/inline-detailed-search"; @forward "components/secondary-navigation"; @forward "components/participant-table"; @@ -92,3 +105,12 @@ a { align-items: center; width: 100%; } + + +.nhsuk-grid-column-four-fifths { + @include nhsuk-grid-column(four-fifths); +} + +.nhsuk-grid-column-one-fifth { + @include nhsuk-grid-column(one-fifth); +} diff --git a/app/routes.js b/app/routes.js index ef859cb..562634c 100644 --- a/app/routes.js +++ b/app/routes.js @@ -724,4 +724,7 @@ router.post('/sessions/02-organise-slots', function (req, res) { // Isolated September Test (Mission 1) routes router.use(require('./routes/mission-1')); +// Isolated create capacity from zero routes +router.use(require('./routes/create-capacity-from-zero')); + module.exports = router diff --git a/app/routes/create-capacity-from-zero.js b/app/routes/create-capacity-from-zero.js new file mode 100644 index 0000000..95ef28d --- /dev/null +++ b/app/routes/create-capacity-from-zero.js @@ -0,0 +1,13 @@ +const express = require('express') +const router = express.Router() + +// Routes and functions specific to Create Capacity From Zero +/* + +/app/views/create-capacity-from-zero/ + +*/ + + + +module.exports = router \ No newline at end of file diff --git a/app/views/create-capacity-from-zero/_local-includes/clinic-summary.html b/app/views/create-capacity-from-zero/_local-includes/clinic-summary.html new file mode 100644 index 0000000..ce43916 --- /dev/null +++ b/app/views/create-capacity-from-zero/_local-includes/clinic-summary.html @@ -0,0 +1,47 @@ +
No schedules yet
+ Add a new schedule +| Monday | -Tuesday | -Wednesday | -Thursday | -Friday | -Saturday | -Sunday | -
|---|---|---|---|---|---|---|
| - No data - | -- No data - | -- No data - | -- No data - | -- No data - | -- 1 - | -- 2 - | -
| - 3 - | -- 4 - | -- 5 - | -- 6 - | -- 7 - | -- 8 - | -- 9 - | -
| - 10 - | -- 11 - | -- 12 - | -- 13 - | -- 14 - | -- 15 - | -- 16 - | -
| - 17 - | -- 18 - | -- 19 - | -- 20 - | -- 21 - | -- 22 - | -- 23 - | -
| - 24 - | -- 25 - | -- 26 - | -- 27 - | -- 28 - | -- 29 - | -- 30 - | -
| - 31 - | -- No data - | -- No data - | -- No data - | -- No data - | -- No data - | -- No data - | -
| - No data - | -- 1 - | -- 2 - | - 3 - | -- 4 - | -- 5 - | -- 6 - | -|||||
7
@@ -309,45 +94,37 @@
6 booked |
- + |
12
-
- 32 available - 10 booked - 5 held |
- + |
13
-
- 27 available - 15 booked - 6 held |
|||||||
|
- 14
+ 13
24 available 18 booked 7 held |
- 15
+ 14
20 available 22 booked 8 held |
- 16
+ 15
17 available 25 booked 5 held |
- 17
+ 16
12 available 30 booked @@ -355,25 +132,17 @@ |
- 18
+ 17
30 available 12 booked 4 held |
- + |
19
-
- 22 available - 20 booked - 5 held |
- + |
20
-
- 14 available - 28 booked - 7 held |
|||
|
- 22
+ 21
26 available 16 booked 6 held |
- 23
+ 22
18 available 24 booked 8 held |
- 24
+ 23
10 available 32 booked 5 held |
- 25
+ 24
4 available 38 booked 4 held |
- + |
26
-
- 37 available - 5 booked - 6 held |
- + |
27
-
- 28 available - 14 booked - 7 held |
||||
| No data | ++ No data + |
1
@@ -502,29 +266,22 @@
17 booked |
- + |
3
-
- 19 available - 23 booked - 6 held |
- + |
4
-
- 11 available - 31 booked - 7 held |
+ |||||
|
5
-
- 2 available - 40 booked - 4 held + {{ padlockSvg | safe }} + + 42 slots + 0 booked + 8 held |
- |||||||||||
6
@@ -553,52 +310,37 @@
35 booked |
- + |
10
-
- 31 available - 11 booked - 5 held |
- + |
11
-
- 22 available - 20 booked - 6 held - |
-
- 12
-
- 16 available - 26 booked - 7 held |
||||||
|
- 13
+ 12
29 available 13 booked 4 held |
- 14
+ 13
20 available 22 booked 5 held |
- 15
+ 14
9 available 33 booked 6 held |
- 16
+ 15
39 available 3 booked @@ -606,32 +348,59 @@ |
- 17
+ 16
1 available 41 booked 8 held |
- 18 + 17 | - 19 + 18 | |||||
| + |
+ 19
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
20
- Schedule name
+ {{ 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 |
24
@@ -639,22 +408,47 @@
| ||
| + |
+ 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 |
31
@@ -662,9 +456,6 @@
|
| + Clinic + | ++ Unit and location + | ++ Current schedules + | ++ Current capacity + | +
|---|---|---|---|
|
+ Chichester - St Richards + HWO-NNN-standard-20260501 + |
+
+ Alpha van + St Richard’s Hospital, Chichester + |
+ + 31 August 2026 to 9 October 2026 + | +
+ 1500 slots available + 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 + |
+
| Monday | +Tuesday | +Wednesday | +Thursday | +Friday | +Saturday | +Sunday | +
|---|---|---|---|---|---|---|
| + 7 + | ++ 8 + | ++ 9 + | ++ 10 + | ++ 11 + | ++ 12 + | ++ 13 + | +
| + 14 + | ++ 15 + | ++ 16 + | ++ 17 + | ++ 18 + | ++ 19 + | ++ 20 + | +
| + 21 + | ++ 22 + | ++ 23 + | ++ 24 + | ++ 25 + | ++ 26 + | ++ 27 + | +
| + 28 + | ++ 29 + | ++ 30 + | ++ No data + | ++ No data + | ++ No data + | ++ No data + | +
| Monday | +Tuesday | +Wednesday | +Thursday | +Friday | +Saturday | +Sunday | +
|---|---|---|---|---|---|---|
| + No data + | ++ No data + | ++ No data + | ++ 1 + | ++ 2 + | ++ 3 + | ++ 4 + | +
| + 6 + | ++ 7 + | ++ 8 + | ++ 9 + | ++ 10 + | ++ 11 + | ++ 12 + | +
| + 13 + | ++ 14 + | ++ 15 + | ++ 16 + | ++ 17 + | ++ 18 + | ++ 19 + | +
| Monday | +Tuesday | +Wednesday | +Thursday | +Friday | +Saturday | +Sunday | +
|---|---|---|---|---|---|---|
|
+ 7
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 8
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 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 + | ++ 13 + | +
|
+ 14
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 15
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 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 + | ++ 20 + | +
|
+ 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 + |
+
+ 24
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 25
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+ + 26 + | ++ 27 + | +
|
+ 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 + |
+ + No data + | ++ No data + | ++ No data + | ++ No data + | +
| Monday | +Tuesday | +Wednesday | +Thursday | +Friday | +Saturday | +Sunday | +
|---|---|---|---|---|---|---|
| + No data + | ++ No data + | ++ No data + | +
+ 1
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 2
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+ + 3 + | ++ 4 + | +
|
+ 6
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 7
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 8
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 9
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 10
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+ + 11 + | ++ 12 + | +
|
+ 13
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 14
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 15
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 16
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+
+ 17
+ {{ padlockSvg | safe }}
+
+ 42 slots + 0 booked + 8 held + |
+ + 18 + | ++ 19 + | +