govuk_publishing_components 23.14.0 → 24.2.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/components/accordion.js +286 -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/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/_document-list.scss +6 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +35 -44
- 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/models/govuk_publishing_components/component_doc.rb +1 -1
- data/app/views/govuk_publishing_components/audit/show.html.erb +26 -26
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +13 -20
- 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 +11 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +5 -2
- 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 +8 -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 +42 -7
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +11 -0
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +9 -4
- 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
@@ -1,12 +1,12 @@
|
|
1
1
|
.gem-c-success-alert {
|
2
|
-
color: $
|
3
|
-
padding:
|
4
|
-
border: $
|
2
|
+
color: $govuk-text-colour;
|
3
|
+
padding: govuk-spacing(3);
|
4
|
+
border: $govuk-border-width-narrow solid $govuk-success-colour;
|
5
5
|
@include govuk-responsive-margin(8, "bottom");
|
6
6
|
|
7
7
|
@include govuk-media-query($from: tablet) {
|
8
|
-
padding:
|
9
|
-
border-width: $
|
8
|
+
padding: govuk-spacing(4);
|
9
|
+
border-width: $govuk-border-width;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
@@ -17,10 +17,10 @@
|
|
17
17
|
|
18
18
|
.gem-c-success-summary__title {
|
19
19
|
margin-top: 0;
|
20
|
-
margin-bottom:
|
20
|
+
margin-bottom: govuk-spacing(3);
|
21
21
|
|
22
22
|
@include govuk-media-query($from: tablet) {
|
23
|
-
margin-bottom:
|
23
|
+
margin-bottom: govuk-spacing(4);
|
24
24
|
}
|
25
25
|
|
26
26
|
@include govuk-font(24, $weight: bold);
|
@@ -32,5 +32,5 @@
|
|
32
32
|
}
|
33
33
|
|
34
34
|
.gem-c-success-alert:focus {
|
35
|
-
outline: $
|
35
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
36
36
|
}
|
@@ -2,30 +2,38 @@
|
|
2
2
|
//
|
3
3
|
// TODO: Replace with the print styles that will come from GOV.UK Frontend.
|
4
4
|
|
5
|
+
@import "govuk_publishing_components/component_support";
|
5
6
|
@import "../accordion";
|
6
7
|
|
7
8
|
// Open all of the accordion sections.
|
8
|
-
.
|
9
|
+
.gem-c-accordion__section-content {
|
9
10
|
display: block !important; // stylelint-disable-line declaration-no-important
|
10
11
|
}
|
11
12
|
|
12
13
|
// Change the colour from the blue link colour to black.
|
13
|
-
.
|
14
|
+
.gem-c-accordion__section-button {
|
14
15
|
color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
|
15
16
|
}
|
16
17
|
|
18
|
+
// Removing spacing
|
19
|
+
.gem-c-accordion__section-header {
|
20
|
+
padding-bottom: govuk-spacing(1);
|
21
|
+
}
|
22
|
+
|
17
23
|
// Change the summary subheading size.
|
18
|
-
.
|
24
|
+
.gem-c-accordion__section-summary {
|
19
25
|
@include govuk-typography-common;
|
20
26
|
@include govuk-typography-responsive($size: 16, $important: true);
|
27
|
+
}
|
21
28
|
|
22
|
-
|
23
|
-
|
24
|
-
|
29
|
+
// Hide the unusable "Show all sections" button and the "Chevron" icons.
|
30
|
+
.gem-c-accordion__open-all,
|
31
|
+
.gem-c-accordion__icon,
|
32
|
+
.gem-c-accordion__toggle-link {
|
33
|
+
display: none !important; // stylelint-disable-line declaration-no-important
|
25
34
|
}
|
26
35
|
|
27
|
-
// Hide
|
28
|
-
.govuk-
|
29
|
-
.govuk-accordion__icon {
|
36
|
+
// Hide all hidden content
|
37
|
+
.gem-c-accordion .govuk-visually-hidden {
|
30
38
|
display: none !important; // stylelint-disable-line declaration-no-important
|
31
39
|
}
|
data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
$grey-2: #bfc1c3;
|
2
2
|
$white: #ffffff;
|
3
3
|
$number-circle-size: 35px;
|
4
|
-
$stroke-width:
|
4
|
+
$stroke-width: 1px;
|
5
5
|
|
6
6
|
.gem-c-step-nav:not(.gem-c-step-nav--large),
|
7
7
|
.gem-c-step-nav__controls,
|
@@ -63,7 +63,7 @@ $stroke-width: 3px;
|
|
63
63
|
}
|
64
64
|
|
65
65
|
.gem-c-step-nav__circle--number {
|
66
|
-
border: solid
|
66
|
+
border: solid 1px $grey-2;
|
67
67
|
}
|
68
68
|
|
69
69
|
.gem-c-step-nav__step,
|
@@ -1,14 +1,4 @@
|
|
1
1
|
// This file should be included in an application prior to specific components
|
2
2
|
// It provides govuk-frontend but adds no weight to the compiled CSS
|
3
3
|
@import "components/helpers/govuk-frontend-settings";
|
4
|
-
@import "govuk/
|
5
|
-
@import "govuk/tools/all";
|
6
|
-
@import "govuk/helpers/all";
|
7
|
-
$govuk-colours-organisations: map-merge(
|
8
|
-
$govuk-colours-organisations,
|
9
|
-
(
|
10
|
-
"foreign-commonwealth-development-office": (
|
11
|
-
colour: #012169
|
12
|
-
)
|
13
|
-
)
|
14
|
-
);
|
4
|
+
@import "govuk/base";
|
@@ -14,7 +14,7 @@ module GovukPublishingComponents
|
|
14
14
|
stylesheets = Dir["#{path}/app/assets/stylesheets/**/*.scss"]
|
15
15
|
javascripts = Dir["#{path}/app/assets/javascripts/**/*.js"]
|
16
16
|
|
17
|
-
find_components = /(?<=govuk_publishing_components\/components\/)[
|
17
|
+
find_components = /(?<=govuk_publishing_components\/components\/)[a-zA-Z_-]+(?=['"])/
|
18
18
|
|
19
19
|
@find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/
|
20
20
|
find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
|
@@ -69,7 +69,7 @@ module GovukPublishingComponents
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def github_search_url
|
72
|
-
params = { q: "org:alphagov
|
72
|
+
params = { q: "org:alphagov components/components/#{id}", type: "Code" }
|
73
73
|
"https://github.com/search?#{params.to_query}"
|
74
74
|
end
|
75
75
|
|
@@ -39,16 +39,16 @@
|
|
39
39
|
</div>
|
40
40
|
</details>
|
41
41
|
|
42
|
-
<div class="
|
42
|
+
<div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-with-summary-sections">
|
43
43
|
<% @applications.each_with_index do |application, index| %>
|
44
|
-
<div class="
|
45
|
-
<div class="
|
46
|
-
<h2 class="
|
47
|
-
<span class="
|
44
|
+
<div class="gem-c-accordion__section ">
|
45
|
+
<div class="gem-c-accordion__section-header">
|
46
|
+
<h2 class="gem-c-accordion__section-heading">
|
47
|
+
<span class="gem-c-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
|
48
48
|
<%= application[:name] %>
|
49
49
|
</span>
|
50
50
|
</h2>
|
51
|
-
<div class="
|
51
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
|
52
52
|
<% if application[:application_found] %>
|
53
53
|
Warnings:
|
54
54
|
<% if application[:warning_count] > 0 %>
|
@@ -61,7 +61,7 @@
|
|
61
61
|
<% end %>
|
62
62
|
</div>
|
63
63
|
</div>
|
64
|
-
<div id="accordion-with-summary-sections-content-<%= index %>" class="
|
64
|
+
<div id="accordion-with-summary-sections-content-<%= index %>" class="gem-c-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
|
65
65
|
<% if application[:application_found] %>
|
66
66
|
<% application[:warnings].each do |warning| %>
|
67
67
|
<p class="govuk-body">
|
@@ -144,19 +144,19 @@
|
|
144
144
|
} %>
|
145
145
|
|
146
146
|
<% if @components.any? %>
|
147
|
-
<div class="
|
148
|
-
<div class="
|
149
|
-
<div class="
|
150
|
-
<h2 class="
|
151
|
-
<span class="
|
147
|
+
<div class="gem-c-accordion" data-module="gem-c-accordion" id="accordion-default">
|
148
|
+
<div class="gem-c-accordion__section ">
|
149
|
+
<div class="gem-c-accordion__section-header">
|
150
|
+
<h2 class="gem-c-accordion__section-heading">
|
151
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-1">
|
152
152
|
Component files
|
153
153
|
</span>
|
154
154
|
</h2>
|
155
|
-
<div class="
|
155
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
|
156
156
|
Lists what files each component has
|
157
157
|
</div>
|
158
158
|
</div>
|
159
|
-
<div id="accordion-default-content-1" class="
|
159
|
+
<div id="accordion-default-content-1" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-1">
|
160
160
|
<table class="govuk-table">
|
161
161
|
<thead class="govuk-table__head">
|
162
162
|
<tr class="govuk-table__row">
|
@@ -206,18 +206,18 @@
|
|
206
206
|
</div>
|
207
207
|
</div>
|
208
208
|
|
209
|
-
<div class="
|
210
|
-
<div class="
|
211
|
-
<h2 class="
|
212
|
-
<span class="
|
209
|
+
<div class="gem-c-accordion__section ">
|
210
|
+
<div class="gem-c-accordion__section-header">
|
211
|
+
<h2 class="gem-c-accordion__section-heading">
|
212
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
|
213
213
|
Components containing components
|
214
214
|
</span>
|
215
215
|
</h2>
|
216
|
-
<div class="
|
216
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
|
217
217
|
Shows which components contain other components
|
218
218
|
</div>
|
219
219
|
</div>
|
220
|
-
<div id="accordion-default-content-2" class="
|
220
|
+
<div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
|
221
221
|
<dl class="govuk-summary-list">
|
222
222
|
<% @components[:components_containing_components].each do |component| %>
|
223
223
|
<div class="govuk-summary-list__row">
|
@@ -232,18 +232,18 @@
|
|
232
232
|
</dl>
|
233
233
|
</div>
|
234
234
|
</div>
|
235
|
-
<div class="
|
236
|
-
<div class="
|
237
|
-
<h2 class="
|
238
|
-
<span class="
|
235
|
+
<div class="gem-c-accordion__section ">
|
236
|
+
<div class="gem-c-accordion__section-header">
|
237
|
+
<h2 class="gem-c-accordion__section-heading">
|
238
|
+
<span class="gem-c-accordion__section-button" id="accordion-default-heading-2">
|
239
239
|
Components by application
|
240
240
|
</span>
|
241
241
|
</h2>
|
242
|
-
<div class="
|
242
|
+
<div class="gem-c-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
|
243
243
|
Shows which applications use each component
|
244
244
|
</div>
|
245
245
|
</div>
|
246
|
-
<div id="accordion-default-content-2" class="
|
246
|
+
<div id="accordion-default-content-2" class="gem-c-accordion__section-content" aria-labelledby="accordion-default-heading-2">
|
247
247
|
<% if @components[:components_by_application].any? %>
|
248
248
|
<dl class="govuk-summary-list">
|
249
249
|
<% @components[:components_by_application].each do |component| %>
|
@@ -6,42 +6,35 @@
|
|
6
6
|
items ||= []
|
7
7
|
condensed ||= false
|
8
8
|
|
9
|
-
accordion_classes = %w(gem-c-accordion
|
10
|
-
accordion_classes << '
|
9
|
+
accordion_classes = %w(gem-c-accordion)
|
10
|
+
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
11
11
|
accordion_classes << (shared_helper.get_margin_bottom)
|
12
12
|
|
13
13
|
data_attributes ||= {}
|
14
|
-
data_attributes[:module] = '
|
14
|
+
data_attributes[:module] = 'gem-accordion'
|
15
15
|
%>
|
16
16
|
<% if items.any? %>
|
17
17
|
<%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
|
18
18
|
<% items.each_with_index do |item, i| %>
|
19
19
|
<%
|
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
20
|
index = i + 1
|
25
21
|
|
26
22
|
item[:data_attributes] ||= nil
|
27
23
|
|
28
|
-
section_classes = %w(
|
29
|
-
section_classes << '
|
24
|
+
section_classes = %w(gem-c-accordion__section)
|
25
|
+
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
30
26
|
|
31
|
-
summary_classes = %w(
|
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') 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>
|