-
Notifications
You must be signed in to change notification settings - Fork 3
/
macro.html
104 lines (102 loc) · 5.22 KB
/
macro.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
{% from "govuk_frontend_jinja/macros/attributes.html" import govukAttributes %}
{#
Override the footer to remove links to the nationalarchives.org website, which were leaking
HTTP referer headers on some older browsers, potentially resulting in secure links to people's
documents ending up in national archives' access logs
Footer html taken from https://github.com/LandRegistry/govuk-frontend-jinja/blob/3.1.0/govuk_frontend_jinja/templates/components/footer/macro.html
(Note the 3.1.0 tag in the URL matches the version of govuk-frontend-jinja found in our requrements.in)
Changes to the html are:
* Changed the name of the macro
* Removed the <a> tag around "Open Government Licence v3.0"
* Replaced the <a> tag around "Crown copyright" with a <span>
* Removed the govuk-footer__link from that span (to remove underline styling)
#}
{% macro govukFooterWithoutExternalLinks(params) %}
<footer class="govuk-footer {{ params.classes if params.classes else '' }}"
{{- govukAttributes(params.attributes) }}>
<div class="govuk-width-container {{ params.containerClasses if params.containerClasses else '' }}">
{% if params.navigation | length %}
<div class="govuk-footer__navigation">
{% for nav in params.navigation %}
<div class="govuk-footer__section govuk-grid-column-{{ nav.width | default("full", true) }}">
<h2 class="govuk-footer__heading govuk-heading-m">{{ nav.title }}</h2>
{% if nav['items'] | length %}
{% set listClasses = "govuk-footer__list--columns-" ~ nav.columns if nav.columns %}
<ul class="govuk-footer__list {%- if listClasses %} {{ listClasses }}{% endif %}">
{% for item in nav['items'] %}
{% if item.href and item.text %}
<li class="govuk-footer__list-item">
<a class="govuk-footer__link" href="{{ item.href }}"
{{- govukAttributes(item.attributes) }}>
{{ item.text }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
<hr class="govuk-footer__section-break">
{% endif %}
<div class="govuk-footer__meta">
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
{% if 'meta' in params %}
<h2 class="govuk-visually-hidden">{{ params.meta.visuallyHiddenTitle | default("Support links", true) }}</h2>
{% if 'items' in params.meta and (params.meta['items'] | length) %}
<ul class="govuk-footer__inline-list">
{% for item in params.meta['items'] %}
<li class="govuk-footer__inline-list-item">
<a class="govuk-footer__link" href="{{ item.href }}"
{{- govukAttributes(item.attributes) }}>
{{ item.text }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if params.meta.text or params.meta.html %}
<div class="govuk-footer__meta-custom">
{{ params.meta.html | safe | trim | indent(10) if params.meta.html else params.meta.text }}
</div>
{% endif %}
{% endif %}
{# The SVG needs `focusable="false"` so that Internet Explorer does not
treat it as an interactive element - without this it will be
'focusable' when using the keyboard to navigate. -#}
<svg
aria-hidden="true"
focusable="false"
class="govuk-footer__licence-logo"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 483.2 195.7"
height="17"
width="41"
>
<path
fill="currentColor"
d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145"
/>
</svg>
<span class="govuk-footer__licence-description">
{% if params.contentLicence and (params.contentLicence.html or params.contentLicence.text) %}
{{ params.contentLicence.html | safe | trim | indent(10) if params.contentLicence.html else params.contentLicence.text }}
{% else %}
All content is available under the Open Government Licence v3.0</a>, except where otherwise stated
{% endif %}
</span>
</div>
<div class="govuk-footer__meta-item">
<span class="govuk-footer__copyright-logo">
{% if params.copyright and (params.copyright.html or params.copyright.text) %}
{{ params.copyright.html | safe | trim | indent(10) if params.copyright.html else params.copyright.text }}
{% else %}
© Crown copyright
{% endif %}
</span>
</div>
</div>
</div>
</footer>
{% endmacro %}