@ons/design-system 50.0.1 → 53.0.0
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 +35 -15
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +162 -0
- package/components/access-code/uac.spec.js +26 -0
- package/components/accordion/_macro.spec.js +224 -0
- package/components/accordion/accordion.spec.js +134 -0
- package/components/address-input/_macro.njk +1 -1
- package/components/address-input/_macro.spec.js +465 -0
- package/components/address-input/autosuggest.address.js +5 -4
- package/components/address-input/autosuggest.address.setter.js +9 -3
- package/components/address-input/autosuggest.address.spec.js +733 -0
- package/components/address-output/_macro.njk +6 -6
- package/components/address-output/_macro.spec.js +122 -0
- package/components/autosuggest/_macro.njk +1 -1
- package/components/autosuggest/_macro.spec.js +229 -0
- package/components/autosuggest/autosuggest.helpers.js +2 -3
- package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
- package/components/autosuggest/autosuggest.js +4 -2
- package/components/autosuggest/autosuggest.spec.js +625 -0
- package/components/autosuggest/autosuggest.ui.js +6 -2
- package/components/breadcrumbs/_macro.spec.js +129 -0
- package/components/button/_button.scss +75 -33
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +446 -0
- package/components/button/button.spec.js +290 -0
- package/components/call-to-action/_macro.njk +3 -1
- package/components/call-to-action/_macro.spec.js +52 -0
- package/components/card/_macro.njk +26 -19
- package/components/card/_macro.spec.js +261 -0
- package/components/char-check-limit/_macro.spec.js +73 -0
- package/components/char-check-limit/character-check.spec.js +196 -0
- package/components/char-check-limit/character-limit.js +1 -1
- package/components/checkboxes/_checkbox-macro.spec.js +419 -0
- package/components/checkboxes/_macro.njk +1 -3
- package/components/checkboxes/_macro.spec.js +306 -0
- package/components/checkboxes/checkbox-with-autoselect.js +2 -1
- package/components/checkboxes/checkboxes.spec.js +208 -0
- package/components/code-highlight/_macro.spec.js +56 -0
- package/components/code-highlight/code-highlight.spec.js +18 -0
- package/components/collapsible/_macro.spec.js +204 -0
- package/components/collapsible/collapsible.js +2 -1
- package/components/collapsible/collapsible.spec.js +236 -0
- package/components/content-pagination/_macro.spec.js +199 -0
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +171 -0
- package/components/cookies-banner/cookies-banner.spec.js +90 -0
- package/components/date-input/_macro.njk +6 -3
- package/components/date-input/_macro.spec.js +286 -0
- package/components/document-list/_macro.njk +3 -5
- package/components/document-list/_macro.spec.js +491 -0
- package/components/download-resources/download-resources.spec.js +540 -0
- package/components/duration/_macro.njk +7 -6
- package/components/duration/_macro.spec.js +251 -0
- package/components/error/_macro.spec.js +97 -0
- package/components/external-link/_macro.njk +5 -2
- package/components/external-link/_macro.spec.js +77 -0
- package/components/feedback/_macro.njk +5 -3
- package/components/feedback/_macro.spec.js +122 -0
- package/components/field/_macro.njk +2 -2
- package/components/field/_macro.spec.js +97 -0
- package/components/fieldset/_macro.njk +3 -3
- package/components/fieldset/_macro.spec.js +173 -0
- package/components/footer/_footer.scss +19 -4
- package/components/footer/_macro.njk +106 -137
- package/components/footer/_macro.spec.js +678 -0
- package/components/header/_header.scss +65 -46
- package/components/header/_macro.njk +173 -121
- package/components/header/_macro.spec.js +618 -0
- package/components/hero/_hero.scss +30 -143
- package/components/hero/_macro.njk +12 -23
- package/components/hero/_macro.spec.js +218 -0
- package/components/icons/_macro.njk +258 -30
- package/components/icons/_macro.spec.js +140 -0
- package/components/images/_macro.njk +1 -1
- package/components/images/_macro.spec.js +121 -0
- package/components/input/_input-type.scss +12 -5
- package/components/input/_input.scss +8 -0
- package/components/input/_macro.njk +4 -5
- package/components/input/_macro.spec.js +658 -0
- package/components/label/_macro.spec.js +189 -0
- package/components/language-selector/_macro.njk +1 -1
- package/components/language-selector/_macro.spec.js +137 -0
- package/components/lists/_list.scss +4 -0
- package/components/lists/_macro.njk +4 -7
- package/components/lists/_macro.spec.js +618 -0
- package/components/message/_macro.spec.js +137 -0
- package/components/message-list/_macro.njk +7 -7
- package/components/message-list/_macro.spec.js +159 -0
- package/components/metadata/_macro.spec.js +167 -0
- package/components/modal/_macro.njk +6 -6
- package/components/modal/_macro.spec.js +87 -0
- package/components/modal/modal.spec.js +59 -0
- package/components/mutually-exclusive/_macro.njk +2 -2
- package/components/mutually-exclusive/_macro.spec.js +184 -0
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
- package/components/navigation/_macro.njk +45 -38
- package/components/navigation/_macro.spec.js +329 -0
- package/components/navigation/_navigation.scss +20 -4
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +232 -0
- package/components/pagination/_macro.njk +1 -1
- package/components/pagination/_macro.spec.js +411 -0
- package/components/panel/_macro.njk +6 -6
- package/components/panel/_macro.spec.js +423 -0
- package/components/password/_macro.spec.js +137 -0
- package/components/password/password.spec.js +40 -0
- package/components/phase-banner/_macro.spec.js +73 -0
- package/components/promotional-banner/_macro.spec.js +97 -0
- package/components/question/_macro.njk +16 -22
- package/components/question/_macro.spec.js +309 -0
- package/components/quote/_macro.spec.js +81 -0
- package/components/radios/_macro.njk +3 -6
- package/components/radios/_macro.spec.js +575 -0
- package/components/radios/radios.spec.js +180 -0
- package/components/related-content/_macro.njk +14 -21
- package/components/related-content/_macro.spec.js +133 -0
- package/components/related-content/_section-macro.njk +10 -0
- package/components/related-content/_section-macro.spec.js +43 -0
- package/components/relationships/_macro.spec.js +108 -0
- package/components/relationships/relationships.spec.js +84 -0
- package/components/reply/_macro.njk +2 -2
- package/components/reply/_macro.spec.js +69 -0
- package/components/reply/reply.spec.js +78 -0
- package/components/search/_macro.njk +14 -12
- package/components/search/_macro.spec.js +44 -0
- package/components/search/_search.scss +7 -7
- package/components/section-navigation/_macro.njk +7 -2
- package/components/section-navigation/_macro.spec.js +206 -0
- package/components/select/_macro.njk +3 -3
- package/components/select/_macro.spec.js +203 -0
- package/components/select/select.spec.js +56 -0
- package/components/share-page/_macro.njk +6 -4
- package/components/share-page/_macro.spec.js +110 -0
- package/components/skip-to-content/_macro.spec.js +57 -0
- package/components/skip-to-content/skip-to-content.spec.js +44 -0
- package/components/status/_macro.spec.js +77 -0
- package/components/summary/_macro.njk +5 -5
- package/components/summary/_macro.spec.js +472 -0
- package/components/table/_macro.njk +2 -2
- package/components/table/_macro.spec.js +557 -0
- package/components/table/table.spec.js +155 -0
- package/components/table-of-contents/_macro.njk +35 -35
- package/components/table-of-contents/_macro.spec.js +178 -0
- package/components/table-of-contents/toc.js +29 -25
- package/components/table-of-contents/toc.spec.js +61 -0
- package/components/tabs/_macro.njk +1 -1
- package/components/tabs/_macro.spec.js +79 -0
- package/components/tabs/tabs.spec.js +162 -0
- package/components/text-indent/_macro.spec.js +52 -0
- package/components/textarea/_macro.njk +5 -3
- package/components/textarea/_macro.spec.js +300 -0
- package/components/textarea/textarea.spec.js +98 -0
- package/components/timeline/_macro.njk +3 -3
- package/components/timeline/_macro.spec.js +81 -0
- package/components/timeout-modal/_macro.spec.js +68 -0
- package/components/timeout-modal/timeout-modal.spec.js +226 -0
- package/components/timeout-panel/_macro.njk +0 -1
- package/components/timeout-panel/_macro.spec.js +54 -0
- package/components/timeout-panel/timeout-panel.dom.js +1 -2
- package/components/timeout-panel/timeout-panel.spec.js +161 -0
- package/components/upload/_macro.spec.js +75 -0
- package/components/video/_macro.spec.js +34 -0
- 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/js/cookies-settings.spec.js +154 -0
- package/layout/_template.njk +7 -4
- package/package.json +10 -23
- 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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{% set fieldset -%}
|
|
5
5
|
{% if params.dontWrap is defined and params.dontWrap -%}
|
|
6
6
|
<div class="ons-input-items">
|
|
7
|
-
{{- caller() -}}
|
|
7
|
+
{{- caller() if caller -}}
|
|
8
8
|
</div>
|
|
9
9
|
{%- elif (params.legend is defined and params.legend) or (params.legendIsQuestionTitle is defined and params.legendIsQuestionTitle) -%}
|
|
10
10
|
<fieldset
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
{{- params.legend | safe -}}
|
|
19
19
|
</h1>
|
|
20
20
|
{%- else -%}
|
|
21
|
-
{{- params.legend | safe -}}
|
|
21
|
+
<span class="ons-fieldset__legend-title">{{- params.legend | safe -}}</span>
|
|
22
22
|
{%- endif -%}
|
|
23
23
|
{%- if params.description is defined and params.description -%}
|
|
24
24
|
<div class="ons-fieldset__description{% if params.legendIsQuestionTitle %} ons-fieldset__description--title ons-u-mb-m{% endif %}">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
{%- endif -%}
|
|
28
28
|
</legend>
|
|
29
|
-
{{- caller() -}}
|
|
29
|
+
{{- caller() if caller -}}
|
|
30
30
|
</fieldset>
|
|
31
31
|
{%- endif %}
|
|
32
32
|
{%- endset %}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/** @jest-environment jsdom */
|
|
2
|
+
|
|
3
|
+
import * as cheerio from 'cheerio';
|
|
4
|
+
|
|
5
|
+
import axe from '../../tests/helpers/axe';
|
|
6
|
+
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
7
|
+
|
|
8
|
+
const EXAMPLE_FIELDSET_BASIC = {
|
|
9
|
+
id: 'example-fieldset',
|
|
10
|
+
legend: 'Fieldset legend',
|
|
11
|
+
description: 'A fieldset description',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
describe('macro: fieldset', () => {
|
|
15
|
+
it('passes jest-axe checks', async () => {
|
|
16
|
+
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
|
|
17
|
+
|
|
18
|
+
const results = await axe($.html());
|
|
19
|
+
expect(results).toHaveNoViolations();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('has the provided `id` attribute', () => {
|
|
23
|
+
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
|
|
24
|
+
|
|
25
|
+
expect($('.ons-fieldset').attr('id')).toBe('example-fieldset');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('has the `legend` text', () => {
|
|
29
|
+
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
|
|
30
|
+
|
|
31
|
+
const title = $('.ons-fieldset__legend-title').text();
|
|
32
|
+
expect(title).toBe('Fieldset legend');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('has the `description` text', () => {
|
|
36
|
+
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC));
|
|
37
|
+
|
|
38
|
+
const title = $('.ons-fieldset__description')
|
|
39
|
+
.html()
|
|
40
|
+
.trim();
|
|
41
|
+
expect(title).toBe('A fieldset description');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('has additionally provided style classes', () => {
|
|
45
|
+
const $ = cheerio.load(
|
|
46
|
+
renderComponent('fieldset', {
|
|
47
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
48
|
+
classes: 'extra-class another-extra-class',
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
expect($('.ons-fieldset').hasClass('extra-class')).toBe(true);
|
|
53
|
+
expect($('.ons-fieldset').hasClass('another-extra-class')).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('has additionally provided `legendClasses`', () => {
|
|
57
|
+
const $ = cheerio.load(
|
|
58
|
+
renderComponent('fieldset', {
|
|
59
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
60
|
+
legendClasses: 'extra-class another-extra-class',
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
expect($('.ons-fieldset__legend').hasClass('extra-class')).toBe(true);
|
|
65
|
+
expect($('.ons-fieldset__legend').hasClass('another-extra-class')).toBe(true);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('has additionally provided `attributes`', () => {
|
|
69
|
+
const $ = cheerio.load(
|
|
70
|
+
renderComponent('fieldset', {
|
|
71
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
72
|
+
attributes: {
|
|
73
|
+
a: 123,
|
|
74
|
+
b: 456,
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
expect($('.ons-fieldset').attr('a')).toBe('123');
|
|
80
|
+
expect($('.ons-fieldset').attr('b')).toBe('456');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('has the correct element with `dontWrap`', () => {
|
|
84
|
+
const $ = cheerio.load(
|
|
85
|
+
renderComponent('fieldset', {
|
|
86
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
87
|
+
dontWrap: true,
|
|
88
|
+
}),
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect($('.ons-input-items').length).toBe(1);
|
|
92
|
+
expect($('.ons-fieldset').length).toBe(0);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('calls with content', () => {
|
|
96
|
+
const $ = cheerio.load(renderComponent('fieldset', EXAMPLE_FIELDSET_BASIC, 'Example content...'));
|
|
97
|
+
|
|
98
|
+
const content = $('.ons-fieldset')
|
|
99
|
+
.html()
|
|
100
|
+
.trim();
|
|
101
|
+
expect(content).toEqual(expect.stringContaining('Example content...'));
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('calls the error component when `error` is provided', () => {
|
|
105
|
+
const faker = templateFaker();
|
|
106
|
+
const errorSpy = faker.spy('error');
|
|
107
|
+
|
|
108
|
+
faker.renderComponent('fieldset', {
|
|
109
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
110
|
+
error: { text: 'There is an error' },
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
expect(errorSpy.occurrences[0]).toEqual({
|
|
114
|
+
text: 'There is an error',
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe('with `legendIsQuestionTitle`', () => {
|
|
119
|
+
it('passes jest-axe checks', async () => {
|
|
120
|
+
const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
|
|
121
|
+
|
|
122
|
+
const results = await axe($.html());
|
|
123
|
+
expect(results).toHaveNoViolations();
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('has the correct class', () => {
|
|
127
|
+
const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
|
|
128
|
+
expect($('.ons-fieldset__legend').hasClass('ons-u-mb-no')).toBe(true);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('renders the legend in a H1', () => {
|
|
132
|
+
const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
|
|
133
|
+
const titleTag = $('.ons-fieldset__legend-title')[0].tagName;
|
|
134
|
+
|
|
135
|
+
expect(titleTag).toBe('h1');
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('has additionally provided `legendTitleClasses`', () => {
|
|
139
|
+
const $ = cheerio.load(
|
|
140
|
+
renderComponent('fieldset', {
|
|
141
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
142
|
+
legendTitleClasses: 'extra-class another-extra-class',
|
|
143
|
+
legendIsQuestionTitle: true,
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect($('.ons-fieldset__legend-title').hasClass('extra-class')).toBe(true);
|
|
148
|
+
expect($('.ons-fieldset__legend-title').hasClass('another-extra-class')).toBe(true);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('has the `legend` text', () => {
|
|
152
|
+
const $ = cheerio.load(
|
|
153
|
+
renderComponent('fieldset', {
|
|
154
|
+
...EXAMPLE_FIELDSET_BASIC,
|
|
155
|
+
legendTitleClasses: 'extra-class another-extra-class',
|
|
156
|
+
legendIsQuestionTitle: true,
|
|
157
|
+
}),
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
const title = $('.ons-fieldset__legend-title')
|
|
161
|
+
.html()
|
|
162
|
+
.trim();
|
|
163
|
+
expect(title).toBe('Fieldset legend');
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it('has the correct `description` classes', () => {
|
|
167
|
+
const $ = cheerio.load(renderComponent('fieldset', { ...EXAMPLE_FIELDSET_BASIC, legendIsQuestionTitle: true }));
|
|
168
|
+
|
|
169
|
+
expect($('.ons-fieldset__description').hasClass('ons-fieldset__description--title')).toBe(true);
|
|
170
|
+
expect($('.ons-fieldset__description').hasClass('ons-u-mb-m')).toBe(true);
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
});
|
|
@@ -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,49 +9,38 @@
|
|
|
9
9
|
{% set lang = 'en' %}
|
|
10
10
|
{% endif %}
|
|
11
11
|
|
|
12
|
-
{%
|
|
13
|
-
{% if params.
|
|
14
|
-
{
|
|
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
|
+
}}
|
|
15
21
|
{% else %}
|
|
16
|
-
{
|
|
22
|
+
{{
|
|
23
|
+
onsIcon({
|
|
24
|
+
"iconType": 'ons-logo-en',
|
|
25
|
+
"altText": 'Office for National Statistics',
|
|
26
|
+
"altTextId": 'ons-logo-en-footer-alt'
|
|
27
|
+
})
|
|
28
|
+
}}
|
|
17
29
|
{% endif %}
|
|
18
|
-
{%
|
|
30
|
+
{% endset %}
|
|
19
31
|
|
|
20
32
|
{% set poweredByLogo %}
|
|
21
|
-
|
|
22
33
|
{% if params.poweredBy is defined and params.poweredBy and params.poweredBy.logo is defined and params.poweredBy.logo %}
|
|
23
34
|
{{
|
|
24
35
|
onsIcon({
|
|
25
36
|
"iconType": params.poweredBy.logo,
|
|
26
|
-
"altText":
|
|
37
|
+
"altText": params.poweredBy.alt,
|
|
38
|
+
"altTextId": 'poweredby-alt'
|
|
27
39
|
})
|
|
28
40
|
}}
|
|
29
41
|
{% else %}
|
|
30
|
-
{
|
|
31
|
-
{{
|
|
32
|
-
onsIcon({
|
|
33
|
-
"iconType": 'ons-logo-cy',
|
|
34
|
-
"altText": poweredByAlt | default('Swyddfa Ystadegau Gwladol')
|
|
35
|
-
})
|
|
36
|
-
}}
|
|
37
|
-
{% else %}
|
|
38
|
-
{{
|
|
39
|
-
onsIcon({
|
|
40
|
-
"iconType": 'ons-logo-en',
|
|
41
|
-
"altText": poweredByAlt | default('Office for National Statistics')
|
|
42
|
-
})
|
|
43
|
-
}}
|
|
44
|
-
{% endif %}
|
|
42
|
+
{{ onsLogo | safe }}
|
|
45
43
|
{% endif %}
|
|
46
|
-
|
|
47
|
-
{% endset %}
|
|
48
|
-
|
|
49
|
-
{% set crestLogo %}
|
|
50
|
-
{{
|
|
51
|
-
onsIcon({
|
|
52
|
-
"iconType": 'crest'
|
|
53
|
-
})
|
|
54
|
-
}}
|
|
55
44
|
{% endset %}
|
|
56
45
|
|
|
57
46
|
<footer class="ons-footer">
|
|
@@ -97,45 +86,15 @@
|
|
|
97
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 %}>
|
|
98
87
|
<div class="ons-container{{ ' ons-container--wide' if params.wide }}">
|
|
99
88
|
<div class="ons-grid">
|
|
100
|
-
{% if params.poweredBy is defined and params.poweredBy and params.OGLLink is defined and params.OGLLink %}
|
|
101
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
102
|
-
{{ poweredByLogo | safe }}
|
|
103
|
-
</div>
|
|
104
|
-
{% endif %}
|
|
105
|
-
|
|
106
|
-
{% if params.language is defined and params.language %}
|
|
107
|
-
{% set currentLanguage = params.language.languages | selectattr("current") | first %}
|
|
108
|
-
{% set languageNumber = params.language.languages | length %}
|
|
109
|
-
<div class="ons-grid__col {% if languageNumber and languageNumber != 2 %} ons-u-d-no@m{% elif languageNumber %} ons-u-d-no{% endif %}">
|
|
110
|
-
{% set languageItems = params.language.languages | rejectattr("current") | list %}
|
|
111
|
-
{% if currentLanguage.allLanguages is defined and currentLanguage.allLanguages and params.language.allLanguagesUrl is defined and params.language.allLanguagesUrl %}
|
|
112
|
-
{% set languageItems = (languageItems.push({
|
|
113
|
-
"url": params.language.allLanguagesUrl,
|
|
114
|
-
"text": currentLanguage.allLanguages,
|
|
115
|
-
"lang": currentLanguage.ISOCode
|
|
116
|
-
}), languageItems) %}
|
|
117
|
-
{% endif %}
|
|
118
|
-
{{
|
|
119
|
-
onsList({
|
|
120
|
-
"classes": 'ons-u-mb-no',
|
|
121
|
-
"variants": ['bare', 'inline@m'],
|
|
122
|
-
"itemsList": languageItems
|
|
123
|
-
})
|
|
124
|
-
}}
|
|
125
|
-
</div>
|
|
126
|
-
<div class="ons-grid__col {% if languageNumber and languageNumber != 2 %} ons-u-d-no@m{% elif languageNumber %} ons-u-d-no{% endif %} ons-u-mb-m">
|
|
127
|
-
<hr class="ons-footer__hr">
|
|
128
|
-
</div>
|
|
129
|
-
{% endif %}
|
|
130
|
-
|
|
131
89
|
{% if params.newTabWarning is defined and params.newTabWarning %}
|
|
132
90
|
<div class="ons-grid__col">
|
|
133
|
-
<p class="ons-u-fs-s ons-u-mb-m">{{ params.newTabWarning | safe }}</p>
|
|
91
|
+
<p class="ons-u-fs-s ons-u-mb-m ons-footer__new-tab-warning">{{ params.newTabWarning | safe }}</p>
|
|
134
92
|
</div>
|
|
135
93
|
{% endif %}
|
|
136
94
|
|
|
137
95
|
{% if params.cols is defined and params.cols %}
|
|
138
96
|
{% for col in params.cols %}
|
|
97
|
+
<!-- Full footer columns -->
|
|
139
98
|
<div class="ons-grid__col ons-col-4@m{{ ' ons-u-mt-m@xxs@m' if loop.index > 1 }}">
|
|
140
99
|
{% if col.title %}
|
|
141
100
|
<h2 class="ons-footer__heading ons-u-fs-r--b">{{ col.title }}</h2>
|
|
@@ -149,17 +108,9 @@
|
|
|
149
108
|
}}
|
|
150
109
|
</div>
|
|
151
110
|
{% endfor %}
|
|
152
|
-
{%
|
|
153
|
-
|
|
154
|
-
{% if params.cols is defined and params.cols and params.rows is defined and params.rows %}
|
|
155
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
156
|
-
<hr class="ons-footer__hr">
|
|
157
|
-
</div>
|
|
158
|
-
{% endif %}
|
|
159
|
-
|
|
160
|
-
{% if params.rows is defined and params.rows %}
|
|
111
|
+
{% elif params.rows is defined and params.rows %}
|
|
161
112
|
{% for row in params.rows %}
|
|
162
|
-
<!--
|
|
113
|
+
<!-- Transactional footer row -->
|
|
163
114
|
<div class="ons-grid__col">
|
|
164
115
|
{{
|
|
165
116
|
onsList({
|
|
@@ -169,101 +120,119 @@
|
|
|
169
120
|
})
|
|
170
121
|
}}
|
|
171
122
|
</div>
|
|
172
|
-
{% if loop.length > 1 %}
|
|
173
|
-
{% if not loop.last %}
|
|
174
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
175
|
-
<hr class="ons-footer__hr">
|
|
176
|
-
</div>
|
|
177
|
-
{% endif %}
|
|
178
|
-
{% endif %}
|
|
179
123
|
{% endfor %}
|
|
180
124
|
{% endif %}
|
|
181
125
|
|
|
182
|
-
{% if params.
|
|
183
|
-
<!-- OGL -->
|
|
184
|
-
<div class="ons-grid__col ons-u-mb-m">
|
|
185
|
-
<hr class="ons-footer__hr">
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div class="ons-grid__col">
|
|
189
|
-
<div class="ons-footer__license">
|
|
190
|
-
{{
|
|
191
|
-
onsIcon({
|
|
192
|
-
"iconType": 'ogl'
|
|
193
|
-
})
|
|
194
|
-
}}
|
|
195
|
-
{% if params.OGLLink.HTML is defined and params.OGLLink.HTML %}
|
|
196
|
-
{{ params.OGLLink.HTML | safe }}
|
|
197
|
-
{% else %}
|
|
198
|
-
{% from "components/external-link/_macro.njk" import onsExternalLink %}
|
|
199
|
-
{{ params.OGLLink.pre }} {{
|
|
200
|
-
onsExternalLink({
|
|
201
|
-
"url": params.OGLLink.url,
|
|
202
|
-
"linkText": params.OGLLink.link
|
|
203
|
-
})
|
|
204
|
-
}}{{ params.OGLLink.post }}
|
|
205
|
-
{% endif %}
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
{% endif %}
|
|
209
|
-
|
|
210
|
-
{% 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) %}
|
|
126
|
+
{% if (params.cols is defined and params.cols) or (params.rows is defined and params.rows) %}
|
|
211
127
|
<div class="ons-grid__col ons-u-mb-m">
|
|
212
128
|
<hr class="ons-footer__hr">
|
|
213
129
|
</div>
|
|
214
130
|
{% endif %}
|
|
215
131
|
|
|
216
|
-
{% if params.OGLLink is not defined and params.legal is not defined %}
|
|
217
|
-
<div class="ons-grid__col">
|
|
218
|
-
{{ poweredByLogo | safe }}
|
|
219
|
-
</div>
|
|
220
|
-
{% endif %}
|
|
221
132
|
</div>
|
|
222
133
|
|
|
223
|
-
{% 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 %}
|
|
224
134
|
<div class="ons-grid ons-grid--flex ons-grid--vertical-top ons-grid--between">
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
135
|
+
<div class="ons-grid__col">
|
|
136
|
+
{% if params.legal is defined and params.legal %}
|
|
137
|
+
<!-- Legal -->
|
|
138
|
+
{% for legal in params.legal %}
|
|
229
139
|
{{
|
|
230
140
|
onsList({
|
|
231
|
-
"classes": 'ons-u-mb-
|
|
141
|
+
"classes": 'ons-u-mb-s ons-footer--rows',
|
|
232
142
|
"variants": ['bare', 'inline'],
|
|
233
143
|
"itemsList": legal.itemsList
|
|
234
144
|
})
|
|
235
145
|
}}
|
|
236
|
-
|
|
237
|
-
|
|
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 %}
|
|
238
176
|
{% endif %}
|
|
239
177
|
</div>
|
|
240
|
-
{%
|
|
241
|
-
|
|
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>
|
|
242
186
|
|
|
243
187
|
{% if params.crest is defined and params.crest %}
|
|
244
188
|
<!-- Crest -->
|
|
245
|
-
<div class="ons-grid__col">
|
|
246
|
-
{{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<div class="ons-poweredbylogo">{{ poweredByLogo | safe }}</div>
|
|
189
|
+
<div class="ons-grid__col ons-footer__crest ons-u-mb-m@xxs@l">
|
|
190
|
+
{{
|
|
191
|
+
onsIcon({
|
|
192
|
+
"iconType": 'crest'
|
|
193
|
+
})
|
|
194
|
+
}}
|
|
252
195
|
</div>
|
|
253
196
|
{% endif %}
|
|
197
|
+
</div>
|
|
254
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>
|
|
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>
|
|
255
225
|
</div>
|
|
256
226
|
{% endif %}
|
|
257
227
|
|
|
258
228
|
{% if params.copyrightDeclaration is defined and params.copyrightDeclaration %}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
</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>
|
|
264
233
|
</div>
|
|
234
|
+
</div>
|
|
265
235
|
{% endif %}
|
|
266
|
-
|
|
267
236
|
</div>
|
|
268
237
|
</div>
|
|
269
238
|
</footer>
|