govuk_publishing_components 24.1.1 → 24.4.1
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 +52 -8
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -6
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
- data/app/assets/stylesheets/component_guide/application.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +11 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +11 -84
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
- data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
- data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
- data/app/models/govuk_publishing_components/component_example.rb +4 -3
- data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +50 -39
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +29 -0
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
- data/config/locales/en.yml +7 -5
- data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
- metadata +7 -7
@@ -5,6 +5,7 @@
|
|
5
5
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
6
6
|
items ||= []
|
7
7
|
condensed ||= false
|
8
|
+
anchor_navigation ||= false
|
8
9
|
|
9
10
|
accordion_classes = %w(gem-c-accordion)
|
10
11
|
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
@@ -12,6 +13,7 @@
|
|
12
13
|
|
13
14
|
data_attributes ||= {}
|
14
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 %>
|
@@ -19,8 +21,6 @@
|
|
19
21
|
<%
|
20
22
|
index = i + 1
|
21
23
|
|
22
|
-
item[:data_attributes] ||= nil
|
23
|
-
|
24
24
|
section_classes = %w(gem-c-accordion__section)
|
25
25
|
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
26
26
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
<%= tag.section(class: section_classes) do %>
|
31
31
|
<div class="gem-c-accordion__section-header">
|
32
|
-
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading') do %>
|
32
|
+
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading', id: item[:heading][:id]) do %>
|
33
33
|
<%= tag.span(item[:heading][:text], id: "#{id}-heading-#{index}", data: item[:data_attributes], class: 'gem-c-accordion__section-button') %>
|
34
34
|
<% end %>
|
35
35
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
@@ -1,19 +1,22 @@
|
|
1
1
|
<%
|
2
|
+
border ||= false
|
2
3
|
breadcrumbs ||= []
|
3
|
-
inverse ||= false
|
4
4
|
collapse_on_mobile ||= false
|
5
|
+
inverse ||= false
|
6
|
+
|
5
7
|
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
|
6
8
|
|
7
|
-
classes =
|
8
|
-
classes << "
|
9
|
-
classes << "
|
9
|
+
classes = %w[gem-c-breadcrumbs govuk-breadcrumbs]
|
10
|
+
classes << "govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
|
11
|
+
classes << "gem-c-breadcrumbs--inverse" if inverse
|
12
|
+
classes << "gem-c-breadcrumbs--border-bottom" if border == "bottom"
|
10
13
|
%>
|
11
14
|
|
12
15
|
<script type="application/ld+json">
|
13
16
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
14
17
|
</script>
|
15
18
|
|
16
|
-
<div class="<%= classes %>" data-module="track-click">
|
19
|
+
<div class="<%= classes.join(" ") %>" data-module="gem-track-click">
|
17
20
|
<ol class="govuk-breadcrumbs__list">
|
18
21
|
<% breadcrumbs.each_with_index do |crumb, index| %>
|
19
22
|
<% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %>
|
@@ -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='gem-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
|
-
|
25
|
-
data_attributes: { module: "track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
38
|
+
data_attributes: { module: "gem-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: "gem-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
|
-
module: "track-click",
|
55
|
+
module: "gem-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
|
-
module: "track-click",
|
66
|
+
module: "gem-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="gem-track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
|
81
|
+
</div>
|
71
82
|
</div>
|
72
83
|
</div>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
%>
|
10
10
|
<% if items.any? %>
|
11
11
|
<% unless within_multitype_list %>
|
12
|
-
<ol class="gem-c-highlight-boxes" <%= "data-module=track-click" if highlight_boxes_helper.data_tracking? %>>
|
12
|
+
<ol class="gem-c-highlight-boxes" <%= "data-module=gem-track-click" if highlight_boxes_helper.data_tracking? %>>
|
13
13
|
<% end %>
|
14
14
|
<% items.each do |content_item| %>
|
15
15
|
<li class="gem-c-highlight-boxes__item-wrapper <%= half_width_class %>">
|
@@ -9,7 +9,7 @@
|
|
9
9
|
%>
|
10
10
|
<% if card_helper.href || card_helper.extra_links.any? %>
|
11
11
|
<div class="<%= classes %> <%= brand_helper.brand_class %>"
|
12
|
-
<%= "data-module=track-click" if card_helper.is_tracking? %>
|
12
|
+
<%= "data-module=gem-track-click" if card_helper.is_tracking? %>
|
13
13
|
<%= "lang=#{card_helper.lang}" if card_helper.lang %>>
|
14
14
|
<div class="gem-c-image-card__text-wrapper">
|
15
15
|
<div class="gem-c-image-card__header-and-context-wrapper">
|
@@ -16,7 +16,7 @@
|
|
16
16
|
classes << "gem-c-metadata--inverse" if inverse
|
17
17
|
%>
|
18
18
|
<%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
|
19
|
-
<dl data-module="track-click">
|
19
|
+
<dl data-module="gem-track-click">
|
20
20
|
<% if from.any? %>
|
21
21
|
<dt class="gem-c-metadata__term"><%= t("govuk_component.metadata.from", default: "From") %>:</dt>
|
22
22
|
<dd class="gem-c-metadata__definition">
|
@@ -26,7 +26,7 @@
|
|
26
26
|
%>
|
27
27
|
<<%= wrapping_element %>
|
28
28
|
class="<%= wrapper_classes.join(" ") %>"
|
29
|
-
<%= "data-module=track-click" if organisation[:data_attributes] %>
|
29
|
+
<%= "data-module=gem-track-click" if organisation[:data_attributes] %>
|
30
30
|
>
|
31
31
|
<% if organisation[:url] %>
|
32
32
|
<%= link_to organisation[:url],
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
role="navigation"
|
5
5
|
aria-label="<%= t("govuk_component.previous_and_next_navigation.pagination", default: "Pagination") %>"
|
6
6
|
>
|
7
|
-
<ul class="gem-c-pagination__list" data-module="track-click">
|
7
|
+
<ul class="gem-c-pagination__list" data-module="gem-track-click">
|
8
8
|
<% if local_assigns.include?(:previous_page) %>
|
9
9
|
<li class="gem-c-pagination__item gem-c-pagination__item--previous">
|
10
10
|
<a href="<%= previous_page[:url] %>"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
2
3
|
id ||= nil
|
3
4
|
id_prefix ||= "radio-#{SecureRandom.hex(4)}"
|
4
5
|
items ||= []
|
@@ -54,7 +55,7 @@
|
|
54
55
|
<% end %>
|
55
56
|
<% else %>
|
56
57
|
<%= tag.legend class: legend_classes do %>
|
57
|
-
<%=
|
58
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-fieldset__heading") %>
|
58
59
|
<% end %>
|
59
60
|
<% end %>
|
60
61
|
<% end %>
|
@@ -19,10 +19,12 @@
|
|
19
19
|
data: {
|
20
20
|
module: "show-password",
|
21
21
|
disable_form_submit_check: disable_form_submit_check,
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
show_text: t('components.show_password.show'),
|
23
|
+
hide_text: t('components.show_password.hide'),
|
24
|
+
show_full_text: t('components.show_password.show_password'),
|
25
|
+
hide_full_text: t('components.show_password.hide_password'),
|
26
|
+
announce_show: t('components.show_password.announce_show'),
|
27
|
+
announce_hide: t('components.show_password.announce_hide')
|
26
28
|
} do %>
|
27
29
|
<%= render "govuk_publishing_components/components/input", {
|
28
30
|
label: label,
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
29
29
|
</script>
|
30
30
|
|
31
|
-
<h2 class="<%= classes %>" data-module="track-click">
|
31
|
+
<h2 class="<%= classes %>" data-module="gem-track-click">
|
32
32
|
<span class="gem-c-step-nav-header__part-of">Part of</span>
|
33
33
|
<% if path %>
|
34
34
|
<a href="<%= path %>"
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<% if links.any? %>
|
7
7
|
<div
|
8
8
|
class="gem-c-step-nav-related <%= "gem-c-step-nav-related--singular" if links.length == 1 %>"
|
9
|
-
data-module="track-click">
|
9
|
+
data-module="gem-track-click">
|
10
10
|
<h2 class="gem-c-step-nav-related__heading">
|
11
11
|
<span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
|
12
12
|
<% if links.length == 1 && !always_display_as_list %>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<% end %>
|
28
28
|
<ul
|
29
29
|
class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>"
|
30
|
-
<%= "data-module=track-click" if sl_helper.tracking_is_present? %>
|
30
|
+
<%= "data-module=gem-track-click" if sl_helper.tracking_is_present? %>
|
31
31
|
>
|
32
32
|
<% if sl_helper.email_signup_link.present? %>
|
33
33
|
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
|
@@ -9,7 +9,7 @@
|
|
9
9
|
taxonomy_list_helper = GovukPublishingComponents::Presenters::TaxonomyListHelper.new(image_cards)
|
10
10
|
%>
|
11
11
|
<% if highlight_box || document_list || image_cards %>
|
12
|
-
<ul class="gem-c-taxonomy-list" data-module="track-click">
|
12
|
+
<ul class="gem-c-taxonomy-list" data-module="gem-track-click">
|
13
13
|
<% if image_cards %>
|
14
14
|
<% taxonomy_list_helper.image_card_data.each do |image_card| %>
|
15
15
|
<li class="gem-c-taxonomy-list__item">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<nav role="navigation"
|
8
8
|
class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
|
9
9
|
aria-label="<%= t("common.translations") %>"
|
10
|
-
<%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
|
10
|
+
<%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
|
11
11
|
>
|
12
12
|
<ul class="gem-c-translation-nav__list">
|
13
13
|
<% translation_helper.translations.each.with_index do |translation, i| %>
|
@@ -274,6 +274,35 @@ examples:
|
|
274
274
|
text: "How people read"
|
275
275
|
content:
|
276
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>"
|
277
306
|
condensed_layout:
|
278
307
|
description: |
|
279
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.
|
@@ -97,3 +97,25 @@ examples:
|
|
97
97
|
url: '/browse/abroad'
|
98
98
|
- title: 'Travel abroad'
|
99
99
|
url: '/browse/abroad/travel-abroad'
|
100
|
+
with_border:
|
101
|
+
description: "Set a border below the breadcrumb. Off by default."
|
102
|
+
data:
|
103
|
+
border: "bottom"
|
104
|
+
breadcrumbs:
|
105
|
+
- title: "Section"
|
106
|
+
url: "/section"
|
107
|
+
- title: "Sub-section"
|
108
|
+
url: "/section/sub-section"
|
109
|
+
- title: "Sub-sub-section"
|
110
|
+
url: "/section/sub-section/sub-section"
|
111
|
+
with_border_and_collapse_on_mobile:
|
112
|
+
data:
|
113
|
+
border: "bottom"
|
114
|
+
collapse_on_mobile: true
|
115
|
+
breadcrumbs:
|
116
|
+
- title: "Section"
|
117
|
+
url: "/section"
|
118
|
+
- title: "Sub-section"
|
119
|
+
url: "/section/sub-section"
|
120
|
+
- title: "Sub-sub-section"
|
121
|
+
url: "/section/sub-section/sub-section"
|
@@ -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"
|
@@ -45,7 +45,7 @@ examples:
|
|
45
45
|
data:
|
46
46
|
padding_top: false
|
47
47
|
block: |
|
48
|
-
<div class="gem-c-breadcrumbs " data-module="track-click">
|
48
|
+
<div class="gem-c-breadcrumbs " data-module="gem-track-click">
|
49
49
|
<ol>
|
50
50
|
<li class="">
|
51
51
|
<a data-track-category="breadcrumbClicked" data-track-action="1" data-track-label="/section" data-track-options="{"dimension28":"2","dimension29":"Section"}" class="gem-c-breadcrumbs--inverse" aria-current="false" href="/section">Section</a>
|