-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlayout.html
More file actions
222 lines (200 loc) · 8.47 KB
/
layout.html
File metadata and controls
222 lines (200 loc) · 8.47 KB
1
2
3
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
{% extends "govuk/template.njk" %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink -%}
{% from "govuk/components/footer/macro.njk" import govukFooter -%}
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner -%}
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink -%}
{% from "govuk/macros/attributes.njk" import govukAttributes -%}
{% from "components/service-banner/macro.njk" import appServiceBanner -%}
{% from "components/tag-env/macro.njk" import appTagEnv -%}
{% from "govuk/components/cookie-banner/macro.njk" import govukCookieBanner -%}
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner -%}
{% from "govuk/components/service-navigation/macro.njk" import govukServiceNavigation %}
{% set productName %}
{% if config.cdpEnvironment !== "prod" %}
{{ appTagEnv({ env: config.cdpEnvironment }) }}
{% endif %}
{% endset %}
{% block head %}
<meta name="application-name" content="@defra/forms-runner" {{- govukAttributes({
"data-environment": {
value: config.cdpEnvironment,
optional: true
},
"data-version": {
value: config.serviceVersion,
optional: true
}
}) }}>
<link rel="preload" as="font" href="{{ assetPath }}/fonts/bold-b542beb274-v2.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="preload" as="font" href="{{ assetPath }}/fonts/light-94a07e06a1-v2.woff2" type="font/woff2" crossorigin="anonymous">
<link rel="stylesheet" href="{{ getAssetPath("stylesheets/application.scss") }}">
{% if config.useMapsFeature %}
<link href="{{assetPath}}/interactive-map/css/index.css" rel="stylesheet" type="text/css">
<link href="{{assetPath}}/interactive-map/plugins/map-styles/dist/css/index.css" rel="stylesheet" type="text/css">
<link href="{{assetPath}}/interactive-map/plugins/search/dist/css/index.css" rel="stylesheet" type="text/css">
<link href="{{assetPath}}/interactive-map/plugins/scale-bar/dist/css/index.css" rel="stylesheet" type="text/css">
<link href="{{assetPath}}/interactive-map/plugins/interact/dist/css/index.css" rel="stylesheet" type="text/css">
{% endif %}
{% endblock %}
{% block pageTitle -%}
{{ "Error: " if errors | length }}{{ pageTitle | evaluate }} - {{ name if name else config.serviceName }} - GOV.UK
{%- endblock %}
{% block skipLink %}
{{ govukSkipLink({
href: '#main-content',
text: 'Skip to main content'
}) }}
{% endblock %}
{% set phaseTag = phaseTag or config.phaseTag %}
{% block header %}
{% if config.googleAnalyticsTrackingId and slug %}
<form method="post" action="/help/cookie-preferences/{{ slug }}?returnUrl={{ currentPath | urlencode }}">
<input type="hidden" name="crumb" value="{{ crumb }}">
{% set acceptHtml %}
<p class="govuk-body">You’ve accepted analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
{% endset %}
{% set rejectedHtml %}
<p class="govuk-body">You’ve rejected analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
{% endset %}
{% if cookieConsent.analytics !== true and cookieConsent.analytics !== false and cookieConsent.dismissed !== true %}
{% set html %}
<p class="govuk-body">We use some essential cookies to make this service work.</p>
<p class="govuk-body">We’d like to set analytics cookies so we can understand how people use the service and make improvements.</p>
{% endset %}
{{ govukCookieBanner({
ariaLabel: "Cookies on " + config.serviceName,
messages: [
{
headingText: config.serviceName,
html: html,
actions: [
{
text: "Accept analytics cookies",
type: "submit",
name: "cookies[analytics]",
value: "yes"
},
{
text: "Reject analytics cookies",
type: "submit",
name: "cookies[analytics]",
value: "no"
},
{
text: "View cookies",
href: "/help/cookies/" + slug
}
]
}
]
}) }}
{% elif cookieConsent.dismissed === false %}
{{ govukCookieBanner({
ariaLabel: "Cookies on " + config.serviceName,
messages: [
{
html: acceptHtml if cookieConsent.analytics === true else rejectedHtml,
actions: [
{
text: "Hide cookie message",
type: "submit",
name: "cookies[dismissed]",
value: "yes"
}
]
}
]
}) }}
{% endif %}
</form>
{% endif %}
{% if config.serviceBannerText | length %}
{{ appServiceBanner({
title: "Service status",
text: config.serviceBannerText
}) }}
{% endif %}
{{ govukHeader({
homepageUrl: currentPath if context.isForceAccess else "https://www.gov.uk",
containerClasses: "govuk-width-container",
classes: "govuk-header--full-width-border",
productName: productName | safe | trim
}) }}
{{ govukServiceNavigation({
serviceName: name if name else config.serviceName,
serviceUrl: currentPath if context.isForceAccess else serviceUrl
}) }}
{% endblock %}
{% block beforeContent %}
{% set feedbackLink = feedbackLink or config.feedbackLink %}
{% if phaseTag and not hidePhaseBanner %}
{% set feedbackLinkHtml -%}
{% if feedbackLink %}
<a href="{{ currentPath if context.isForceAccess else feedbackLink }}" class="govuk-link govuk-link--no-visited-state" {%- if not context.isForceAccess %} target="_blank" rel="noopener noreferrer" {%- endif %}>
give your feedback (opens in new tab)
</a>
{% else %}
<a href="mailto:{{ config.feedbackViaEmail }}" class="govuk-link govuk-link--no-visited-state">
give your feedback by email
</a>
{% endif %}
{%- endset %}
{{ govukPhaseBanner({
tag: { text: phaseTag | capitalize },
html: "This is a new service. Help us improve it and " + feedbackLinkHtml | safe + "."
}) }}
{% endif %}
{% if backLink %}
{{ govukBackLink(backLink) }}
{% endif %}
{% endblock %}
{% block content %}
<h1 class="govuk-heading-l">Default page template</h1>
{% endblock %}
{% block bodyEnd %}
<script type="module" nonce="{{ cspNonce }}" src="{{ getAssetPath("application.js") }}"></script>
{% if config.useMapsFeature %}
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/providers/maplibre/dist/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/providers/open-names/dist/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/plugins/map-styles/dist/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/plugins/search/dist/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/plugins/scale-bar/dist/umd/index.js"></script>
<script nonce="{{ cspNonce }}" src="{{assetPath}}/interactive-map/plugins/interact/dist/umd/index.js"></script>
<script type="module" nonce="{{ cspNonce }}" src="{{ getAssetPath("maps.js") }}"></script>
{% endif %}
{% if config.googleAnalyticsTrackingId and cookieConsent.analytics === true %}
<script id="ga-tag-js-main" nonce="{{ cspNonce }}" src="https://www.googletagmanager.com/gtag/js?id={{ config.googleAnalyticsTrackingId }}" defer></script>
<script id="ga-tag-js-init" nonce="{{ cspNonce }}">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ config.googleAnalyticsTrackingId }}');
</script>
{% endif %}
{% endblock %}
{% block footer %}
{% set meta = {
items: [
{
href: '/help/get-support/' + slug,
text: 'Get help with this form'
},
{
href: '/help/privacy/' + slug,
text: 'Privacy'
},
{
href: '/help/cookies/' + slug,
text: 'Cookies'
},
{
href: '/help/accessibility-statement/' + slug,
text: 'Accessibility Statement'
}
]
} if slug %}
{% if not context.isForceAccess %}
{{ govukFooter({ meta: meta }) }}
{% endif %}
{% endblock %}