generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.html
180 lines (163 loc) · 5.55 KB
/
base.html
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
{% set htmlLang = language.current %}
{% set cspNonce = csp_nonce() %}
{% extends 'govuk_frontend_jinja/template.html' %}
{%- from 'govuk_frontend_jinja/components/cookie-banner/macro.html' import govukCookieBanner-%}
{%- from 'govuk_frontend_jinja/components/error-summary/macro.html' import govukErrorSummary-%}
{%- from 'govuk_frontend_jinja/components/notification-banner/macro.html' import govukNotificationBanner -%}
{%- from 'govuk_frontend_jinja/components/phase-banner/macro.html' import govukPhaseBanner -%}
{%- from 'main/_modal-dialog.html' import timeout_dialog %}
{% set assetPath = url_for('static', filename='').rstrip('/') %}
{% block pageTitle %}{{config['SERVICE_NAME']}} – GOV.UK{% endblock %}
{% block head %}
<link href="{{ url_for('static', filename='styles.css') }}" rel="stylesheet" nonce="{{ csp_nonce() }}" />
<script src="{{ url_for('static', filename='headscripts.js') }}" nonce="{{ csp_nonce() }}" ></script>
<script nonce="{{ csp_nonce() }}">
gtm_anon_id = '{{ gtm_anon_id }}';
</script>
<meta name="description" content="{{config['SERVICE_NAME']}}">
<meta name="author" content="{{config['DEPARTMENT_NAME']}}">
{% endblock %}
{% set bodyClasses = "govuk-frontend-supported" %}
{% block bodyStart %}
{% if "cookies_policy" not in request.cookies %}
{% 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 additional cookies so we can remember your settings, understand how people use the service and make improvements.</p>
{% endset %}
{% set acceptHtml %}
<p class="govuk-body">You’ve accepted additional cookies. You can <a class="govuk-link" href="{{ url_for('main.cookies') }}">change your cookie settings</a> at any time.</p>
{% endset %}
{% set rejectHtml %}
<p class="govuk-body">You’ve rejected additional cookies. You can <a class="govuk-link" href="{{ url_for('main.cookies') }}">change your cookie settings</a> at any time.</p>
{% endset %}
{{ govukCookieBanner({
'ariaLabel': "Cookies on " + config['SERVICE_NAME'],
'attributes': {
'id': "cookie-banner"
},
'messages': [
{
'attributes': {
'id': "default-message"
},
'headingText': "Cookies on " + config['SERVICE_NAME'],
'html': html,
'actions': [
{
'attributes': {
'id': "accept-cookies"
},
'text': "Accept additional cookies",
'type': "button",
'name': "cookies",
'value': "accept"
},
{
'attributes': {
'id': "reject-cookies"
},
'text': "Reject additional cookies",
'type': "button",
'name': "cookies",
'value': "reject"
},
{
'text': "View cookies",
'href': url_for('main.cookies')
}
]
},
{
'attributes': {
'id': "accepted-message"
},
'html': acceptHtml,
'role': "alert",
'hidden': true,
'actions': [
{
'attributes': {
'id': "accepted-hide"
},
'text': "Hide this message"
}
]
},
{
'attributes': {
'id': "rejected-message"
},
'html': rejectHtml,
'role': "alert",
'hidden': true,
'actions': [
{
'attributes': {
'id': "rejected-hide"
},
'text': "Hide this message"
}
]
}
]
}) }}
{% endif %}
{% endblock %}
{% block header %}
{{ govukHeader({
'homepageUrl': "https://www.gov.uk",
'serviceName': config['SERVICE_NAME'],
'serviceUrl': url_for('main.start_page'),
'useTudorCrown': true
}) }}
{% endblock %}
{% block beforeContent %}
{{ govukPhaseBanner({
'tag': {
'text': config['SERVICE_PHASE'],
},
'html': '<a class="govuk-link" href="' + url_for('contact.reasons_for_contacting') + '">Contact us</a> if you need help or would like to give feedback to improve this service'
}) }}
{% endblock %}
{% block content %}
{{ timeout_dialog() }}
{% if form and form.errors %}
{{ govukErrorSummary(wtforms_errors(form)) }}
{% endif %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
{{ govukNotificationBanner({'type': category, 'html': message}) }}
{% endfor %}
{% endif %}
{% endwith %}
{% endblock %}
{% block footer %}
{{ govukFooter({
'meta': {
'items': [
{
'href': language.switch.href,
'text': language.switch.text,
'attributes': {'x-data': 'language-switcher'},
},
{
'href': url_for('main.accessibility'),
'text': "Accessibility"
},
{
'href': url_for('main.cookies'),
'text': "Cookies"
},
{
'href': url_for('main.privacy'),
'text': "Privacy"
}
],
'html': 'Built by <a href="' + config['DEPARTMENT_URL'] +'" class="govuk-footer__link">' + config['DEPARTMENT_NAME'] + '</a>'
}
}) }}
{% endblock %}
{% block bodyEnd %}
<script src="{{ url_for('static', filename='scripts.js') }}" nonce="{{ csp_nonce() }}"></script>
{% endblock %}