govuk_publishing_components 35.3.1 → 35.3.3
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/components/cookie-banner.js +11 -5
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +8 -59
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +24 -0
- data/app/controllers/govuk_publishing_components/audit_controller.rb +0 -1
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +49 -57
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +6 -4
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +6 -10
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +9 -0
- data/config/locales/cy.yml +1 -1
- data/lib/govuk_publishing_components/presenters/attachment_helper.rb +4 -0
- data/lib/govuk_publishing_components/presenters/layout_footer_helper.rb +6 -16
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a65b99aa87692b87b842da1d33c81240ab4632d1ee1e5344d28b368a8a4eddf
|
4
|
+
data.tar.gz: cc9f77e7bae24a5a43a8ba7c49be27e3811306b90ad4c82bc9df33b1bffdc08c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95655b6b6deff43a8665714a161b925059d60da25f1d63a39004a5b460dcaa860dbc9eeffd02e2f086b09cb810e61e9dde6eb30db91f68f4e356d88cf0d8ae48
|
7
|
+
data.tar.gz: bc259ebde3123faf6e41cd55cdec44ec13d98c30627ac40fd4336b7ccc06349a672712380d120d1194e3b0c7d086c16f947c8c3c636134dbdab2e0cb374ce8af
|
@@ -76,7 +76,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
76
76
|
|
77
77
|
CookieBanner.prototype.setCookieConsent = function () {
|
78
78
|
if (this.$acceptCookiesButton.getAttribute('data-cookie-types') === 'all') {
|
79
|
-
this.$module.querySelector('.gem-c-cookie-banner__confirmation-
|
79
|
+
this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--accepted').hidden = false
|
80
80
|
}
|
81
81
|
window.GOVUK.approveAllCookieTypes()
|
82
82
|
this.$module.showConfirmationMessage()
|
@@ -92,7 +92,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
92
92
|
}
|
93
93
|
|
94
94
|
CookieBanner.prototype.rejectCookieConsent = function () {
|
95
|
-
this.$module.querySelector('.gem-c-cookie-banner__confirmation-
|
95
|
+
this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--rejected').hidden = false
|
96
96
|
this.$module.showConfirmationMessage()
|
97
97
|
this.$module.cookieBannerConfirmationMessage.focus()
|
98
98
|
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
@@ -100,11 +100,17 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
100
100
|
}
|
101
101
|
|
102
102
|
CookieBanner.prototype.showConfirmationMessage = function () {
|
103
|
-
this.$
|
103
|
+
this.$cookieBannerHeader = document.querySelector('.govuk-cookie-banner__heading')
|
104
|
+
this.$cookieBannerHeader.hidden = true
|
104
105
|
|
106
|
+
this.$cookieBannerMainContent = document.querySelector('.gem-c-cookie-banner__content')
|
105
107
|
this.$cookieBannerMainContent.hidden = true
|
106
|
-
|
107
|
-
this.$
|
108
|
+
|
109
|
+
this.$cookieBannerConfirmationButtons = document.querySelector('.js-confirmation-buttons')
|
110
|
+
this.$cookieBannerConfirmationButtons.hidden = true
|
111
|
+
|
112
|
+
this.$cookieBannerHideButton = document.querySelector('.js-hide-button')
|
113
|
+
this.$cookieBannerHideButton.hidden = false
|
108
114
|
}
|
109
115
|
|
110
116
|
CookieBanner.prototype.isInCookiesPage = function () {
|
@@ -84,7 +84,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
84
84
|
|
85
85
|
// if GA4 is enabled, set attributes on 'show all sections' for tracking using ga4-event-tracker
|
86
86
|
if (this.$module.isGa4Enabled) {
|
87
|
-
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step', index: 0,
|
87
|
+
var showAllAttributesGa4 = { event_name: 'select_content', type: 'step by step', index: 0, index_section_count: this.$module.totalSteps }
|
88
88
|
this.$module.showOrHideAllButton.setAttribute('data-ga4-event', JSON.stringify(showAllAttributesGa4))
|
89
89
|
}
|
90
90
|
}
|
@@ -1,6 +1,13 @@
|
|
1
1
|
@import "govuk_publishing_components/individual_component_support";
|
2
2
|
@import "govuk/components/cookie-banner/cookie-banner";
|
3
|
-
|
3
|
+
|
4
|
+
.gem-c-cookie-banner .govuk-button-group[hidden] {
|
5
|
+
display: none;
|
6
|
+
}
|
7
|
+
|
8
|
+
.govuk-cookie-banner .govuk-cookie-banner__heading[hidden] {
|
9
|
+
display: none;
|
10
|
+
}
|
4
11
|
|
5
12
|
.js-enabled {
|
6
13
|
.gem-c-cookie-banner {
|
@@ -8,20 +15,12 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
|
|
8
15
|
}
|
9
16
|
}
|
10
17
|
|
11
|
-
.gem-c-cookie-banner {
|
12
|
-
background-color: $govuk-cookie-banner-background;
|
13
|
-
}
|
14
|
-
|
15
18
|
// can't be used without js so implement there
|
16
19
|
.gem-c-cookie-banner .gem-c-button {
|
17
20
|
display: none;
|
18
21
|
}
|
19
22
|
|
20
23
|
.gem-c-cookie-banner__confirmation {
|
21
|
-
display: none;
|
22
|
-
position: relative;
|
23
|
-
padding: govuk-spacing(1);
|
24
|
-
|
25
24
|
// This element is focused using JavaScript so that it's being read out by screen readers
|
26
25
|
// for this reason we don't want to show the default outline or emphasise it visually using `govuk-focused-text`
|
27
26
|
&:focus {
|
@@ -29,56 +28,6 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
|
|
29
28
|
}
|
30
29
|
}
|
31
30
|
|
32
|
-
.gem-c-cookie-banner__confirmation-message,
|
33
|
-
.gem-c-cookie-banner__hide-button {
|
34
|
-
display: block;
|
35
|
-
|
36
|
-
@include govuk-media-query($from: desktop) {
|
37
|
-
display: inline-block;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
.gem-c-cookie-banner__confirmation-message {
|
42
|
-
margin-right: govuk-spacing(4);
|
43
|
-
|
44
|
-
@include govuk-media-query($from: desktop) {
|
45
|
-
max-width: 90%;
|
46
|
-
margin-bottom: 0;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
// Override style from design system so we can have consistent
|
51
|
-
// padding on the the banner and the confirmation
|
52
|
-
|
53
|
-
.govuk-cookie-banner {
|
54
|
-
padding-top: 0;
|
55
|
-
}
|
56
|
-
|
57
|
-
// Override the styles from govuk_template
|
58
|
-
// stylelint-disable selector-max-id
|
59
|
-
.gem-c-cookie-banner#global-cookie-message {
|
60
|
-
background-color: $govuk-cookie-banner-background;
|
61
|
-
padding: govuk-spacing(3) 0 0 0;
|
62
|
-
box-sizing: border-box;
|
63
|
-
|
64
|
-
.gem-c-cookie-banner__message,
|
65
|
-
.gem-c-cookie-banner__buttons,
|
66
|
-
.gem-c-cookie-banner__confirmation,
|
67
|
-
.gem-c-cookie-banner__confirmation-message {
|
68
|
-
@include govuk-font($size: 19);
|
69
|
-
}
|
70
|
-
|
71
|
-
p {
|
72
|
-
@include govuk-font($size: 19);
|
73
|
-
margin: 0 0 govuk-spacing(2) 0;
|
74
|
-
}
|
75
|
-
|
76
|
-
.gem-c-cookie-banner__message,
|
77
|
-
.gem-c-cookie-banner__confirmation {
|
78
|
-
margin-bottom: - govuk-spacing(2);
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
31
|
@include govuk-media-query($media-type: print) {
|
83
32
|
.gem-c-cookie-banner {
|
84
33
|
display: none !important; // stylelint-disable-line declaration-no-important
|
data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss
CHANGED
@@ -96,3 +96,27 @@
|
|
96
96
|
border-color: #045f71;
|
97
97
|
}
|
98
98
|
}
|
99
|
+
|
100
|
+
// This change should be removed after relevant govuk-frontend release
|
101
|
+
|
102
|
+
.brand--department-for-business-and-trade {
|
103
|
+
.brand__color {
|
104
|
+
color: #cf102d;
|
105
|
+
|
106
|
+
&:link,
|
107
|
+
&:visited,
|
108
|
+
&:active {
|
109
|
+
color: #cf102d;
|
110
|
+
}
|
111
|
+
|
112
|
+
&:hover,
|
113
|
+
&:focus {
|
114
|
+
color: $govuk-focus-text-colour;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
&.brand__border-color,
|
119
|
+
.brand__border-color {
|
120
|
+
border-color: #cf102d;
|
121
|
+
}
|
122
|
+
}
|
@@ -42,7 +42,9 @@
|
|
42
42
|
tabindex: "-1",
|
43
43
|
"aria-hidden": true,
|
44
44
|
data: data_attributes do %>
|
45
|
-
<% if attachment.
|
45
|
+
<% if attachment.thumbnail_url %>
|
46
|
+
<% image_tag(attachment.thumbnail_url, alt: "") %>
|
47
|
+
<% elsif attachment.document? %>
|
46
48
|
<%= render "govuk_publishing_components/components/attachment/thumbnail_document" %>
|
47
49
|
<% elsif attachment.spreadsheet? %>
|
48
50
|
<%= render "govuk_publishing_components/components/attachment/thumbnail_spreadsheet" %>
|
@@ -28,71 +28,63 @@
|
|
28
28
|
},
|
29
29
|
)))
|
30
30
|
services_cookies ||= nil
|
31
|
-
css_classes = %w(gem-c-cookie-banner govuk-clearfix)
|
31
|
+
css_classes = %w(gem-c-cookie-banner govuk-clearfix govuk-cookie-banner js-banner-wrapper)
|
32
32
|
css_classes << "gem-c-cookie-banner--services" if services_cookies
|
33
33
|
%>
|
34
|
+
|
34
35
|
<div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" data-nosnippet role="region" aria-label="<%= title %>">
|
35
|
-
<div class="govuk-cookie-
|
36
|
-
<div class="
|
37
|
-
<div class="govuk-grid-
|
38
|
-
<
|
39
|
-
|
40
|
-
<
|
41
|
-
|
42
|
-
|
36
|
+
<div class="govuk-cookie-banner__message govuk-width-container">
|
37
|
+
<div class="govuk-grid-row">
|
38
|
+
<div class="govuk-grid-column-two-thirds">
|
39
|
+
<h2 class="govuk-cookie-banner__heading govuk-heading-m"><%= title %></h2>
|
40
|
+
<div tabindex="-1" class="govuk-cookie-banner__content gem-c-cookie-banner__confirmation">
|
41
|
+
<span class="gem-c-cookie-banner__content"><%= text %></span>
|
42
|
+
<p class="gem-c-cookie-banner__confirmation-message--accepted govuk-body" hidden><%= t("components.cookie_banner.confirmation_message.accepted") %>. <span class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></span></p>
|
43
|
+
<p class="gem-c-cookie-banner__confirmation-message--rejected govuk-body" hidden><%= t("components.cookie_banner.confirmation_message.rejected") %>. <span class="gem-c-cookie-banner__confirmation-message"><%= confirmation_message %></span></p>
|
43
44
|
</div>
|
44
45
|
</div>
|
46
|
+
</div>
|
47
|
+
<div class="js-confirmation-buttons govuk-button-group">
|
45
48
|
<% if services_cookies %>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
|
59
|
-
<% end %>
|
60
|
-
</div>
|
61
|
-
<% else %>
|
62
|
-
<div class="govuk-button-group">
|
63
|
-
<%= render "govuk_publishing_components/components/button", {
|
64
|
-
name: "cookies",
|
65
|
-
text: t("components.cookie_banner.buttons.accept_cookies"),
|
66
|
-
data_attributes: {
|
67
|
-
module: "gem-track-click",
|
68
|
-
"accept-cookies": "true",
|
69
|
-
"track-category": "cookieBanner",
|
70
|
-
"track-action": "Cookie banner accepted",
|
71
|
-
"cookie-types": "all",
|
72
|
-
}
|
73
|
-
} %>
|
74
|
-
<%= render "govuk_publishing_components/components/button", {
|
75
|
-
name: "cookies",
|
76
|
-
text: t("components.cookie_banner.buttons.reject_cookies"),
|
77
|
-
data_attributes: {
|
78
|
-
module: "gem-track-click",
|
79
|
-
"reject-cookies": "true",
|
80
|
-
"track-category": "cookieBanner",
|
81
|
-
"track-action": "Cookie banner rejected",
|
82
|
-
}
|
83
|
-
} %>
|
84
|
-
<a class="govuk-link" href="<%= cookie_preferences_href %>"><%= t("components.cookie_banner.buttons.view_cookies") %></a>
|
85
|
-
</div>
|
49
|
+
<%= render "govuk_publishing_components/components/button", {
|
50
|
+
name: "cookies",
|
51
|
+
text: services_cookies.dig(:yes, :text) || "Yes",
|
52
|
+
data_attributes: { module: "gem-track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
53
|
+
} %>
|
54
|
+
<%= render "govuk_publishing_components/components/button", {
|
55
|
+
name: "cookies",
|
56
|
+
text: services_cookies.dig(:no, :text) || "No",
|
57
|
+
data_attributes: { module: "gem-track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
58
|
+
} %>
|
59
|
+
<% if services_cookies[:cookie_preferences] %>
|
60
|
+
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
|
86
61
|
<% end %>
|
62
|
+
<% else %>
|
63
|
+
<%= render "govuk_publishing_components/components/button", {
|
64
|
+
name: "cookies",
|
65
|
+
text: t("components.cookie_banner.buttons.accept_cookies"),
|
66
|
+
data_attributes: {
|
67
|
+
module: "gem-track-click",
|
68
|
+
"accept-cookies": "true",
|
69
|
+
"track-category": "cookieBanner",
|
70
|
+
"track-action": "Cookie banner accepted",
|
71
|
+
"cookie-types": "all",
|
72
|
+
}
|
73
|
+
} %>
|
74
|
+
<%= render "govuk_publishing_components/components/button", {
|
75
|
+
name: "cookies",
|
76
|
+
text: t("components.cookie_banner.buttons.reject_cookies"),
|
77
|
+
data_attributes: {
|
78
|
+
module: "gem-track-click",
|
79
|
+
"reject-cookies": "true",
|
80
|
+
"track-category": "cookieBanner",
|
81
|
+
"track-action": "Cookie banner rejected",
|
82
|
+
}
|
83
|
+
} %>
|
84
|
+
<a class="govuk-link" href="<%= cookie_preferences_href %>"><%= t("components.cookie_banner.buttons.view_cookies") %></a>
|
85
|
+
<% end %>
|
87
86
|
</div>
|
88
|
-
|
89
|
-
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
|
90
|
-
<p class="gem-c-cookie-banner__confirmation-message" role="alert">
|
91
|
-
<span class="gem-c-cookie-banner__confirmation-message__accepted" hidden><%= t("components.cookie_banner.confirmation_message.accepted") %>. </span>
|
92
|
-
<span class="gem-c-cookie-banner__confirmation-message__rejected" hidden><%= t("components.cookie_banner.confirmation_message.rejected") %>. </span>
|
93
|
-
<%= confirmation_message %>
|
94
|
-
</p>
|
95
|
-
<div class="govuk-button-group">
|
87
|
+
<div hidden class="js-hide-button govuk-button-group">
|
96
88
|
<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"><%= t("components.cookie_banner.hide") %></button>
|
97
89
|
</div>
|
98
90
|
</div>
|
@@ -35,6 +35,7 @@
|
|
35
35
|
<div class="<%= width_class %> govuk-!-display-none-print">
|
36
36
|
<h2 class="govuk-footer__heading govuk-heading-m"><%= section[:title] %></h2>
|
37
37
|
<ul class="<%= list_classes.join(' ') %>">
|
38
|
+
<% index_total = section[:items].length %>
|
38
39
|
<% section[:items].each_with_index do |item, index| %>
|
39
40
|
<% if item[:href] && item[:text] %>
|
40
41
|
<li class="govuk-footer__list-item">
|
@@ -48,7 +49,7 @@
|
|
48
49
|
attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
|
49
50
|
|
50
51
|
unless attributes[:data][:ga4_link]
|
51
|
-
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, ga4_section_index, section[:title])
|
52
|
+
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, ga4_section_index, section[:title], index_total)
|
52
53
|
end
|
53
54
|
%>
|
54
55
|
<%= link_to item[:text], item[:href], attributes %>
|
@@ -68,6 +69,7 @@
|
|
68
69
|
<% if meta.any? %>
|
69
70
|
<h2 class="govuk-visually-hidden"><%= t("components.layout_footer.support_links") %></h2>
|
70
71
|
<ul class="govuk-footer__inline-list govuk-!-display-none-print" data-module="gem-track-click" data-track-links-only>
|
72
|
+
<% index_total = meta[:items].length %>
|
71
73
|
<% meta[:items].each_with_index do |item, index| %>
|
72
74
|
<li class="govuk-footer__inline-list-item">
|
73
75
|
<%
|
@@ -78,7 +80,7 @@
|
|
78
80
|
attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
|
79
81
|
|
80
82
|
unless attributes[:data][:ga4_link]
|
81
|
-
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, navigation.length, "Support links")
|
83
|
+
attributes[:data][:ga4_link] = layout_footer_helper.generate_ga4_link_attribute(index, navigation.length, "Support links", index_total)
|
82
84
|
end
|
83
85
|
%>
|
84
86
|
<%= link_to item[:text], item[:href], attributes %>
|
@@ -111,7 +113,7 @@
|
|
111
113
|
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
112
114
|
},
|
113
115
|
"text": "Open Government Licence v3.0",
|
114
|
-
"index_total":
|
116
|
+
"index_total": "1",
|
115
117
|
"type": "footer",
|
116
118
|
}.to_json %>"
|
117
119
|
>
|
@@ -136,7 +138,7 @@
|
|
136
138
|
"index_section_count": layout_footer_helper.ga4_index_section_count.to_s,
|
137
139
|
},
|
138
140
|
"text": "© Crown copyright",
|
139
|
-
"index_total":
|
141
|
+
"index_total": "1",
|
140
142
|
"type": "footer",
|
141
143
|
}.to_json %>"
|
142
144
|
>
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
@@ -16,12 +16,6 @@
|
|
16
16
|
show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search")
|
17
17
|
hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation")
|
18
18
|
show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation")
|
19
|
-
|
20
|
-
navigation_links_length = 1 # GOVUK Logo makes this start from 1
|
21
|
-
navigation_links_columns.each do | column |
|
22
|
-
navigation_links_length = navigation_links_length + column[:menu_contents].length
|
23
|
-
end
|
24
|
-
navigation_links_length = navigation_links_length + popular_links.length
|
25
19
|
%>
|
26
20
|
<header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker ga4-link-tracker" data-track-links-only data-ga4-expandable>
|
27
21
|
<div class="gem-c-layout-super-navigation-header__container govuk-clearfix">
|
@@ -46,7 +40,7 @@
|
|
46
40
|
"index": {
|
47
41
|
"index_section": 0,
|
48
42
|
},
|
49
|
-
"index_total":
|
43
|
+
"index_total": 1
|
50
44
|
}.to_json %>"
|
51
45
|
>
|
52
46
|
<span class="govuk-header__logotype">
|
@@ -225,6 +219,7 @@
|
|
225
219
|
<%= column[:label] %>
|
226
220
|
</h3>
|
227
221
|
<ul class="gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= column[:label].downcase.sub(" ", "-") %>">
|
222
|
+
<% index_total = column[:menu_contents].length %>
|
228
223
|
<% column[:menu_contents].each_with_index do | item, index | %>
|
229
224
|
<%
|
230
225
|
has_description = item[:description].present?
|
@@ -249,7 +244,7 @@
|
|
249
244
|
"index_link": index + 1,
|
250
245
|
"index_section_count": 4,
|
251
246
|
},
|
252
|
-
"index_total":
|
247
|
+
"index_total": index_total,
|
253
248
|
"section": column[:label],
|
254
249
|
}
|
255
250
|
}
|
@@ -275,7 +270,7 @@
|
|
275
270
|
class="gem-c-layout-super-navigation-header__search-form"
|
276
271
|
id="search"
|
277
272
|
data-module="ga4-form-tracker"
|
278
|
-
data-ga4-form='{ "event_name": "search", "type": "header menu bar", "section": "Search GOV.UK", "action": "
|
273
|
+
data-ga4-form='{ "event_name": "search", "type": "header menu bar", "section": "Search GOV.UK", "action": "search", "url": "/search/all" }'
|
279
274
|
data-ga4-form-include-text
|
280
275
|
action="/search"
|
281
276
|
method="get"
|
@@ -302,6 +297,7 @@
|
|
302
297
|
<div class="govuk-grid-column-full">
|
303
298
|
<h3 class="govuk-heading-m"><%= popular_links_heading %></h3>
|
304
299
|
<ul class="govuk-list">
|
300
|
+
<% index_total = popular_links.length %>
|
305
301
|
<% popular_links.each_with_index do | popular_link, index | %>
|
306
302
|
<li class="gem-c-layout-super-navigation-header__popular-item">
|
307
303
|
<%= link_to popular_link[:label], popular_link[:href], {
|
@@ -323,7 +319,7 @@
|
|
323
319
|
"index_link": index + 1,
|
324
320
|
"index_section_count": 4,
|
325
321
|
},
|
326
|
-
"index_total":
|
322
|
+
"index_total": index_total,
|
327
323
|
"section": popular_links_heading,
|
328
324
|
}
|
329
325
|
}
|
@@ -168,3 +168,12 @@ examples:
|
|
168
168
|
filename: department-for-transport-information-asset-register.csv
|
169
169
|
content_type: text/csv
|
170
170
|
file_size: 20000
|
171
|
+
with_custom_thumbnail:
|
172
|
+
data:
|
173
|
+
attachment:
|
174
|
+
title: "Department for Transport, temporary snow ploughs: guidance note"
|
175
|
+
url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/259634/temporary-snow-ploughs.pdf
|
176
|
+
filename: temporary-snow-ploughs.pdf
|
177
|
+
content_type: application/pdf
|
178
|
+
file_size: 20000
|
179
|
+
thumbnail_url: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/791567/thumbnail_the_government_financial_reporting_review_web.pdf.png"
|
data/config/locales/cy.yml
CHANGED
@@ -176,7 +176,7 @@ cy:
|
|
176
176
|
label: Chwilio ar GOV.UK
|
177
177
|
search_button: Chwilio
|
178
178
|
share_links:
|
179
|
-
all_opens_in_new_tab:
|
179
|
+
all_opens_in_new_tab: Bydd rhannu yn agor y dudalen hon mewn tab newydd
|
180
180
|
opens_in_new_tab:
|
181
181
|
show_password:
|
182
182
|
announce_hide: Mae eich cyfrinair wedi'i guddio
|
@@ -1,35 +1,25 @@
|
|
1
1
|
module GovukPublishingComponents
|
2
2
|
module Presenters
|
3
3
|
class LayoutFooterHelper
|
4
|
-
attr_reader :
|
4
|
+
attr_reader :ga4_index_section_count, :ga4_ogl_link_index_section, :ga4_copyright_link_index_section
|
5
5
|
|
6
6
|
def initialize(footer_navigation_section, footer_meta_section)
|
7
|
-
@
|
8
|
-
@ga4_index_section_count = 0
|
7
|
+
@ga4_index_section_count = footer_navigation_section.length
|
9
8
|
@amount_of_meta_sections = 0
|
10
9
|
|
11
|
-
footer_navigation_section.each do |section|
|
12
|
-
@ga4_index_section_count += 1
|
13
|
-
if section[:items]
|
14
|
-
@ga4_index_total += section[:items].length
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
10
|
if footer_meta_section.any?
|
19
11
|
@amount_of_meta_sections = 1
|
20
12
|
@ga4_index_section_count += 1
|
21
|
-
@ga4_index_total += footer_meta_section[:items].length
|
22
13
|
end
|
23
14
|
|
24
|
-
# For our GOVUK footer links, we need to add 2 to the
|
25
|
-
@ga4_index_total += 2
|
15
|
+
# For our GOVUK footer links, we need to add 2 to the index_section_count. This is due to the "Open Government License" and "Crown Copyright" links being defined separately to the rest of our footer links.
|
26
16
|
@ga4_index_section_count += 2
|
27
17
|
|
28
18
|
@ga4_ogl_link_index_section = footer_navigation_section.length + @amount_of_meta_sections + 1
|
29
|
-
@ga4_copyright_link_index_section =
|
19
|
+
@ga4_copyright_link_index_section = @ga4_ogl_link_index_section + 1
|
30
20
|
end
|
31
21
|
|
32
|
-
def generate_ga4_link_attribute(index_link, index_section, section)
|
22
|
+
def generate_ga4_link_attribute(index_link, index_section, section, index_total)
|
33
23
|
{
|
34
24
|
"event_name": "navigation",
|
35
25
|
"type": "footer",
|
@@ -38,7 +28,7 @@ module GovukPublishingComponents
|
|
38
28
|
"index_section": (index_section + 1).to_s,
|
39
29
|
"index_section_count": @ga4_index_section_count.to_s,
|
40
30
|
},
|
41
|
-
"
|
31
|
+
"index_total": index_total.to_s,
|
42
32
|
"section": section,
|
43
33
|
}
|
44
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 35.3.
|
4
|
+
version: 35.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|