Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions app/assets/javascript/calendar-table-actions.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -59,7 +56,6 @@
clickedScheduleName.textContent = isAlreadySelected ? 'Select schedule' : 'Deselect schedule';
}

lastSelectedCell = clickedStartCell;
return;
}

Expand All @@ -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);
});
});
}

7 changes: 7 additions & 0 deletions app/assets/sass/components/_calendar-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
text-wrap: nowrap;
}
}

.--schedule-end {
position: relative;
border-right-color: nhsuk-colour("grey-2");
Expand Down Expand Up @@ -109,6 +110,12 @@
margin-bottom: nhsuk-spacing(2);
}

.--template-name {
display: block;
padding: nhsuk-spacing(1);
margin-top: nhsuk-spacing(2);
}

///
///
///
Expand Down
18 changes: 18 additions & 0 deletions app/assets/sass/components/_clinic-capacity-summary.scss
Original file line number Diff line number Diff line change
@@ -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;
}

}
24 changes: 17 additions & 7 deletions app/assets/sass/components/_progress-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
19 changes: 19 additions & 0 deletions app/assets/sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -42,6 +43,24 @@ a {
@extend .nhsuk-link--no-visited-state;
}

// Makes a <button> look and behave like the .panel-item links it sits alongside
.app-link-button {
display: block;
width: 100%;
padding: 0;
border: 0;
background: none;
text-align: left;
font: inherit;
color: $nhsuk-link-colour;
cursor: pointer;

&:hover {
color: nhsuk-shade($nhsuk-link-colour, 20%);
text-decoration: underline;
}
}

.app-card-editable {
display: flex;
justify-content: space-between;
Expand Down
3 changes: 1 addition & 2 deletions app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

module.exports = {
// Service name
serviceName: 'Cohort to clinic prototype',

serviceName: "Cohort to clinic prototype",
// Port to run the prototype on locally
port: 3000
}
8 changes: 6 additions & 2 deletions app/data/session-data-defaults.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const participants = require('./participants')

// currently just for the September Test "clickthru"
module.exports = {
participants,
stagedCount: 0,
Expand All @@ -14,5 +13,10 @@ module.exports = {
clinicLength: "1 day",
clinicCapacityPercentBooked: "0",
clinicCapacityAvailable: "10",
clinicCapacityTotal: "10"
clinicCapacityTotal: "10",
createCapacityFromZero: {
schedules: [],
selectedDays: [],
dayTemplates: {}
}
}
33 changes: 33 additions & 0 deletions app/locals.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ module.exports = function(req, res, next) {
//
// req.locals.organisationName = 'NHS'

res.locals.bsoName = "Mereford and Wensley Breast Screening Service"
res.locals.bsoCode = "MW01"
res.locals.staticBaseUnit = "Mereford and Wensley Screening Centre"
res.locals.staticLocationShort = "Mereford and Wensley District Hospital"
res.locals.mobileUnits = [
"Davison",
"Drummond",
"Dunlop",
"Garrud",
"Howey",
"Kenney",
"Lenton",
"Pankhurst"
]
res.locals.locationsShort = [
"Brookfield Sports Pavilion",
"East Mereford Community Hub",
"Kingsmead Swimming Centre",
"Mereford Central",
"Mereford Civic Centre",
"Mereford Library",
"Mereford Showground",
"Northgate Food Hall",
"Riverside Sports Centre",
"South Mereford",
"Wensley Community Hospital",
"Wensley Cross",
"Wensley Leisure Centre",
"Wensley Park",
"Wensley Town Hall",
"West Wensley Foodstore"
]

next()
}

Loading
Loading