Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
224 changes: 95 additions & 129 deletions app/assets/sass/components/_calendar-table.scss
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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;
}
}
9 changes: 9 additions & 0 deletions app/assets/sass/components/_grid-extensions.scss
Original file line number Diff line number Diff line change
@@ -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);
}
26 changes: 24 additions & 2 deletions app/assets/sass/main.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
// 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
// https://github.com/NHSDigital/manage-breast-screening-prototype

@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";
Expand Down Expand Up @@ -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);
}
3 changes: 3 additions & 0 deletions app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions app/routes/create-capacity-from-zero.js
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-four-fifths">
<h1 class="nhsuk-heading-l">
<span class="nhsuk-caption-l">Clinic</span>
Chichester - St Richards
</h1>
<p>
<a href="#">Alpha van</a><br>
<a href="#">St Richard’s Hospital, Chichester</a>
</p>
</div>
<div class="nhsuk-grid-column-one-fifth">
<ul class="nhsuk-list">
<li>
<a href="#">Edit clinic name</a>
</li>
<li>
<a href="#">Change unit and location</a>
</li>
<li>
<a href="#" class="app-link--warning">Archive this clinic</a>
</li>
</ul>
</div>
</div>

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-full">
{% set secondaryNavItems = [] %}

{% for item in [
{ href: '#', label: 'Current schedules', selected: 'true' },
{ href: '#', label: 'Past schedules' }
] %}
{% set secondaryNavItems = secondaryNavItems | push({
text: item.label | safe,
href: item.href | trim,
current: true if item.selected == 'true'
}) %}
{% endfor %}

{{ appSecondaryNavigation({
visuallyHiddenTitle: "Secondary menu",
items: secondaryNavItems
}) }}
</div>
</div>
Loading