govuk_publishing_components 23.15.0 → 24.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +330 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -10
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
- data/app/assets/stylesheets/component_guide/application.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +298 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +7 -87
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +21 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +105 -48
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +17 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
- data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
- data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +15 -22
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +47 -36
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +37 -3
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/config/initializers/assets.rb +0 -1
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +61 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +13 -20
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
- data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
- data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
- data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -5,43 +5,36 @@
|
|
5
5
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
6
6
|
items ||= []
|
7
7
|
condensed ||= false
|
8
|
+
anchor_navigation ||= false
|
8
9
|
|
9
|
-
accordion_classes = %w(gem-c-accordion
|
10
|
-
accordion_classes << '
|
10
|
+
accordion_classes = %w(gem-c-accordion)
|
11
|
+
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
11
12
|
accordion_classes << (shared_helper.get_margin_bottom)
|
12
13
|
|
13
14
|
data_attributes ||= {}
|
14
|
-
data_attributes[:module] = '
|
15
|
+
data_attributes[:module] = 'gem-accordion'
|
16
|
+
data_attributes[:anchor_navigation] = anchor_navigation
|
15
17
|
%>
|
16
18
|
<% if items.any? %>
|
17
19
|
<%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
|
18
20
|
<% items.each_with_index do |item, i| %>
|
19
21
|
<%
|
20
|
-
# Nunjucks starts a loop on 1 and the client side JavaScript also
|
21
|
-
# adopts this behaviour. To prevent things from breaking, the index
|
22
|
-
# here also need to be increase by one. (Nunjucks is used by GOV.UK
|
23
|
-
# Frontend, which this component is based on.)
|
24
22
|
index = i + 1
|
25
23
|
|
26
|
-
|
24
|
+
section_classes = %w(gem-c-accordion__section)
|
25
|
+
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
27
26
|
|
28
|
-
|
29
|
-
section_classes << 'govuk-accordion__section--expanded' if item[:expanded]
|
30
|
-
|
31
|
-
summary_classes = %w(govuk-accordion__section-summary govuk-body)
|
27
|
+
summary_classes = %w(gem-c-accordion__section-summary govuk-body)
|
32
28
|
%>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
class: 'govuk-accordion__section-heading'
|
40
|
-
)
|
41
|
-
%>
|
29
|
+
|
30
|
+
<%= tag.section(class: section_classes) do %>
|
31
|
+
<div class="gem-c-accordion__section-header">
|
32
|
+
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading', id: item[:heading][:id]) do %>
|
33
|
+
<%= tag.span(item[:heading][:text], id: "#{id}-heading-#{index}", data: item[:data_attributes], class: 'gem-c-accordion__section-button') %>
|
34
|
+
<% end %>
|
42
35
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
43
36
|
</div>
|
44
|
-
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "
|
37
|
+
<%= tag.div(item[:content][:html], id: "#{id}-content-#{index}", class: "gem-c-accordion__section-content", 'aria-label': "#{item[:heading][:text]}") %>
|
45
38
|
<% end %>
|
46
39
|
<% end %>
|
47
40
|
<% end %>
|
@@ -41,11 +41,11 @@
|
|
41
41
|
"aria-hidden": true,
|
42
42
|
data: data_attributes do %>
|
43
43
|
<% if attachment.document? %>
|
44
|
-
<%= render "govuk_publishing_components/components/attachment/thumbnail_document
|
44
|
+
<%= render "govuk_publishing_components/components/attachment/thumbnail_document" %>
|
45
45
|
<% elsif attachment.spreadsheet? %>
|
46
|
-
<%= render "govuk_publishing_components/components/attachment/thumbnail_spreadsheet
|
46
|
+
<%= render "govuk_publishing_components/components/attachment/thumbnail_spreadsheet" %>
|
47
47
|
<% else %>
|
48
|
-
<%= render "govuk_publishing_components/components/attachment/thumbnail_generic
|
48
|
+
<%= render "govuk_publishing_components/components/attachment/thumbnail_generic" %>
|
49
49
|
<% end %>
|
50
50
|
<% end %>
|
51
51
|
<% end %>
|
@@ -1,72 +1,83 @@
|
|
1
1
|
<%
|
2
2
|
id ||= 'global-cookie-message'
|
3
|
-
title ||= "
|
4
|
-
text ||=
|
3
|
+
title ||= "Cookies on GOV.UK"
|
4
|
+
text ||= ["We use some essential cookies to make this website work.", "We’d like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.", "We also use cookies set by other sites to help us deliver content from their services."]
|
5
|
+
if text.kind_of?(Array)
|
6
|
+
newtext = ""
|
7
|
+
text.each do |t|
|
8
|
+
newtext += "<p class='govuk-body'>#{t}</p>"
|
9
|
+
end
|
10
|
+
text = newtext
|
11
|
+
else
|
12
|
+
text = "<p class='govuk-body'>#{text}</p>"
|
13
|
+
end
|
14
|
+
text = raw(text)
|
15
|
+
|
5
16
|
cookie_preferences_href ||= "/help/cookies"
|
6
|
-
confirmation_message ||= raw("You
|
17
|
+
confirmation_message ||= raw("You can <a class='govuk-link' href='#{cookie_preferences_href}' data-module='track-click' data-track-category='cookieBanner' data-track-action='Cookie banner settings clicked from confirmation'>change your cookie settings</a> at any time.")
|
7
18
|
services_cookies ||= nil
|
8
19
|
css_classes = %w(gem-c-cookie-banner govuk-clearfix)
|
9
20
|
css_classes << "gem-c-cookie-banner--services" if services_cookies
|
10
21
|
%>
|
11
|
-
|
12
22
|
<div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" role="region" aria-label="cookie banner" data-nosnippet>
|
13
|
-
<div class="
|
14
|
-
<div class="govuk-
|
15
|
-
<div class="govuk-grid-
|
16
|
-
<div class="
|
17
|
-
<h2 class="govuk-heading-m"><%= title %></h2>
|
18
|
-
<
|
23
|
+
<div class="govuk-cookie-banner js-banner-wrapper" role="region" aria-label="<%= title %>">
|
24
|
+
<div class="gem-c-cookie-banner__message govuk-cookie-banner__message govuk-width-container">
|
25
|
+
<div class="govuk-grid-row">
|
26
|
+
<div class="govuk-grid-column-two-thirds">
|
27
|
+
<h2 class="govuk-cookie-banner__heading govuk-heading-m"><%= title %></h2>
|
28
|
+
<div class="govuk-cookie-banner__content">
|
29
|
+
<%= text %>
|
30
|
+
</div>
|
19
31
|
</div>
|
20
|
-
|
21
|
-
|
32
|
+
</div>
|
33
|
+
<% if services_cookies %>
|
34
|
+
<div class="govuk-button-group">
|
22
35
|
<%= render "govuk_publishing_components/components/button", {
|
36
|
+
name: "cookies",
|
23
37
|
text: services_cookies.dig(:yes, :text) || "Yes",
|
24
|
-
inline_layout: true,
|
25
38
|
data_attributes: { module: "track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
26
39
|
} %>
|
27
40
|
<%= render "govuk_publishing_components/components/button", {
|
41
|
+
name: "cookies",
|
28
42
|
text: services_cookies.dig(:no, :text) || "No",
|
29
|
-
|
30
|
-
data_attributes: { module: "track-click", "hide-cookie-banner": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
43
|
+
data_attributes: { module: "track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
31
44
|
} %>
|
32
45
|
<% if services_cookies[:cookie_preferences] %>
|
33
|
-
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "
|
46
|
+
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
|
34
47
|
<% end %>
|
35
48
|
</div>
|
36
49
|
<% else %>
|
37
|
-
<div class="
|
38
|
-
|
39
|
-
|
40
|
-
text: "Accept
|
41
|
-
inline_layout: true,
|
50
|
+
<div class="govuk-button-group">
|
51
|
+
<%= render "govuk_publishing_components/components/button", {
|
52
|
+
name: "cookies",
|
53
|
+
text: "Accept additional cookies",
|
42
54
|
data_attributes: {
|
43
55
|
module: "track-click",
|
44
56
|
"accept-cookies": "true",
|
45
57
|
"track-category": "cookieBanner",
|
46
|
-
"track-action": "Cookie banner accepted"
|
58
|
+
"track-action": "Cookie banner accepted",
|
59
|
+
"cookie-types": "all",
|
47
60
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
text: "Set cookie preferences",
|
53
|
-
href: cookie_preferences_href,
|
54
|
-
inline_layout: true,
|
61
|
+
} %>
|
62
|
+
<%= render "govuk_publishing_components/components/button", {
|
63
|
+
name: "cookies",
|
64
|
+
text: "Reject additional cookies",
|
55
65
|
data_attributes: {
|
56
66
|
module: "track-click",
|
67
|
+
"reject-cookies": "true",
|
57
68
|
"track-category": "cookieBanner",
|
58
|
-
"track-action": "Cookie banner
|
69
|
+
"track-action": "Cookie banner rejected",
|
59
70
|
}
|
60
|
-
|
61
|
-
</
|
71
|
+
} %>
|
72
|
+
<a class="govuk-link" href="<%= cookie_preferences_href %>">View cookies</a>
|
62
73
|
</div>
|
63
74
|
<% end %>
|
64
|
-
</div>
|
65
75
|
</div>
|
66
76
|
</div>
|
67
|
-
|
68
|
-
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1">
|
77
|
+
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
|
69
78
|
<p class="gem-c-cookie-banner__confirmation-message" role="alert"><%= confirmation_message %></p>
|
70
|
-
<
|
79
|
+
<div class="govuk-button-group">
|
80
|
+
<button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
|
81
|
+
</div>
|
71
82
|
</div>
|
72
83
|
</div>
|
@@ -29,12 +29,21 @@
|
|
29
29
|
item_classes = "gem-c-document-list__item-title #{brand_helper.color_class} #{title_with_context_class if item[:link][:context]}"
|
30
30
|
|
31
31
|
if item[:link][:path]
|
32
|
+
rel = [
|
33
|
+
"external",
|
34
|
+
"nofollow",
|
35
|
+
"noopener",
|
36
|
+
"noreferrer",
|
37
|
+
"opener",
|
38
|
+
].include?(item[:link][:rel]) ? item[:link][:rel] : nil
|
39
|
+
|
32
40
|
link_to(
|
33
41
|
item[:link][:text],
|
34
42
|
item[:link][:path],
|
35
43
|
data: item[:link][:data_attributes],
|
36
44
|
class: "#{item_classes} gem-c-document-list__item-link",
|
37
|
-
lang: item[:link][:locale].presence
|
45
|
+
lang: item[:link][:locale].presence,
|
46
|
+
rel: rel,
|
38
47
|
)
|
39
48
|
else
|
40
49
|
content_tag(
|
@@ -6,7 +6,7 @@
|
|
6
6
|
classes << "gem-c-layout-footer--border" if with_border
|
7
7
|
%>
|
8
8
|
<%= tag.footer class: classes, role: "contentinfo" do %>
|
9
|
-
<div class="govuk-width-container" data-module="track-click">
|
9
|
+
<div class="govuk-width-container" data-module="gem-track-click">
|
10
10
|
<% if navigation.any? %>
|
11
11
|
<div class="govuk-footer__navigation">
|
12
12
|
<% navigation.each do |item| %>
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,20 +4,25 @@ govuk_frontend_components:
|
|
4
4
|
- accordion
|
5
5
|
body: |
|
6
6
|
This component is based on the [design system accordion component](https://design-system.service.gov.uk/components/accordion/)
|
7
|
-
and is currently experimental.
|
7
|
+
and is currently experimental because more research is needed to validate it. If using this component, [please feed back any research findings to the Design System team](https://design-system.service.gov.uk/components/accordion/#next-steps).
|
8
8
|
|
9
9
|
accessibility_criteria: |
|
10
10
|
The accordion must:
|
11
11
|
|
12
12
|
* accept focus
|
13
13
|
* be usable with a keyboard
|
14
|
-
*
|
14
|
+
* the controls must change in appearance when keyboard focus moves to it
|
15
|
+
* the controls must indicate when the mouse is hovered over it
|
15
16
|
* be usable with touch
|
16
17
|
* be usable with voice commands
|
17
18
|
* have visible text
|
18
19
|
* indicate to users that each section can be expanded and collapsed
|
19
20
|
* inform the user when a step has been expanded or collapsed
|
20
|
-
* be readable when only the text of the page is zoomed in
|
21
|
+
* be readable when only the [text of the page is zoomed in](https://support.mozilla.org/en-US/kb/font-size-and-zoom-increase-size-of-web-pages#w_how-to-only-change-the-size-of-the-text)
|
22
|
+
* zoom in up to 300% without the text spilling off the screen
|
23
|
+
* pass colour contrast
|
24
|
+
* the accordion header button element has aria-controls set to the ID of the element containing the accordion panel content.
|
25
|
+
* section content must have aria-label / aria-labelledby with a value that refers to the button that controls display of the content.
|
21
26
|
|
22
27
|
Section headings must use a button element:
|
23
28
|
|
@@ -269,6 +274,35 @@ examples:
|
|
269
274
|
text: "How people read"
|
270
275
|
content:
|
271
276
|
html: "<p class='govuk-body'>This is the content for How people read.</p>"
|
277
|
+
with_the_anchor_link_navigation:
|
278
|
+
description: |
|
279
|
+
Some apps require custom ids per accordion section heading for linking between those specific sections, sometimes across multiple pages. An example of this is on manuals pages where multiple manuals will each include large sets of accordions and will reference between specific sections for ease of access to that content. [Live example](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/creating-and-updating-pages#associations).
|
280
|
+
|
281
|
+
This feature automatically opens accordions when an anchor link is clicked within another accordion that links to either the id of an accordion section heading or an id within the content of an accordion. This will also automatically navigate to and open accordions on page load using the same rules.
|
282
|
+
|
283
|
+
This feature won't be used if the `anchor_navigation` flag isn't passed as true to mitigate performance risk from event listeners on a large number of links.
|
284
|
+
|
285
|
+
Unlike with the accordion-wide custom id attribute, any ids passed to accordion headings as part of this feature aren't stored in `localStorage` so don't need to be unique across your domain, but **should still be unique in the context of the page**.
|
286
|
+
data:
|
287
|
+
anchor_navigation: true
|
288
|
+
items:
|
289
|
+
- heading:
|
290
|
+
text: "Writing well for the web"
|
291
|
+
id: "writing-well-for-the-web"
|
292
|
+
content:
|
293
|
+
html: "<p class='govuk-body'>This is the content for Writing well for the web.</p>"
|
294
|
+
- heading:
|
295
|
+
text: "Writing well for specialists"
|
296
|
+
content:
|
297
|
+
html: "<p class='govuk-body'>This is the content for Writing well for specialists.</p>"
|
298
|
+
- heading:
|
299
|
+
text: "Know your audience"
|
300
|
+
content:
|
301
|
+
html: "<p class='govuk-body'>This is the content for Know your audience.</p>"
|
302
|
+
- heading:
|
303
|
+
text: "How people read"
|
304
|
+
content:
|
305
|
+
html: "<p class='govuk-body'>This is the content for How people read.</p>"
|
272
306
|
condensed_layout:
|
273
307
|
description: |
|
274
308
|
This is for when a smaller accordion is required. Since smaller screens trigger a single column layout, this modifier only makes the accordion smaller when viewed on large screens.
|
@@ -72,6 +72,11 @@ examples:
|
|
72
72
|
- text: Check what age you can drive
|
73
73
|
href: "/vehicles-can-drive"
|
74
74
|
optional: false
|
75
|
+
- title: Testing the and
|
76
|
+
logic: and
|
77
|
+
contents:
|
78
|
+
- type: paragraph
|
79
|
+
text: hello hello what's UP
|
75
80
|
- title: Driving lessons and practice
|
76
81
|
contents:
|
77
82
|
- type: paragraph
|
@@ -1,6 +1,8 @@
|
|
1
1
|
name: Cookie banner
|
2
2
|
description: Help users manage their personal data by telling them when you store cookies on their device.
|
3
3
|
body: |
|
4
|
+
By default the cookie banner is shown to all users with just a link to the settings page. If JS is on this is enhanced to show accept/reject buttons if preferences aren't set, or to hide the banner if they are.
|
5
|
+
|
4
6
|
Setting `data-hide-cookie-banner="true"` on any link inside the banner will overwrite the default action and when clicked will dismiss the cookie banner for a period of 365 days (approx. 1 year).
|
5
7
|
|
6
8
|
If the examples below are not showing the banner, make sure the `cookies_preferences_set` cookie is not present or is set to false.
|
@@ -18,6 +20,13 @@ examples:
|
|
18
20
|
title: "Can we store analytics cookies on your device?"
|
19
21
|
text: "This is some custom text in my cookie banner which lets users know what we're using cookies for. I can also include a link to the <a class='govuk-link' href='/cookies'>cookies page</a>"
|
20
22
|
confirmation_message: "You’ve accepted all cookies."
|
23
|
+
|
24
|
+
with_multi_paragraph_custom_content:
|
25
|
+
data:
|
26
|
+
title: "Can we store analytics cookies on your device?"
|
27
|
+
text: ["This is some custom text in my cookie banner.","There are three paragraphs.","They are passed as an array"]
|
28
|
+
confirmation_message: "You’ve accepted all cookies."
|
29
|
+
|
21
30
|
with_custom_cookie_preferences_href:
|
22
31
|
data:
|
23
32
|
cookie_preferences_href: "/cookies"
|
@@ -305,3 +305,21 @@ examples:
|
|
305
305
|
path: '/become-an-apprentice'
|
306
306
|
description: 'Becoming an apprentice - what to expect, apprenticeship levels, pay and training, making an application, complaining about an apprenticeship.'
|
307
307
|
full_size_description: true
|
308
|
+
with_rel_link_attribute:
|
309
|
+
description: |
|
310
|
+
The [rel attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel) is an option attribute to dictate the relationship between the document being linked to and the current page. This is predominantly used by search engines to help index journeys through a website.
|
311
|
+
|
312
|
+
On GOV.UK, this is typically used to dictate an external website being linked to with `rel="external"`, however this component supports:
|
313
|
+
|
314
|
+
- external
|
315
|
+
- nofollow
|
316
|
+
- noopener
|
317
|
+
- noreferrer
|
318
|
+
- opener
|
319
|
+
data:
|
320
|
+
items:
|
321
|
+
- link:
|
322
|
+
text: 'Report Fraud'
|
323
|
+
path: 'https://www.actionfraud.police.uk/contact-us'
|
324
|
+
rel: 'external'
|
325
|
+
description: "Contact Action Fraud to report fraud and cyber crime, or to tell them you've been the victim of a scam."
|
@@ -312,8 +312,8 @@ examples:
|
|
312
312
|
block: |
|
313
313
|
<div class="contact" id="contact_1017">
|
314
314
|
<div class="content">
|
315
|
-
<h3>Media enquiries</h3>
|
316
315
|
<div class="vcard contact-inner">
|
316
|
+
<p>Media enquiries</p>
|
317
317
|
<p class="adr">
|
318
318
|
<span class="street-address">2 Marsham Street<br>London</span><br>
|
319
319
|
<span class="postal-code">SW1P 4DF</span>
|
@@ -332,8 +332,8 @@ examples:
|
|
332
332
|
<h2>This is a title</h2>
|
333
333
|
<div class="contact" id="contact_1018">
|
334
334
|
<div class="content">
|
335
|
-
<h3>Media enquiries</h3>
|
336
335
|
<div class="vcard contact-inner">
|
336
|
+
<p>Media enquiries</p>
|
337
337
|
<p class="adr">
|
338
338
|
<span class="street-address">2 Marsham Street<br>London</span><br>
|
339
339
|
<span class="postal-code">SW1P 4DF</span>
|
@@ -349,8 +349,8 @@ examples:
|
|
349
349
|
<p>This is a paragraph.</p>
|
350
350
|
<div class="contact" id="contact_1019">
|
351
351
|
<div class="content">
|
352
|
-
<h3>Media enquiries</h3>
|
353
352
|
<div class="vcard contact-inner">
|
353
|
+
<p>Media enquiries</p>
|
354
354
|
<p class="adr">
|
355
355
|
<span class="street-address">2 Marsham Street<br>London</span><br>
|
356
356
|
<span class="postal-code">SW1P 4DF</span>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="govuk-header__logo gem-c-header__logo">
|
2
|
-
<a href="/" class="govuk-header__link govuk-header__link--homepage" data-module="track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
|
2
|
+
<a href="/" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
|
3
3
|
<span class="govuk-header__logotype">
|
4
4
|
<svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36">
|
5
5
|
<path fill="currentColor" fill-rule="evenodd"
|
@@ -25,7 +25,6 @@ Rails.application.config.assets.precompile += %w[
|
|
25
25
|
govuk_publishing_components/search-button.png
|
26
26
|
govuk_publishing_components/icon-file-download.svg
|
27
27
|
govuk_publishing_components/icon-important.svg
|
28
|
-
govuk_publishing_components/chevron-banner/*.svg
|
29
28
|
govuk_publishing_components/crests/*.png
|
30
29
|
govuk_publishing_components/take-action-amber.svg
|
31
30
|
govuk_publishing_components/take-action-green.svg
|
@@ -115,7 +115,67 @@ module GovukPublishingComponents
|
|
115
115
|
|
116
116
|
def brexit_cta_document_exceptions
|
117
117
|
# /government/news/30-creative-teams-awarded-up-to-100000-each-for-festival-uk-2022-rd-project
|
118
|
-
|
118
|
+
# and answer pages that have a start button (tracked in https://docs.google.com/spreadsheets/d/1ynH8zIjvElvK-u8JLI8KOYylxTbzJsoXRqEnqrnqv_4/edit)
|
119
|
+
%w[
|
120
|
+
c3752802-f091-43a9-ba90-33568fccf391
|
121
|
+
e1a9ce2b-4085-4761-b70f-d125a6571de3
|
122
|
+
6a2bf66e-2313-4204-afd5-9940de5e1d66
|
123
|
+
f65b0ac7-b8cd-476b-bd5d-738268517659
|
124
|
+
45ad868a-2e79-4029-991b-c29559d7eb29
|
125
|
+
e4e9c4ec-385e-4758-93ac-388bc154815e
|
126
|
+
cee73f76-83f0-44e2-b657-3b51a9cbc76e
|
127
|
+
9a945506-60bc-44d8-a2ec-0eb2824732d6
|
128
|
+
6ae16c12-a554-44e2-b3e3-596375aa1b9a
|
129
|
+
9add4ccc-dc4c-44cf-9b69-6878c162d431
|
130
|
+
4f5cf1cd-efda-4c49-8292-1db1c6c3cfb0
|
131
|
+
73058592-dedf-4379-9a1d-d8222a796c0a
|
132
|
+
c9259172-5432-43a6-b710-409d463c7627
|
133
|
+
59ecfc6d-cb9e-49b8-b013-fc368ebdf8ed
|
134
|
+
9897695d-624b-4cb9-b873-f3113f0332a1
|
135
|
+
715f4659-b058-46ec-84c8-cc346c210778
|
136
|
+
c63890f9-2356-4be3-9e07-6cf4b8de7081
|
137
|
+
e7661ec8-b678-444e-b4d0-a221fa83a7f7
|
138
|
+
723f9c0a-bcdb-4d8f-952c-6df0ed468c57
|
139
|
+
a1c420b7-11d7-4b9c-a97e-406fb73c0200
|
140
|
+
c1347936-839b-4547-a570-0c315c34ee45
|
141
|
+
1396f68b-6ffa-47ef-a049-414e7b548e81
|
142
|
+
3b054acf-d0af-470e-b912-9481204d1a9a
|
143
|
+
317b9c08-928b-4fd2-bc8e-4c6acf287c58
|
144
|
+
44d6cb7a-d853-4cd8-a9cb-69eff0299d9e
|
145
|
+
15517245-f142-4e45-ad84-773250f7d5a2
|
146
|
+
6fe6644d-d037-4ea4-baf6-800dc1966ed0
|
147
|
+
4a63625c-a195-4b86-9562-cb6653dd26ff
|
148
|
+
47521233-20a8-4d02-ba31-6e1977448fd1
|
149
|
+
7b8ca4ac-f3a3-41b8-9555-9e244c36575b
|
150
|
+
be1a82d1-e53c-431a-9e7a-337ed4b2654f
|
151
|
+
6c445001-4e29-4853-8c14-444d7f9374ee
|
152
|
+
c8cf2a7c-5c13-4f3d-b1ff-6a7eb5533973
|
153
|
+
2422a237-f8f1-4e9f-ad51-f1d44fde9755
|
154
|
+
ae000c08-c74f-467b-b8a4-90f138252a5c
|
155
|
+
7eec7800-9c4d-4160-af53-57b5d3e02972
|
156
|
+
eb545b3b-111b-4c3c-890c-c9ec29b9090d
|
157
|
+
8d705ade-8977-480d-9080-72a19e341c2a
|
158
|
+
2a0dd317-0252-4c7c-8c13-b43af28406bc
|
159
|
+
f27e5792-a84b-4164-9890-7e86767634e8
|
160
|
+
b0b9a600-1fe6-4257-9e68-2be0f59ea25d
|
161
|
+
28fa04ea-42e1-46ad-9abc-acf132c5666d
|
162
|
+
64b27b8a-ae53-4034-a812-f4805cd7e3ad
|
163
|
+
1dd5a75f-18b4-419d-b2b6-6d4808f2c7e4
|
164
|
+
b21b9e34-455c-4305-b4cc-4e6b8d3f7522
|
165
|
+
0ab53a0d-b098-43a8-b3cc-8b3224697228
|
166
|
+
e3862156-ba5a-41ba-8ee6-22e5cd6a6144
|
167
|
+
2e8f7fae-7164-459c-898b-0c0538eee3e0
|
168
|
+
6087439c-26d2-4881-b345-5160e23f3b5e
|
169
|
+
cac78a0a-9c28-436a-a29e-8ccbe8fbc956
|
170
|
+
c2fd13a5-537b-4368-ac2e-6078b2c463f1
|
171
|
+
98f0a21d-7b67-4089-a98c-f0a0177291a2
|
172
|
+
06692612-8c39-464c-8aee-2aa62e6c8887
|
173
|
+
df943977-69cb-479d-a921-9410d603c471
|
174
|
+
2656eb6b-f2eb-4982-8a90-e40d03a34a4d
|
175
|
+
4ca8698b-4a24-45ff-baea-7633cc24b679
|
176
|
+
ed73581f-9bf8-48b5-bb66-935581a255e3
|
177
|
+
15f1c594-af1d-4f16-97cc-ad4d12017509
|
178
|
+
]
|
119
179
|
end
|
120
180
|
|
121
181
|
def brexit_cta_document_exception?
|
@@ -125,7 +185,6 @@ module GovukPublishingComponents
|
|
125
185
|
def brexit_cta_document_type_exceptions
|
126
186
|
%w[
|
127
187
|
aaib_report
|
128
|
-
answer
|
129
188
|
asylum_support_decision
|
130
189
|
fatality_notice
|
131
190
|
maib_report
|