@ons/design-system 51.0.0 → 53.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/components/address-input/autosuggest.address.setter.js +6 -2
- package/components/button/_button.scss +75 -33
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +2 -2
- package/components/checkboxes/checkbox-with-autoselect.js +2 -1
- package/components/external-link/_macro.njk +5 -2
- package/components/external-link/_macro.spec.js +18 -1
- package/components/footer/_footer.scss +19 -4
- package/components/footer/_macro.njk +103 -97
- package/components/footer/_macro.spec.js +131 -2
- package/components/header/_header.scss +65 -46
- package/components/header/_macro.njk +172 -120
- package/components/header/_macro.spec.js +85 -29
- package/components/hero/_hero.scss +30 -140
- package/components/hero/_macro.njk +13 -20
- package/components/hero/_macro.spec.js +32 -29
- package/components/icons/_macro.njk +257 -29
- package/components/icons/_macro.spec.js +6 -6
- package/components/input/_input.scss +8 -0
- package/components/language-selector/_macro.njk +1 -1
- package/components/language-selector/_macro.spec.js +9 -1
- package/components/mutually-exclusive/_macro.njk +1 -1
- package/components/mutually-exclusive/_macro.spec.js +2 -0
- package/components/navigation/_macro.njk +42 -35
- package/components/navigation/_macro.spec.js +34 -32
- package/components/navigation/_navigation.scss +20 -4
- package/components/question/_macro.njk +12 -10
- package/components/related-content/_macro.njk +13 -21
- package/components/related-content/_macro.spec.js +18 -27
- package/components/related-content/_section-macro.njk +10 -0
- package/components/related-content/_section-macro.spec.js +43 -0
- package/components/share-page/_macro.njk +4 -2
- package/css/census.css +3 -1
- package/css/ids.css +2 -0
- package/css/main.css +1 -1
- package/img/dummy-brand-logo.svg +1 -0
- package/layout/_template.njk +8 -4
- package/package.json +1 -1
- package/scripts/main.es5.js +2 -2
- package/scripts/main.js +1 -1
- package/scss/ids.scss +2 -0
- package/scss/settings/_census.scss +141 -0
- package/scss/settings/_ids.scss +48 -0
- package/scss/utilities/_margin.scss +1 -0
- package/scss/vars/_colors.scss +5 -2
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ONSdigital/design-system/releases)
|
|
4
4
|
[](https://github.com/ONSdigital/design-system/actions/workflows/tests.yml)
|
|
5
|
-
[](https://codecov.io/gh/ONSdigital/design-system)
|
|
6
|
-
[](https://www.codacy.com/app/bameyrick/design-system)
|
|
7
5
|
[](https://github.com/ONSdigital/design-system/pulls)
|
|
8
6
|
[](https://github.com/ONSdigital/design-system/commits)
|
|
9
7
|
[](https://github.com/ONSdigital/design-system/graphs/contributors)
|
|
@@ -104,14 +104,18 @@ export default class AddressSetter {
|
|
|
104
104
|
|
|
105
105
|
clearManualInputs() {
|
|
106
106
|
this.manualInputs.forEach(input => {
|
|
107
|
-
input
|
|
107
|
+
if (input) {
|
|
108
|
+
input.value = '';
|
|
109
|
+
}
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
checkManualInputsValues(onLoad) {
|
|
112
114
|
if (onLoad) {
|
|
113
115
|
this.originalValues = this.manualInputs.map(input => {
|
|
114
|
-
|
|
116
|
+
if (input) {
|
|
117
|
+
return input.value;
|
|
118
|
+
}
|
|
115
119
|
});
|
|
116
120
|
} else if (this.uprn.value !== '' && this.originalValues.length) {
|
|
117
121
|
this.newValues = this.manualInputs.map(input => {
|
|
@@ -230,9 +230,9 @@ $button-shadow-size: 3px;
|
|
|
230
230
|
|
|
231
231
|
&--text-link-inverse & {
|
|
232
232
|
&__inner {
|
|
233
|
-
color: $color-
|
|
233
|
+
color: $color-text-inverse-link;
|
|
234
234
|
.ons-svg-icon {
|
|
235
|
-
fill: $color-
|
|
235
|
+
fill: $color-text-inverse-link;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -253,9 +253,9 @@ $button-shadow-size: 3px;
|
|
|
253
253
|
&--text-link-inverse:active &,
|
|
254
254
|
&--text-link-inverse.active & {
|
|
255
255
|
&__inner {
|
|
256
|
-
color: $color-
|
|
256
|
+
color: $color-text-inverse-link-hover;
|
|
257
257
|
.ons-svg-icon {
|
|
258
|
-
fill: $color-
|
|
258
|
+
fill: $color-text-inverse-link-hover;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -279,8 +279,7 @@ $button-shadow-size: 3px;
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
&--ghost
|
|
283
|
-
&--mobile & {
|
|
282
|
+
&--ghost & {
|
|
284
283
|
&__inner {
|
|
285
284
|
background: transparent;
|
|
286
285
|
border: 2px solid rgba(255, 255, 255, 0.6);
|
|
@@ -293,36 +292,51 @@ $button-shadow-size: 3px;
|
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
&--ghost-dark & {
|
|
296
|
-
@extend .ons-btn--secondary;
|
|
297
295
|
&__inner {
|
|
298
296
|
background: transparent;
|
|
299
|
-
border: 2px solid
|
|
297
|
+
border: 2px solid $color-black;
|
|
298
|
+
box-shadow: none;
|
|
300
299
|
color: $color-text;
|
|
300
|
+
.ons-svg-icon {
|
|
301
|
+
fill: $color-black;
|
|
302
|
+
}
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
|
|
304
306
|
&--ghost,
|
|
305
|
-
&--
|
|
306
|
-
&--
|
|
307
|
+
&--ghost-dark,
|
|
308
|
+
&--dropdown,
|
|
309
|
+
&--text-link {
|
|
307
310
|
&:active,
|
|
308
311
|
.active {
|
|
309
312
|
top: 0;
|
|
310
313
|
}
|
|
311
314
|
}
|
|
312
315
|
|
|
313
|
-
&--ghost:active:focus
|
|
316
|
+
&--ghost:active:focus,
|
|
317
|
+
&--ghost-dark:active:focus {
|
|
314
318
|
box-shadow: none;
|
|
315
319
|
outline: 3px solid transparent;
|
|
316
320
|
}
|
|
317
321
|
|
|
318
322
|
&--ghost:focus:hover,
|
|
319
|
-
&--
|
|
320
|
-
&--
|
|
323
|
+
&--ghost-dark:focus:hover,
|
|
324
|
+
&--dropdown:focus:hover,
|
|
325
|
+
&--text-link:focus:hover {
|
|
321
326
|
outline: none;
|
|
322
327
|
}
|
|
323
328
|
|
|
324
|
-
&--ghost:hover &,
|
|
325
|
-
&--
|
|
329
|
+
&--ghost-dark:focus:hover &,
|
|
330
|
+
&--dropdown:focus:hover & {
|
|
331
|
+
&__inner {
|
|
332
|
+
color: $color-text;
|
|
333
|
+
.ons-svg-icon {
|
|
334
|
+
fill: $color-text;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&--ghost:hover & {
|
|
326
340
|
&__inner {
|
|
327
341
|
background: rgba(0, 0, 0, 0.1);
|
|
328
342
|
border-color: $color-white;
|
|
@@ -330,11 +344,8 @@ $button-shadow-size: 3px;
|
|
|
330
344
|
}
|
|
331
345
|
|
|
332
346
|
&--ghost:active &,
|
|
333
|
-
&--mobile:active &,
|
|
334
347
|
&--ghost:active:focus &,
|
|
335
|
-
&--
|
|
336
|
-
&--ghost.active &,
|
|
337
|
-
&--mobile.active & {
|
|
348
|
+
&--ghost.active & {
|
|
338
349
|
&__inner {
|
|
339
350
|
background: rgba(0, 0, 0, 0.2);
|
|
340
351
|
border-color: rgba(255, 255, 255, 0.6);
|
|
@@ -345,8 +356,23 @@ $button-shadow-size: 3px;
|
|
|
345
356
|
}
|
|
346
357
|
}
|
|
347
358
|
|
|
359
|
+
&--ghost-dark:hover &,
|
|
360
|
+
&--ghost-dark:active &,
|
|
361
|
+
&--ghost-dark:active:focus &,
|
|
362
|
+
&--ghost-dark.active & {
|
|
363
|
+
&__inner {
|
|
364
|
+
background: $color-black;
|
|
365
|
+
border-color: $color-black;
|
|
366
|
+
color: $color-white;
|
|
367
|
+
.ons-svg-icon {
|
|
368
|
+
fill: $color-white;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
348
373
|
&--ghost.active:focus &,
|
|
349
|
-
&--
|
|
374
|
+
&--ghost-dark.active:focus &,
|
|
375
|
+
&--dropdown.active:focus & {
|
|
350
376
|
&__inner {
|
|
351
377
|
background: $color-focus;
|
|
352
378
|
color: $color-text-link-focus;
|
|
@@ -357,7 +383,8 @@ $button-shadow-size: 3px;
|
|
|
357
383
|
}
|
|
358
384
|
|
|
359
385
|
&--ghost:focus &,
|
|
360
|
-
&--
|
|
386
|
+
&--ghost-dark:focus &,
|
|
387
|
+
&--dropdown:focus & {
|
|
361
388
|
&__inner {
|
|
362
389
|
box-shadow: none;
|
|
363
390
|
.ons-svg-icon {
|
|
@@ -395,17 +422,22 @@ $button-shadow-size: 3px;
|
|
|
395
422
|
}
|
|
396
423
|
|
|
397
424
|
&--dropdown {
|
|
398
|
-
@extend .ons-btn--ghost;
|
|
399
425
|
@extend .ons-btn--mobile;
|
|
400
426
|
|
|
401
427
|
width: 100%;
|
|
428
|
+
}
|
|
402
429
|
|
|
403
|
-
|
|
430
|
+
&--dropdown & {
|
|
431
|
+
@extend .ons-btn--mobile;
|
|
432
|
+
|
|
433
|
+
width: 100%;
|
|
434
|
+
|
|
435
|
+
&__inner {
|
|
404
436
|
background: $color-branded-tint;
|
|
405
437
|
border: none;
|
|
406
438
|
border-radius: 0;
|
|
407
439
|
box-shadow: none;
|
|
408
|
-
color: $color-text
|
|
440
|
+
color: $color-branded-text;
|
|
409
441
|
display: block;
|
|
410
442
|
font-size: 1rem;
|
|
411
443
|
font-weight: normal;
|
|
@@ -413,20 +445,30 @@ $button-shadow-size: 3px;
|
|
|
413
445
|
text-align: left;
|
|
414
446
|
|
|
415
447
|
.ons-svg-icon {
|
|
416
|
-
fill: $color-text
|
|
448
|
+
fill: $color-branded-text;
|
|
417
449
|
float: right;
|
|
418
450
|
margin-top: 3px;
|
|
419
451
|
}
|
|
420
452
|
}
|
|
453
|
+
}
|
|
421
454
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
455
|
+
&--dropdown:hover & {
|
|
456
|
+
&__inner {
|
|
457
|
+
background: $color-branded-secondary;
|
|
458
|
+
color: $color-white;
|
|
459
|
+
.ons-svg-icon {
|
|
460
|
+
fill: $color-white;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
&--dropdown:active &,
|
|
466
|
+
&--dropdown:active:focus & {
|
|
467
|
+
&__inner {
|
|
468
|
+
background: $color-branded-secondary;
|
|
469
|
+
color: $color-white;
|
|
470
|
+
.ons-svg-icon {
|
|
471
|
+
fill: $color-white;
|
|
430
472
|
}
|
|
431
473
|
}
|
|
432
474
|
}
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
{% endif -%}
|
|
87
87
|
</span>
|
|
88
88
|
{% if params.url is defined and params.url and params.newWindow is defined and params.newWindow %}
|
|
89
|
-
<span class="ons-btn__new-window-description ons-u-vh">{{ params.newWindowDescription | default("opens in a new
|
|
89
|
+
<span class="ons-btn__new-window-description ons-u-vh">({{ params.newWindowDescription | default("opens in a new tab") }})</span>
|
|
90
90
|
{% endif %}
|
|
91
91
|
{% if params.buttonContext is defined and params.buttonContext %}
|
|
92
92
|
<span class="ons-btn__context ons-u-vh">{{ params.buttonContext }}</span>
|
|
@@ -407,7 +407,7 @@ describe('macro: button', () => {
|
|
|
407
407
|
}),
|
|
408
408
|
);
|
|
409
409
|
|
|
410
|
-
expect($('.ons-btn__new-window-description').text()).toBe('opens in a new
|
|
410
|
+
expect($('.ons-btn__new-window-description').text()).toBe('(opens in a new tab)');
|
|
411
411
|
});
|
|
412
412
|
|
|
413
413
|
it('has a custom new window description when `newWindow` is `true` and `newWindowDescription` is provided', () => {
|
|
@@ -419,7 +419,7 @@ describe('macro: button', () => {
|
|
|
419
419
|
}),
|
|
420
420
|
);
|
|
421
421
|
|
|
422
|
-
expect($('.ons-btn__new-window-description').text()).toBe('custom opens in a new window text');
|
|
422
|
+
expect($('.ons-btn__new-window-description').text()).toBe('(custom opens in a new window text)');
|
|
423
423
|
});
|
|
424
424
|
|
|
425
425
|
it('has the `download` attribute when `buttonStyle` is "download"', () => {
|
|
@@ -21,7 +21,8 @@ export default class CheckboxWithAutoSelect {
|
|
|
21
21
|
this.unselectAllText = this.button.getAttribute('data-unselect-all');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
handleButtonEvent() {
|
|
24
|
+
handleButtonEvent(event) {
|
|
25
|
+
event.preventDefault();
|
|
25
26
|
this.checkboxes.forEach(checkbox => {
|
|
26
27
|
checkbox.checked = this.allChecked === false ? true : false;
|
|
27
28
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{# Icon needed to be directly put here instead of calling macro to solve an issue with extra space on the end of links being underlined #}
|
|
2
2
|
{% macro onsExternalLink(params) %}
|
|
3
|
-
<a href="{{ params.url }}" class="ons-external-link{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}" target="_blank" rel="noopener">
|
|
3
|
+
<a href="{{ params.url }}" class="ons-external-link{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}" target="_blank" rel="noopener">
|
|
4
|
+
<span class="ons-external-link__text">
|
|
5
|
+
{{- params.linkText | safe -}}
|
|
6
|
+
</span><span class="ons-external-link__icon"> <svg class="ons-svg-icon" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true">
|
|
4
7
|
<path d="M13.5,9H13a.5.5,0,0,0-.5.5v3h-9v-9h3A.5.5,0,0,0,7,3V2.5A.5.5,0,0,0,6.5,2h-4a.5.5,0,0,0-.5.5v11a.5.5,0,0,0,.5.5h11a.5.5,0,0,0,.5-.5v-4A.5.5,0,0,0,13.5,9Z" transform="translate(-2 -1.99)"/>
|
|
5
8
|
<path d="M8.83,7.88a.51.51,0,0,0,.71,0l2.31-2.32,1.28,1.28A.51.51,0,0,0,14,6.49v-4a.52.52,0,0,0-.5-.5h-4A.51.51,0,0,0,9,2.52a.58.58,0,0,0,.14.33l1.28,1.28L8.12,6.46a.51.51,0,0,0,0,.71Z" transform="translate(-2 -1.99)"/>
|
|
6
|
-
</svg></span></a>
|
|
9
|
+
</svg></span><span class="ons-external-link__new-window-description ons-u-vh">({{- params.newWindowDescription | default("opens in a new tab") -}})</span></a>
|
|
7
10
|
{% endmacro %}
|
|
@@ -47,10 +47,27 @@ describe('macro: external-link', () => {
|
|
|
47
47
|
it('has the expected link text', async () => {
|
|
48
48
|
const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
|
|
49
49
|
|
|
50
|
-
const $hyperlink = $('a.ons-external-link');
|
|
50
|
+
const $hyperlink = $('a.ons-external-link .ons-external-link__text');
|
|
51
51
|
expect($hyperlink.text().trim()).toBe('Example link');
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
+
it('has a default new window description', async () => {
|
|
55
|
+
const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
|
|
56
|
+
|
|
57
|
+
expect($('.ons-external-link__new-window-description').text()).toBe('(opens in a new tab)');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('has a custom new window description when `newWindowDescription` is provided', () => {
|
|
61
|
+
const $ = cheerio.load(
|
|
62
|
+
renderComponent('external-link', {
|
|
63
|
+
...EXAMPLE_EXTERNAL_LINK,
|
|
64
|
+
newWindowDescription: 'custom opens in a new tab text',
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
expect($('.ons-external-link__new-window-description').text()).toBe('(custom opens in a new tab text)');
|
|
69
|
+
});
|
|
70
|
+
|
|
54
71
|
it('has an "external-link" icon', async () => {
|
|
55
72
|
const $ = cheerio.load(renderComponent('external-link', EXAMPLE_EXTERNAL_LINK));
|
|
56
73
|
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
background-color: $color-banner-bg-dark;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
&__license {
|
|
23
|
+
@extend .ons-u-fs-s;
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
&__ogl-img {
|
|
23
27
|
margin: 0 0.5rem 0.2rem 0;
|
|
24
28
|
max-width: 100%;
|
|
@@ -37,10 +41,6 @@
|
|
|
37
41
|
.ons-list__link {
|
|
38
42
|
margin-right: 0;
|
|
39
43
|
}
|
|
40
|
-
|
|
41
|
-
.ons-poweredbylogo {
|
|
42
|
-
min-height: 1.5rem;
|
|
43
|
-
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&--rows {
|
|
@@ -48,4 +48,19 @@
|
|
|
48
48
|
margin-bottom: 0.5rem !important;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
&__poweredby,
|
|
53
|
+
&__crest,
|
|
54
|
+
&__partnership {
|
|
55
|
+
font-size: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__partnership {
|
|
59
|
+
&-prefix {
|
|
60
|
+
@extend .ons-u-fs-s;
|
|
61
|
+
|
|
62
|
+
margin-bottom: 0.2rem;
|
|
63
|
+
margin-top: -0.3rem;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
51
66
|
}
|
|
@@ -9,33 +9,38 @@
|
|
|
9
9
|
{% set lang = 'en' %}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
|
+
{% set onsLogo %}
|
|
13
|
+
{% if params.lang == 'cy' %}
|
|
14
|
+
{{
|
|
15
|
+
onsIcon({
|
|
16
|
+
"iconType": 'ons-logo-cy',
|
|
17
|
+
"altText": 'Swyddfa Ystadegau Gwladol',
|
|
18
|
+
"altTextId": 'ons-logo-cy-footer-alt'
|
|
19
|
+
})
|
|
20
|
+
}}
|
|
21
|
+
{% else %}
|
|
22
|
+
{{
|
|
23
|
+
onsIcon({
|
|
24
|
+
"iconType": 'ons-logo-en',
|
|
25
|
+
"altText": 'Office for National Statistics',
|
|
26
|
+
"altTextId": 'ons-logo-en-footer-alt'
|
|
27
|
+
})
|
|
28
|
+
}}
|
|
29
|
+
{% endif %}
|
|
30
|
+
{% endset %}
|
|
31
|
+
|
|
12
32
|
{% set poweredByLogo %}
|
|
13
|
-
|
|
14
33
|
{% if params.poweredBy is defined and params.poweredBy and params.poweredBy.logo is defined and params.poweredBy.logo %}
|
|
15
34
|
{{
|
|
16
35
|
onsIcon({
|
|
17
36
|
"iconType": params.poweredBy.logo,
|
|
18
|
-
"altText": params.poweredBy.alt
|
|
37
|
+
"altText": params.poweredBy.alt,
|
|
38
|
+
"altTextId": 'poweredby-alt'
|
|
19
39
|
})
|
|
20
40
|
}}
|
|
21
41
|
{% else %}
|
|
22
|
-
{
|
|
23
|
-
{{
|
|
24
|
-
onsIcon({
|
|
25
|
-
"iconType": 'ons-logo-cy',
|
|
26
|
-
"altText": params.poweredBy.alt | default('Swyddfa Ystadegau Gwladol')
|
|
27
|
-
})
|
|
28
|
-
}}
|
|
29
|
-
{% else %}
|
|
30
|
-
{{
|
|
31
|
-
onsIcon({
|
|
32
|
-
"iconType": 'ons-logo-en',
|
|
33
|
-
"altText": params.poweredBy.alt | default('Office for National Statistics')
|
|
34
|
-
})
|
|
35
|
-
}}
|
|
36
|
-
{% endif %}
|
|
42
|
+
{{ onsLogo | safe }}
|
|
37
43
|
{% endif %}
|
|
38
|
-
|
|
39
44
|
{% endset %}
|
|
40
45
|
|
|
41
46
|
<footer class="ons-footer">
|
|
@@ -81,12 +86,6 @@
|
|
|
81
86
|
<div class="ons-footer__body{{ ' ' + params.classes if params.classes else '' }}" data-analytics="footer" {% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}>
|
|
82
87
|
<div class="ons-container{{ ' ons-container--wide' if params.wide }}">
|
|
83
88
|
<div class="ons-grid">
|
|
84
|
-
{% if params.poweredBy is defined and params.poweredBy and params.OGLLink is defined and params.OGLLink %}
|
|
85
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
86
|
-
{{ poweredByLogo | safe }}
|
|
87
|
-
</div>
|
|
88
|
-
{% endif %}
|
|
89
|
-
|
|
90
89
|
{% if params.newTabWarning is defined and params.newTabWarning %}
|
|
91
90
|
<div class="ons-grid__col">
|
|
92
91
|
<p class="ons-u-fs-s ons-u-mb-m ons-footer__new-tab-warning">{{ params.newTabWarning | safe }}</p>
|
|
@@ -95,6 +94,7 @@
|
|
|
95
94
|
|
|
96
95
|
{% if params.cols is defined and params.cols %}
|
|
97
96
|
{% for col in params.cols %}
|
|
97
|
+
<!-- Full footer columns -->
|
|
98
98
|
<div class="ons-grid__col ons-col-4@m{{ ' ons-u-mt-m@xxs@m' if loop.index > 1 }}">
|
|
99
99
|
{% if col.title %}
|
|
100
100
|
<h2 class="ons-footer__heading ons-u-fs-r--b">{{ col.title }}</h2>
|
|
@@ -108,17 +108,9 @@
|
|
|
108
108
|
}}
|
|
109
109
|
</div>
|
|
110
110
|
{% endfor %}
|
|
111
|
-
{%
|
|
112
|
-
|
|
113
|
-
{% if params.cols is defined and params.cols and params.rows is defined and params.rows %}
|
|
114
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
115
|
-
<hr class="ons-footer__hr">
|
|
116
|
-
</div>
|
|
117
|
-
{% endif %}
|
|
118
|
-
|
|
119
|
-
{% if params.rows is defined and params.rows %}
|
|
111
|
+
{% elif params.rows is defined and params.rows %}
|
|
120
112
|
{% for row in params.rows %}
|
|
121
|
-
<!--
|
|
113
|
+
<!-- Transactional footer row -->
|
|
122
114
|
<div class="ons-grid__col">
|
|
123
115
|
{{
|
|
124
116
|
onsList({
|
|
@@ -128,105 +120,119 @@
|
|
|
128
120
|
})
|
|
129
121
|
}}
|
|
130
122
|
</div>
|
|
131
|
-
{% if loop.length > 1 %}
|
|
132
|
-
{% if not loop.last %}
|
|
133
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
134
|
-
<hr class="ons-footer__hr">
|
|
135
|
-
</div>
|
|
136
|
-
{% endif %}
|
|
137
|
-
{% endif %}
|
|
138
123
|
{% endfor %}
|
|
139
124
|
{% endif %}
|
|
140
125
|
|
|
141
|
-
{% if params.
|
|
142
|
-
<!-- OGL -->
|
|
126
|
+
{% if (params.cols is defined and params.cols) or (params.rows is defined and params.rows) %}
|
|
143
127
|
<div class="ons-grid__col ons-u-mb-m">
|
|
144
128
|
<hr class="ons-footer__hr">
|
|
145
129
|
</div>
|
|
146
|
-
|
|
147
|
-
<div class="ons-grid__col">
|
|
148
|
-
<div class="ons-footer__license">
|
|
149
|
-
{{
|
|
150
|
-
onsIcon({
|
|
151
|
-
"iconType": 'ogl'
|
|
152
|
-
})
|
|
153
|
-
}}
|
|
154
|
-
{% if params.OGLLink.HTML is defined and params.OGLLink.HTML %}
|
|
155
|
-
{{ params.OGLLink.HTML | safe }}
|
|
156
|
-
{% else %}
|
|
157
|
-
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
158
|
-
{{ params.OGLLink.pre }} {{
|
|
159
|
-
onsExternalLink({
|
|
160
|
-
"url": params.OGLLink.url,
|
|
161
|
-
"linkText": params.OGLLink.link
|
|
162
|
-
})
|
|
163
|
-
}}{{ params.OGLLink.post }}
|
|
164
|
-
{% endif %}
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
130
|
{% endif %}
|
|
168
131
|
|
|
169
|
-
{% if params.legal is defined and params.legal or params.rows is defined and params.rows and params.OGLLink is not defined or params.OGLLink is not defined and params.legal is not defined and (params.rows is defined and params.rows or params.cols is defined and params.cols) %}
|
|
170
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
171
|
-
<hr class="ons-footer__hr">
|
|
172
|
-
</div>
|
|
173
|
-
{% endif %}
|
|
174
|
-
|
|
175
|
-
{% if params.OGLLink is not defined and params.legal is not defined %}
|
|
176
|
-
<div class="ons-grid__col">
|
|
177
|
-
{{ poweredByLogo | safe }}
|
|
178
|
-
</div>
|
|
179
|
-
{% endif %}
|
|
180
132
|
</div>
|
|
181
133
|
|
|
182
|
-
{% if params.legal is defined and params.legal or params.rows is defined and params.rows and params.OGLLink is not defined or params.cols is defined and params.cols and params.OGLLink is not defined %}
|
|
183
134
|
<div class="ons-grid ons-grid--flex ons-grid--vertical-top ons-grid--between">
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
135
|
+
<div class="ons-grid__col">
|
|
136
|
+
{% if params.legal is defined and params.legal %}
|
|
137
|
+
<!-- Legal -->
|
|
138
|
+
{% for legal in params.legal %}
|
|
188
139
|
{{
|
|
189
140
|
onsList({
|
|
190
|
-
"classes": 'ons-u-mb-
|
|
141
|
+
"classes": 'ons-u-mb-s ons-footer--rows',
|
|
191
142
|
"variants": ['bare', 'inline'],
|
|
192
143
|
"itemsList": legal.itemsList
|
|
193
144
|
})
|
|
194
145
|
}}
|
|
195
|
-
|
|
196
|
-
|
|
146
|
+
{% endfor %}
|
|
147
|
+
{% endif %}
|
|
148
|
+
|
|
149
|
+
{% if params.OGLLink == true or params.OGLLink is defined %}
|
|
150
|
+
<!-- OGL -->
|
|
151
|
+
<div class="ons-footer__license ons-u-mb-m">
|
|
152
|
+
{{
|
|
153
|
+
onsIcon({
|
|
154
|
+
"iconType": 'ogl'
|
|
155
|
+
})
|
|
156
|
+
}}
|
|
157
|
+
{% if params.OGLLink.HTML is defined and params.OGLLink.HTML %}
|
|
158
|
+
{{ params.OGLLink.HTML | safe }}
|
|
159
|
+
{% elif params.OGLLink == true or params.OGLLink is defined %}
|
|
160
|
+
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
161
|
+
{% if params.lang == 'cy' %}
|
|
162
|
+
{{ params.OGLLink.pre | default('Mae’r holl gynnwys ar gael o dan y') }} {{
|
|
163
|
+
onsExternalLink({
|
|
164
|
+
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
165
|
+
"linkText": params.OGLLink.link | default('Drwydded Llywodraeth Leol v3.0')
|
|
166
|
+
})
|
|
167
|
+
}}{{ params.OGLLink.post | default(', oni bai y nodir fel arall') }}
|
|
168
|
+
{% else %}
|
|
169
|
+
{{ params.OGLLink.pre | default('All content is available under the') }} {{
|
|
170
|
+
onsExternalLink({
|
|
171
|
+
"url": params.OGLLink.url | default('https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/'),
|
|
172
|
+
"linkText": params.OGLLink.link | default('Open Government Licence v3.0')
|
|
173
|
+
})
|
|
174
|
+
}}{{ params.OGLLink.post | default(', except where otherwise stated') }}
|
|
175
|
+
{% endif %}
|
|
197
176
|
{% endif %}
|
|
198
177
|
</div>
|
|
199
|
-
{%
|
|
200
|
-
|
|
178
|
+
{% endif %}
|
|
179
|
+
|
|
180
|
+
{% if not params.poweredBy.partnership %}
|
|
181
|
+
<div class="ons-footer__poweredby ons-u-mb-m">
|
|
182
|
+
{{ poweredByLogo | safe }}
|
|
183
|
+
</div>
|
|
184
|
+
{% endif %}
|
|
185
|
+
</div>
|
|
201
186
|
|
|
202
187
|
{% if params.crest is defined and params.crest %}
|
|
203
188
|
<!-- Crest -->
|
|
204
|
-
<div class="ons-grid__col ons-footer__crest">
|
|
189
|
+
<div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
|
|
205
190
|
{{
|
|
206
191
|
onsIcon({
|
|
207
192
|
"iconType": 'crest'
|
|
208
193
|
})
|
|
209
194
|
}}
|
|
210
195
|
</div>
|
|
211
|
-
{% elif params.legal is defined and params.legal %}
|
|
212
|
-
<!-- Powered by -->
|
|
213
|
-
<div class="ons-grid__col">
|
|
214
|
-
<div class="ons-poweredbylogo">{{ poweredByLogo | safe }}</div>
|
|
215
|
-
</div>
|
|
216
196
|
{% endif %}
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
{% if (params.poweredBy is defined and params.poweredBy) and (params.poweredBy.partnership is defined and params.poweredBy.partnership) %}
|
|
200
|
+
<div class="ons-grid ons-grid--flex ons-grid--vertical-bottom ons-grid--between ons-u-mt-l">
|
|
201
|
+
<div class="ons-grid__col ons-footer__poweredby ons-u-mb-m">
|
|
202
|
+
{{ poweredByLogo | safe }}
|
|
203
|
+
</div>
|
|
217
204
|
|
|
205
|
+
<div class="ons-grid__col ons-footer__partnership ons-u-mb-m">
|
|
206
|
+
<div class="ons-footer__partnership-prefix">{{ params.poweredBy.partnership }}</div>
|
|
207
|
+
{% if params.lang == 'cy' %}
|
|
208
|
+
{{
|
|
209
|
+
onsIcon({
|
|
210
|
+
"iconType": 'ons-logo-cy',
|
|
211
|
+
"altText": 'Swyddfa Ystadegau Gwladol',
|
|
212
|
+
"altTextId": 'ons-logo-cy-footer-alt'
|
|
213
|
+
})
|
|
214
|
+
}}
|
|
215
|
+
{% else %}
|
|
216
|
+
{{
|
|
217
|
+
onsIcon({
|
|
218
|
+
"iconType": 'ons-logo-en',
|
|
219
|
+
"altText": 'Office for National Statistics',
|
|
220
|
+
"altTextId": 'ons-logo-en-footer-alt'
|
|
221
|
+
})
|
|
222
|
+
}}
|
|
223
|
+
{% endif %}
|
|
224
|
+
</div>
|
|
218
225
|
</div>
|
|
219
226
|
{% endif %}
|
|
220
227
|
|
|
221
228
|
{% if params.copyrightDeclaration is defined and params.copyrightDeclaration %}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
</div>
|
|
229
|
+
<!-- Copyright -->
|
|
230
|
+
<div class="ons-grid">
|
|
231
|
+
<div class="ons-grid__col">
|
|
232
|
+
<p class="ons-u-fs-s ons-u-mb-no ons-footer__copyright">© {{ params.copyrightDeclaration.copyright }} <br> {{ params.copyrightDeclaration.text }}</p>
|
|
227
233
|
</div>
|
|
234
|
+
</div>
|
|
228
235
|
{% endif %}
|
|
229
|
-
|
|
230
236
|
</div>
|
|
231
237
|
</div>
|
|
232
238
|
</footer>
|