@ons/design-system 70.0.8 → 70.0.9
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/components/access-code/_macro.njk +31 -25
- package/components/access-code/example-access-code-error.njk +49 -37
- package/components/access-code/example-access-code.njk +40 -30
- package/components/accordion/_macro.njk +7 -6
- package/components/accordion/example-accordion-open.njk +0 -1
- package/components/address-input/_macro.njk +23 -11
- package/components/address-input/autosuggest.address.js +0 -5
- package/components/address-input/example-address-input-editable.njk +52 -50
- package/components/address-input/example-address-input-manual.njk +23 -21
- package/components/address-input/example-address-input.njk +40 -38
- package/components/address-output/_macro.njk +6 -6
- package/components/autosuggest/_macro.njk +57 -37
- package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
- package/components/autosuggest/example-autosuggest-country.njk +24 -24
- package/components/back-to-top/example-back-to-top.njk +183 -6
- package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
- package/components/breadcrumbs/_macro.njk +12 -4
- package/components/browser-banner/_macro.njk +6 -3
- package/components/button/_button.scss +36 -1
- package/components/button/_macro.njk +63 -62
- package/components/button/example-button-ghost.njk +1 -0
- package/components/call-to-action/_macro.njk +7 -5
- package/components/call-to-action/example-call-to-action-default.njk +3 -2
- package/components/card/_macro.njk +26 -10
- package/components/card/example-card-set-with-images.njk +31 -29
- package/components/card/example-card-set-with-lists.njk +58 -56
- package/components/card/example-card-set.njk +28 -26
- package/components/card/example-card.njk +9 -7
- package/components/char-check-limit/_macro.njk +1 -3
- package/components/checkboxes/_checkbox-macro.njk +19 -15
- package/components/checkboxes/_macro.njk +81 -72
- package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
- package/components/checkboxes/example-checkboxes-error.njk +0 -1
- package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
- package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
- package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
- package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
- package/components/checkboxes/example-checkboxes.njk +7 -5
- package/components/content-pagination/_macro.njk +34 -32
- package/components/content-pagination/example-content-pagination.njk +17 -17
- package/components/cookies-banner/_macro.njk +19 -6
- package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
- package/components/cookies-banner/example-cookies-banner.njk +3 -4
- package/components/date-input/_macro.njk +71 -63
- package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
- package/components/date-input/example-date-input-error.njk +0 -1
- package/components/description-list/_macro.njk +20 -11
- package/components/details/_macro.njk +18 -11
- package/components/details/example-details-with-warning.njk +15 -10
- package/components/document-list/_macro.njk +102 -93
- package/components/document-list/example-document-list-article-featured.njk +27 -25
- package/components/document-list/example-document-list-articles.njk +55 -53
- package/components/document-list/example-document-list-downloads.njk +49 -47
- package/components/document-list/example-document-list-search-result-featured.njk +19 -17
- package/components/document-list/example-document-list-search-results.njk +60 -58
- package/components/duration/_macro.njk +61 -55
- package/components/duration/example-duration-error-for-single-field.njk +28 -26
- package/components/duration/example-duration-single-field.njk +23 -19
- package/components/duration/example-duration.njk +33 -29
- package/components/error/_macro.njk +8 -6
- package/components/external-link/_macro.njk +7 -5
- package/components/external-link/example-external-link.njk +9 -6
- package/components/feedback/_macro.njk +7 -5
- package/components/field/_macro.njk +2 -2
- package/components/fieldset/_macro.njk +23 -16
- package/components/footer/_macro.njk +28 -21
- package/components/footer/_macro.spec.js +1 -1
- package/components/footer/example-footer-cymraeg.njk +2 -1
- package/components/footer/example-footer-default.njk +3 -4
- package/components/footer/example-footer-transactional.njk +2 -1
- package/components/footer/example-footer-warning.njk +2 -1
- package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
- package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
- package/components/footer/example-footer-with-copyright.njk +2 -1
- package/components/footer/example-footer.njk +2 -1
- package/components/header/_header.scss +24 -19
- package/components/header/_macro.njk +183 -141
- package/components/header/example-header-default.njk +2 -1
- package/components/header/example-header-external-for-survey-with-description.njk +2 -1
- package/components/header/example-header-external-for-surveys.njk +2 -1
- package/components/header/example-header-external-welsh.njk +7 -7
- package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
- package/components/header/example-header-external-with-navigation.njk +2 -1
- package/components/header/example-header-external-with-service-links.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
- package/components/header/example-header-external-with-sub-navigation.njk +3 -2
- package/components/header/example-header-internal.njk +2 -1
- package/components/header/example-header-multiple-logos.njk +2 -1
- package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
- package/components/helpers/grid.njk +17 -16
- package/components/hero/_macro.njk +6 -11
- package/components/hero/example-hero-dark.njk +2 -1
- package/components/hero/example-hero-default.njk +2 -1
- package/components/icon/_macro.njk +601 -168
- package/components/image/_macro.njk +7 -5
- package/components/input/_macro.njk +114 -95
- package/components/input/example-input-search-with-character-check.njk +1 -1
- package/components/input/example-input-search-with-placeholder.njk +1 -1
- package/components/input/example-input-search.njk +1 -1
- package/components/label/_macro.njk +32 -26
- package/components/language-selector/_macro.njk +11 -2
- package/components/list/_list.scss +13 -0
- package/components/list/_macro.njk +93 -73
- package/components/message/_macro.njk +20 -7
- package/components/message-list/_macro.njk +26 -20
- package/components/modal/_macro.njk +11 -12
- package/components/multiple-input-fields/_macro.njk +30 -28
- package/components/mutually-exclusive/_macro.njk +20 -13
- package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
- package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
- package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
- package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
- package/components/navigation/_macro.njk +133 -67
- package/components/navigation/_navigation.scss +0 -9
- package/components/pagination/_macro.njk +42 -20
- package/components/panel/_macro.njk +27 -16
- package/components/panel/example-panel-bare.njk +6 -4
- package/components/panel/example-panel-with-announcement.njk +7 -4
- package/components/panel/example-panel-with-error-summary.njk +6 -4
- package/components/panel/example-panel-with-warning.njk +5 -3
- package/components/password/_macro.njk +7 -5
- package/components/phase-banner/_macro.njk +3 -3
- package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
- package/components/phase-banner/example-phase-banner-beta.njk +4 -3
- package/components/question/_macro.njk +62 -47
- package/components/question/example-question-ccs.njk +40 -35
- package/components/question/example-question-fieldset.njk +84 -80
- package/components/question/example-question-interviewer-note.njk +27 -24
- package/components/question/example-question-no-fieldset.njk +39 -33
- package/components/quote/_macro.njk +3 -1
- package/components/radios/_macro.njk +54 -36
- package/components/radios/_macro.spec.js +21 -0
- package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
- package/components/radios/example-radios-with-clear-button.njk +6 -4
- package/components/radios/example-radios-with-descriptions.njk +7 -5
- package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
- package/components/radios/example-radios-with-revealed-select.njk +6 -4
- package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
- package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
- package/components/radios/example-radios-with-separator.njk +6 -4
- package/components/radios/example-radios-with-visible-text-input.njk +7 -5
- package/components/radios/example-radios-without-border.njk +0 -1
- package/components/radios/example-radios.njk +7 -5
- package/components/related-content/_macro.njk +10 -11
- package/components/related-content/_section-macro.njk +7 -7
- package/components/related-content/example-related-content-general.njk +5 -3
- package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
- package/components/related-content/example-related-content-social-media.njk +40 -38
- package/components/relationships/_macro.njk +10 -8
- package/components/relationships/example-relationships-error.njk +176 -168
- package/components/relationships/example-relationships-you.njk +169 -163
- package/components/relationships/example-relationships.njk +167 -161
- package/components/section-navigation/_macro.njk +34 -12
- package/components/select/_macro.njk +21 -18
- package/components/share-page/_macro.njk +10 -5
- package/components/skip-to-content/_macro.njk +1 -1
- package/components/skip-to-content/example-skip-to-content.njk +1 -0
- package/components/status/_macro.njk +1 -1
- package/components/summary/_macro.njk +53 -23
- package/components/summary/example-summary-household-no-rows.njk +18 -16
- package/components/summary/example-summary-household.njk +75 -73
- package/components/summary/example-summary-hub-minimal.njk +74 -72
- package/components/summary/example-summary-hub.njk +169 -167
- package/components/table/_macro.njk +72 -45
- package/components/table-of-contents/_macro.njk +34 -32
- package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
- package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
- package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
- package/components/tabs/_macro.njk +12 -6
- package/components/tabs/example-tabs-details.njk +5 -6
- package/components/text-indent/_macro.njk +1 -3
- package/components/textarea/_macro.njk +49 -46
- package/components/textarea/_macro.spec.js +0 -11
- package/components/timeline/_macro.njk +4 -6
- package/components/timeout-modal/_macro.njk +21 -19
- package/components/timeout-modal/example-timeout-modal.njk +16 -14
- package/components/timeout-panel/_macro.njk +19 -17
- package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
- package/components/upload/_macro.njk +20 -16
- package/components/video/_macro.njk +16 -2
- package/components/video/example-video.njk +2 -2
- package/css/main.css +1 -1
- package/layout/_dsTemplate.njk +22 -20
- package/layout/_template.njk +63 -49
- package/package.json +4 -3
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/overrides/hcm.scss +1 -1
- package/scss/vars/_colors.scss +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{% from "components/input/_macro.njk" import onsInput %}
|
|
3
3
|
|
|
4
4
|
{% macro onsDateInput(params) %}
|
|
5
|
-
{% set exclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive
|
|
5
|
+
{% set exclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive %}
|
|
6
6
|
{%- set numberOfFields = 0 -%}
|
|
7
7
|
|
|
8
8
|
{%- if params.day -%}
|
|
@@ -19,75 +19,83 @@
|
|
|
19
19
|
|
|
20
20
|
{% set fields %}
|
|
21
21
|
{% if params.day %}
|
|
22
|
-
{{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
{{
|
|
23
|
+
onsInput({
|
|
24
|
+
"id": params.id + "-day",
|
|
25
|
+
"type": "number",
|
|
26
|
+
"name": params.day.name,
|
|
27
|
+
"classes": (" ons-input--error" if (params.error and params.day.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
|
|
28
|
+
"width": "2",
|
|
29
|
+
"maxLength": 2,
|
|
30
|
+
"attributes": params.day.attributes,
|
|
31
|
+
"label": {
|
|
32
|
+
"text": params.day.label.text if numberOfFields > 1 else params.legendOrLabel,
|
|
33
|
+
"description": params.day.label.description if numberOfFields > 1 else params.description,
|
|
34
|
+
"id": params.id + "-day-label"
|
|
35
|
+
},
|
|
36
|
+
"value": params.day.value,
|
|
37
|
+
"error": params.error if numberOfFields < 2
|
|
38
|
+
})
|
|
39
|
+
}}
|
|
38
40
|
{% endif %}
|
|
39
41
|
|
|
40
42
|
{% if params.month %}
|
|
41
|
-
{{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
{{
|
|
44
|
+
onsInput({
|
|
45
|
+
"id": params.id + "-month",
|
|
46
|
+
"type": "number",
|
|
47
|
+
"name": params.month.name,
|
|
48
|
+
"classes": (" ons-input--error" if (params.error and params.month.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
|
|
49
|
+
"width": "2",
|
|
50
|
+
"maxLength": 2,
|
|
51
|
+
"attributes": params.month.attributes,
|
|
52
|
+
"label": {
|
|
53
|
+
"text": params.month.label.text if numberOfFields > 1 else params.legendOrLabel,
|
|
54
|
+
"description": params.month.label.description if numberOfFields > 1 else params.description,
|
|
55
|
+
"id": params.id + "-month-label"
|
|
56
|
+
},
|
|
57
|
+
"value": params.month.value,
|
|
58
|
+
"error": params.error if numberOfFields < 2
|
|
59
|
+
})
|
|
60
|
+
}}
|
|
57
61
|
{% endif %}
|
|
58
62
|
|
|
59
63
|
{% if params.year %}
|
|
60
|
-
{{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
{{
|
|
65
|
+
onsInput({
|
|
66
|
+
"id": params.id + "-year",
|
|
67
|
+
"type": "number",
|
|
68
|
+
"name": params.year.name,
|
|
69
|
+
"classes": (" ons-input--error" if (params.error and params.year.error) or (params.error and not params.day.error and not params.month.error and not params.year.error) else "") + exclusiveClass | default(""),
|
|
70
|
+
"width": "4",
|
|
71
|
+
"maxLength": 4,
|
|
72
|
+
"attributes": params.year.attributes,
|
|
73
|
+
"label": {
|
|
74
|
+
"text": params.year.label.text if numberOfFields > 1 else params.legendOrLabel,
|
|
75
|
+
"description": params.year.label.description if numberOfFields > 1 else params.description,
|
|
76
|
+
"id": params.id + "-year-label"
|
|
77
|
+
},
|
|
78
|
+
"value": params.year.value,
|
|
79
|
+
"error": params.error if numberOfFields < 2
|
|
80
|
+
})
|
|
81
|
+
}}
|
|
76
82
|
{% endif %}
|
|
77
83
|
{% endset %}
|
|
78
84
|
|
|
79
|
-
{{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
{{
|
|
86
|
+
onsMultipleInputFields({
|
|
87
|
+
"id": params.id,
|
|
88
|
+
"legendOrLabel": params.legendOrLabel,
|
|
89
|
+
"description": params.description,
|
|
90
|
+
"mutuallyExclusive": params.mutuallyExclusive,
|
|
91
|
+
"numberOfFields": numberOfFields,
|
|
92
|
+
"fields": fields,
|
|
93
|
+
"error": params.error,
|
|
94
|
+
"legend": params.legendOrLabel,
|
|
95
|
+
"dontWrap": params.dontWrap,
|
|
96
|
+
"classes": params.classes,
|
|
97
|
+
"legendClasses": params.legendClasses,
|
|
98
|
+
"legendIsQuestionTitle": params.legendIsQuestionTitle
|
|
99
|
+
})
|
|
100
|
+
}}
|
|
93
101
|
{% endmacro %}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{% macro onsDescriptionList(params) %}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<dl
|
|
3
|
+
class="ons-description-list ons-description-list__items ons-grid ons-grid--gutterless ons-u-cf{{ " " + params.classes if params.classes else "" }}"
|
|
4
|
+
{% if params.id %}id="{{ params.id }}"{% endif %}{% if params.descriptionListLabel %}
|
|
5
|
+
title="{{ params.descriptionListLabel }}" aria-label="{{ params.descriptionListLabel }}"
|
|
6
|
+
{% endif %}
|
|
7
|
+
>
|
|
8
|
+
{% for item in params.itemsList %}
|
|
9
|
+
{% if item.term | length %}
|
|
10
|
+
<dt class="ons-description-list__term ons-grid__col ons-col-{{ params.termCol }}@m">{{ item.term }}</dt>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{% for descriptionItem in item.descriptions %}
|
|
13
|
+
{% if descriptionItem.description | length %}
|
|
14
|
+
<dd
|
|
15
|
+
{% if descriptionItem.id %}id="{{ descriptionItem.id }}"{% endif %}class="ons-description-list__value ons-grid__col ons-col-{{ params.descriptionCol }}@m"
|
|
16
|
+
>
|
|
17
|
+
{{- descriptionItem.description -}}
|
|
18
|
+
</dd>
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% endfor %}
|
|
11
21
|
{% endfor %}
|
|
12
|
-
|
|
13
|
-
</dl>
|
|
22
|
+
</dl>
|
|
14
23
|
{% endmacro %}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
{% macro onsDetails(params) %}
|
|
2
2
|
<div
|
|
3
3
|
id="{{ params.id }}"
|
|
4
|
-
class="ons-details ons-js-details{
|
|
5
|
-
{% if params.group %} data-group="{{ params.group }}"{% endif %}
|
|
6
|
-
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %}
|
|
7
|
-
{% if params.saveState %} data-save-state="true"{% endif %}
|
|
8
|
-
{% if params.open %} data-open="true"{% endif %}
|
|
4
|
+
class="ons-details ons-js-details{{ ' ons-details--accordion' if params.isAccordion }}{{ ' ' + params.classes if params.classes else '' }}"
|
|
5
|
+
{% if params.group %}{{ ' ' }}data-group="{{ params.group }}"{% endif %}
|
|
6
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
7
|
+
{% if params.saveState %}{{ ' ' }}data-save-state="true"{% endif %}
|
|
8
|
+
{% if params.open %}{{ ' ' }}data-open="true"{% endif %}
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
11
|
-
class="ons-details__heading ons-js-details-heading"
|
|
12
|
-
|
|
11
|
+
class="ons-details__heading ons-js-details-heading"
|
|
12
|
+
role="button"
|
|
13
|
+
{% if params.headingAttributes %}{% for attribute, value in (params.headingAttributes.items() if params.headingAttributes is mapping and params.headingAttributes.items else params.headingAttributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
13
14
|
>
|
|
14
15
|
{% set titleTag = params.titleTag | default("h2") %}
|
|
15
|
-
|
|
16
|
+
{% set openingTag = "<" + titleTag %}
|
|
17
|
+
{% set closingTag = "</" + titleTag + ">" %}
|
|
18
|
+
{{ openingTag | safe }}
|
|
19
|
+
class="ons-details__title">{{ params.title }}{{ closingTag | safe }}
|
|
16
20
|
<span class="ons-details__icon">
|
|
17
21
|
{% from "components/icon/_macro.njk" import onsIcon %}
|
|
18
22
|
{{-
|
|
19
23
|
onsIcon({
|
|
20
24
|
"iconType": "chevron"
|
|
21
25
|
})
|
|
22
|
-
-}}</span
|
|
26
|
+
-}}</span
|
|
27
|
+
>
|
|
23
28
|
</div>
|
|
24
|
-
<div
|
|
25
|
-
{
|
|
29
|
+
<div
|
|
30
|
+
id="{{ params.id }}-content"
|
|
31
|
+
class="ons-details__content ons-js-details-content"
|
|
32
|
+
{% if params.contentAttributes %}{% for attribute, value in (params.contentAttributes.items() if params.contentAttributes is mapping and params.contentAttributes.items else params.contentAttributes) %}{{ ' ' }}{{ attribute }}{% if value %}="{{ value }}"{% endif %}{% endfor %}{% endif %}
|
|
26
33
|
>
|
|
27
34
|
{{ params.content | safe }}{{ caller() if caller }}
|
|
28
35
|
</div>
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{% from "components/details/_macro.njk" import onsDetails %}
|
|
2
2
|
{% from "components/panel/_macro.njk" import onsPanel %}
|
|
3
3
|
|
|
4
|
-
{%
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
4
|
+
{%
|
|
5
|
+
call onsDetails({
|
|
6
|
+
"id": "details-example-with-warning",
|
|
7
|
+
"title": "Need to answer separately from your household?"
|
|
8
|
+
})
|
|
9
|
+
%}
|
|
10
|
+
<p>
|
|
11
|
+
If you need to answer separately from the people you live with, you can <a href="#0">request an individual access code</a> to start
|
|
12
|
+
a separate survey.
|
|
13
|
+
</p>
|
|
14
|
+
{%
|
|
15
|
+
call onsPanel({
|
|
16
|
+
"variant": "warn"
|
|
17
|
+
})
|
|
18
|
+
%}
|
|
13
19
|
Someone in your household must still complete a survey using a household access code
|
|
14
20
|
{% endcall %}
|
|
15
|
-
|
|
16
21
|
{% endcall %}
|
|
@@ -1,110 +1,119 @@
|
|
|
1
1
|
{% macro onsDocumentList(params) %}
|
|
2
|
-
<ul
|
|
2
|
+
<ul
|
|
3
|
+
{% if params.id %}id="{{ params.id }}"{% endif %}class="ons-document-list{{ ' ' + params.classes if params.classes else '' }}"
|
|
4
|
+
{% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
5
|
+
>
|
|
3
6
|
{% for document in params.documents %}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{%
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
{% set titleTag = params.titleTag | default("h2") %}
|
|
8
|
+
{% set openingTag = "<" + titleTag %}
|
|
9
|
+
{% set closingTag = "</" + titleTag + ">" %}
|
|
10
|
+
{% set documentItem %}
|
|
11
|
+
{% if document.thumbnail %}
|
|
12
|
+
<div
|
|
13
|
+
class="ons-document-list__item-image{{ ' ons-document-list__item-image--file' if document.metadata.file }}"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
>
|
|
16
|
+
<a
|
|
17
|
+
class="ons-document-list__image-link{{ ' ons-document-list__image-link--placeholder' if not document.thumbnail.smallSrc }}"
|
|
18
|
+
href="{{ document.url }}"
|
|
19
|
+
tabindex="-1"
|
|
20
|
+
>
|
|
21
|
+
{% if document.thumbnail.smallSrc and document.thumbnail.largeSrc %}
|
|
22
|
+
<img
|
|
23
|
+
srcset="{{ document.thumbnail.smallSrc }} 1x, {{ document.thumbnail.largeSrc }} 2x"
|
|
24
|
+
src="{{ document.thumbnail.smallSrc }}"
|
|
25
|
+
alt=""
|
|
26
|
+
loading="lazy"
|
|
27
|
+
/>
|
|
28
|
+
{% endif %}
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
{% endif %}
|
|
32
|
+
|
|
33
|
+
<div class="ons-document-list__item-content">
|
|
34
|
+
<div
|
|
35
|
+
class="ons-document-list__item-header{{ ' ons-document-list__item-header--reverse' if document.showMetadataFirst == true }}"
|
|
36
|
+
>
|
|
37
|
+
{{ openingTag | safe }} class="ons-document-list__item-title ons-u-fs-m ons-u-mt-no ons-u-mb-xs">
|
|
38
|
+
<a href="{{ document.url }}"
|
|
39
|
+
>{{ document.title }}
|
|
40
|
+
{%- if document.metadata and document.metadata.file -%}
|
|
34
41
|
<span class="ons-u-vh">
|
|
35
|
-
{%
|
|
42
|
+
{%
|
|
43
|
+
set fileMetadataItems = [
|
|
36
44
|
document.metadata.file.fileType + ' document download' if document.metadata.file.fileType,
|
|
37
45
|
document.metadata.file.fileSize if document.metadata.file.fileSize,
|
|
38
46
|
document.metadata.file.filePages if document.metadata.file.filePages ]
|
|
39
47
|
%}
|
|
40
|
-
|
|
41
48
|
, {{ fileMetadataItems | join(', ') }}
|
|
42
|
-
|
|
49
|
+
</span>
|
|
50
|
+
{% endif %}
|
|
51
|
+
</a>
|
|
52
|
+
{{ closingTag | safe }}
|
|
53
|
+
|
|
54
|
+
{%- if document.metadata -%}
|
|
55
|
+
<ul class="ons-document-list__item-metadata{{ ' ons-u-mb-xs' if document.description else ' ons-u-mb-no' }}">
|
|
56
|
+
{%- if document.metadata.date -%}
|
|
57
|
+
<li class="ons-document-list__item-attribute">
|
|
58
|
+
{% set prefixClass = "ons-u-fw-b" if document.metadata.date.showPrefix == true else "ons-u-vh" %}
|
|
59
|
+
<span class="{{ prefixClass }}">{{ document.metadata.date.prefix | default("Published") }}: </span>
|
|
60
|
+
{%- if document.metadata.date.iso -%}
|
|
61
|
+
<time datetime="{{ document.metadata.date.iso }}">{{ document.metadata.date.short }}</time>
|
|
62
|
+
{%- endif -%}
|
|
63
|
+
</li>
|
|
43
64
|
{% endif %}
|
|
44
65
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<a class="ons-document-list__attribute-link" href="{{ document.metadata.type.url }}">
|
|
66
|
-
{% endif %}
|
|
67
|
-
<span {% if not document.metadata.file and not document.metadata.type.url %}class="ons-u-fw-b"{% endif %}>{{ document.metadata.type.text }}{%- if document.metadata.type.ref %}: {% elif document.metadata.file %},{% endif %}</span>
|
|
68
|
-
{%- if document.metadata.type.url %}
|
|
69
|
-
</a>
|
|
70
|
-
{% endif %}
|
|
71
|
-
{%- if document.metadata.type.ref %}
|
|
72
|
-
<span>{{ document.metadata.type.ref }}</span>
|
|
73
|
-
{% endif %}
|
|
74
|
-
</li>
|
|
75
|
-
{% endif %}
|
|
76
|
-
|
|
77
|
-
{%- if document.metadata.file and document.metadata.file.fileType %}
|
|
78
|
-
|
|
79
|
-
<li class="ons-document-list__item-attribute" aria-hidden="true">
|
|
80
|
-
{% set fileMetadataItems = [
|
|
81
|
-
document.metadata.file.fileType if document.metadata.file.fileType,
|
|
82
|
-
document.metadata.file.fileSize if document.metadata.file.fileSize,
|
|
83
|
-
document.metadata.file.filePages if document.metadata.file.filePages ]
|
|
84
|
-
%}
|
|
85
|
-
{{ fileMetadataItems | join(', ') }}
|
|
86
|
-
</li>
|
|
87
|
-
|
|
88
|
-
{% endif -%}
|
|
89
|
-
</ul>
|
|
90
|
-
|
|
91
|
-
{% endif %}
|
|
92
|
-
</div>
|
|
66
|
+
{%- if document.metadata.type and document.metadata.type.text -%}
|
|
67
|
+
<li class="ons-document-list__item-attribute{{ ' ons-u-mr-no' if document.metadata.file }}">
|
|
68
|
+
{% set metadataType %}
|
|
69
|
+
<span
|
|
70
|
+
{% if not document.metadata.file and not document.metadata.type.url %}class="ons-u-fw-b"{% endif %}
|
|
71
|
+
>{{ document.metadata.type.text }}{%- if document.metadata.type.ref -%}:{% elif document.metadata.file %},{% endif %}</span
|
|
72
|
+
>
|
|
73
|
+
{% endset %}
|
|
74
|
+
{%- if document.metadata.type.url -%}
|
|
75
|
+
<a class="ons-document-list__attribute-link" href="{{ document.metadata.type.url }}">
|
|
76
|
+
{{ metadataType | safe }}
|
|
77
|
+
</a>
|
|
78
|
+
{% else %}
|
|
79
|
+
{{ metadataType | safe }}
|
|
80
|
+
{% endif %}
|
|
81
|
+
{%- if document.metadata.type.ref -%}
|
|
82
|
+
<span>{{ document.metadata.type.ref }}</span>
|
|
83
|
+
{% endif %}
|
|
84
|
+
</li>
|
|
85
|
+
{% endif %}
|
|
93
86
|
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
{%- if document.metadata.file and document.metadata.file.fileType -%}
|
|
88
|
+
<li class="ons-document-list__item-attribute" aria-hidden="true">
|
|
89
|
+
{%
|
|
90
|
+
set fileMetadataItems = [
|
|
91
|
+
document.metadata.file.fileType if document.metadata.file.fileType,
|
|
92
|
+
document.metadata.file.fileSize if document.metadata.file.fileSize,
|
|
93
|
+
document.metadata.file.filePages if document.metadata.file.filePages ]
|
|
94
|
+
%}
|
|
95
|
+
{{ fileMetadataItems | join(', ') }}
|
|
96
|
+
</li>
|
|
97
|
+
{%- endif -%}
|
|
98
|
+
</ul>
|
|
96
99
|
{% endif %}
|
|
97
|
-
|
|
98
100
|
</div>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
{% if document.description %}
|
|
102
|
+
<div class="ons-document-list__item-description">{{ document.description | safe }}</div>
|
|
103
|
+
{% endif %}
|
|
102
104
|
</div>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
{% endset %}
|
|
106
|
+
|
|
107
|
+
<li
|
|
108
|
+
class="ons-document-list__item{{ ' ons-document-list__item--featured' if document.featured }}{{ ' ons-document-list__item--full-width' if document.featured and document.fullWidth == true }}{{ ' ' + document.classes if document.classes else '' }}"
|
|
109
|
+
{% if document.attributes %}{% for attribute, value in (document.attributes.items() if document.attributes is mapping and document.attributes.items else document.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
|
|
110
|
+
>
|
|
111
|
+
{% if document.featured and document.fullWidth == true %}
|
|
112
|
+
<div class="ons-container{{ ' ons-container--wide' if document.wide == true }}">{{ documentItem | safe }}</div>
|
|
113
|
+
{% else %}
|
|
114
|
+
{{ documentItem | safe }}
|
|
115
|
+
{% endif %}
|
|
116
|
+
</li>
|
|
107
117
|
{% endfor %}
|
|
108
118
|
</ul>
|
|
109
|
-
|
|
110
119
|
{% endmacro %}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
'fullWidth': true
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
{% from "components/document-list/_macro.njk" import onsDocumentList %}
|
|
6
6
|
|
|
7
|
-
{{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"url": '#0',
|
|
17
|
-
"title": 'Landmarks are lighting up purple to mark Census Day',
|
|
18
|
-
"metadata": {
|
|
19
|
-
"type": {
|
|
20
|
-
"text": 'Press releases',
|
|
21
|
-
"url": '#0'
|
|
7
|
+
{{
|
|
8
|
+
onsDocumentList({
|
|
9
|
+
"documents": [
|
|
10
|
+
{
|
|
11
|
+
"featured": true,
|
|
12
|
+
"fullWidth": true,
|
|
13
|
+
"thumbnail": {
|
|
14
|
+
"smallSrc": '/img/small/census-monuments-lights-featured.jpg',
|
|
15
|
+
"largeSrc": '/img/large/census-monuments-lights-featured.jpg'
|
|
22
16
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
"url": '#0',
|
|
18
|
+
"title": 'Landmarks are lighting up purple to mark Census Day',
|
|
19
|
+
"metadata": {
|
|
20
|
+
"type": {
|
|
21
|
+
"text": 'Press releases',
|
|
22
|
+
"url": '#0'
|
|
23
|
+
},
|
|
24
|
+
"date": {
|
|
25
|
+
"iso": '2022-01-01',
|
|
26
|
+
"short": '1 January 2022'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"description": 'Hundreds of buildings & landmarks across England and Wales are lighting up purple this weekend to celebrate the census and its importance to communities.'
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
})
|
|
33
|
+
}}
|