Skip to content

Commit c0087ae

Browse files
Initial admin/support interface (#237)
1 parent 841b251 commit c0087ae

38 files changed

+21437
-1011
lines changed

app/assets/sass/components/_table.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ table {
5353
padding-right: 8px;
5454
}
5555

56+
.nhsuk-table--padding-2 tr th:first-child,
57+
.nhsuk-table--padding-2 tr td:first-child {
58+
padding-left: 0;
59+
}
60+
61+
.nhsuk-table--padding-2 tr th:last-child,
62+
.nhsuk-table--padding-2 tr td:last-child {
63+
padding-right: 0;
64+
}
65+
5666
.nhsuk-table tbody tr:last-child td,
5767
.nhsuk-table tbody tr:last-child th {
5868
border-bottom-width: 3px;

app/data/feature-flags.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = [
2+
{
3+
id: "newRecordInterface",
4+
name: "New streamlined Record interface"
5+
},
6+
{
7+
id: "paymentIntegration",
8+
name: "BSA Payment API integration"
9+
}
10+
]

app/data/filters.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
const prototypeFilters = require('@x-govuk/govuk-prototype-filters');
3+
4+
module.exports = function (env) { /* eslint-disable-line no-unused-vars */
5+
/**
6+
* Instantiate object used to store the methods registered as a
7+
* 'filter' (of the same name) within nunjucks. You can override
8+
* gov.uk core filters by creating filter methods of the same name.
9+
* @type {Object}
10+
*/
11+
const filters = prototypeFilters;
12+
13+
14+
filters.dayName = function(isoDate) {
15+
16+
const date = new Date(Date.parse(isoDate))
17+
const dateFormatter = new Intl.DateTimeFormat('en-GB', {weekday: 'short'});
18+
19+
return dateFormatter.format(date)
20+
}
21+
22+
/* ------------------------------------------------------------------
23+
add your methods to the filters obj below this comment block:
24+
@example:
25+
26+
filters.sayHi = function(name) {
27+
return 'Hi ' + name + '!'
28+
}
29+
30+
Which in your templates would be used as:
31+
32+
{{ 'Paul' | sayHi }} => 'Hi Paul'
33+
34+
Notice the first argument of your filters method is whatever
35+
gets 'piped' via '|' to the filter.
36+
37+
Filters can take additional arguments, for example:
38+
39+
filters.sayHi = function(name,tone) {
40+
return (tone == 'formal' ? 'Greetings' : 'Hi') + ' ' + name + '!'
41+
}
42+
43+
Which would be used like this:
44+
45+
{{ 'Joel' | sayHi('formal') }} => 'Greetings Joel!'
46+
{{ 'Gemma' | sayHi }} => 'Hi Gemma!'
47+
48+
For more on filters and how to write them see the Nunjucks
49+
documentation.
50+
51+
------------------------------------------------------------------ */
52+
53+
/* ------------------------------------------------------------------
54+
keep the following line to return your filters to the app
55+
------------------------------------------------------------------ */
56+
return filters;
57+
};

0 commit comments

Comments
 (0)